/* popups.js									*/
/* last modified: 2005-06-14					*/
/* -------------------------------------------- */

function freeprintUploadWin(url){
	var freeprint = window.open(url, "freeprint", "resizable=yes,scrollbars=yes,menubar=no,width=400,height=360");
	freeprint.focus();
}

function freeprintWin(url, format, seiten) {
	var popup_width_q1 = 350;
	var popup_width_q2 = 350;
	var popup_width_h1 = 350;
	var popup_width_h2 = 480;
	var popup_height_q1 = 300;
	var popup_height_q2 = 500;
	var popup_height_h1 = 400;
	var popup_height_h2 = 400;
	
	var popup_width = eval("popup_width_" + format + "" + seiten);
	//alert(popup_width);
	var popup_height = eval("popup_height_" + format + "" + seiten);;
	var freeprint = window.open(url, "freeprint", "resizable=yes,scrollbars=no,menubar=no,width=" + popup_width + ",height=" + popup_height);
	freeprint.focus();
}

function showTT_proof(e) {
  document.getElementById("proof_tt").style.top = "18px";
  document.getElementById("proof_tt").style.left = "465px";
  document.getElementById("tt_frame_proof").style.top = e.clientY;
  document.getElementById("tt_frame_proof").style.left = e.clientX; 
  document.getElementById("proof_tt").style.visibility = 'visible';
  document.getElementById("tt_frame_proof").style.visibility = 'visible';
}

function hideTT_proof() { 
	document.getElementById("proof_tt").style.visibility = 'hidden';
  document.getElementById("tt_frame_proof").style.visibility = 'hidden';
  selectedRow = -1;
}

function openScreenProofWinDEMO(proof_url) {
   var pop_w  = 1100;
   var pop_h  = 650;

   var win_w  = window.innerWidth  || document.body.clientWidth;
   var win_h  = window.innerHeight || document.body.clientHeight;
   var win_oh = window.outerHeight - win_h;
   	   win_h += (win_oh)? win_oh : 0;
   var win_x  = window.screenX || window.screenLeft;
   var win_y  = window.screenY || window.screenTop;
   var pos_x  = win_x + (win_w/2 - pop_w/2);
   var pos_y  = win_y + (win_h/2 - pop_h/2);
   window.open(proof_url, "", "width="+ pop_w +",height="+ pop_h +",left="+ pos_x +",top="+ pos_y); 
	 hideTT_proof();
}

function is_screenproofdemo_win() {
  return ( _screenproofdemo_win && _screenproofdemo_win.closed!=undefined && !_screenproofdemo_win.closed );
}

function trueprintWin(url) {
	var trueprint = window.open(url, "trueprint", "resizable=yes,scrollbars=no,menubar=no,width=400,height=360");
	trueprint.focus();
}

function helpWin(url) {
	//var url = escape(url);
	var help = window.open(url, "help", "resizable=yes,scrollbars=yes,menubar=no,width=280,height=240");
	help.focus();
}

function helpWin2(url,w,h) {
	var help2 = window.open(url, "help2", "resizable=yes,scrollbars=yes,menubar=no,width="+w+",height="+h);
	help2.focus();
}

function calendarWin(url, formname, fieldname, sid) {
	var url = url;
	var formname = formname;
	var fieldname = fieldname;
	var target = "";
	if(isNaN(formname) == false) {
		target = eval ("document.forms["+formname+"]."+fieldname);
	} else {
		target = eval("document."+formname+"."+fieldname);
	}
	var value = target.value;
	url += "?sid=" + sid;
	url += "&formname=" + formname;
	url += "&fieldname=" + fieldname;
	url += "&value=" + value;
	calendar = window.open( url, 'calendar','resizable=1, menubar=0,toolbar=0,status=0,scrollbars=auto,width=211,height=250');
	calendar.focus();
}

function openLivetourWin(url) {
	livetour = window.open(url, "livetour", "resizable=no,menubar=no,toolbar=no,status=no,scrollbars=no,width=360,height=370");
	livetour.focus();
}

function formA4(url,name,needSID) {
	var sid		= "";
	var url		= url;
	var winname	= name;
	if(url == "") { url = "#"; }
	if(winname == "") { winname = "formA4"; }
	if((needSID == "y") && (url != "#")) {
		sid = parent.document.forms[0].sid.value;
		if(url.indexOf("?")>0) { url = url+"&sid="+sid; } else { url = url+"?sid="+sid; }
	}
	var formA4 = window.open(url, winname, "resizable=yes,scrollbars=yes,menubar=yes,toolbar=no,width=710,height=750");
	formA4.focus();
}

function winExt(url,name,b,h) {
	var url		= url;
	var winname	= name;
	breite		= b;
	hoehe		= h;
	if(url == "") { url = "#"; }
	if(winname == "") { winname = "winExt"; }
	if(breite == 0) { breite = 660; } // 450
	if(hoehe == 0) { hoehe = 750; } // 600
	var winExt = window.open(url, winname, "resizable=yes,scrollbars=yes,menubar=yes,toolbar=no,width="+breite+",height="+hoehe);
	winExt.focus();
}

/* -------------------------------------------- */
/* EOF */

