/* Global Popup Fuction*/

function popup(url,name,height,width,pcenter,top,left,resizable,scrollbars,menubar,toolbar,location,statusbar) {

//alert(url + name + height + width + "zentriert" + pcenter + top + left + resizable + scrollbars + menubar + toolbar + location);
	
	
	//Set default Height and Width
	var pHeight = height; 	if (pHeight == '0') pHeight = "400";
	var pWidth = width;		if (pWidth == '0') pWidth = "650";
	
	//Centralize the PopUp if setting the parameter 
	var pcenter = pcenter;
	var pTop = top;
	var pLeft = left;
	
	if (pcenter == '1')	{
//		alert("zentriert");
		pTop = screen.height/2 - pHeight/2; 
		pLeft = screen.width/2 - pWidth/2;
	}
	else	{
	
		//If not Centralize option choose and no other settings, set default Values of Top and Left
		if (pTop == '0') pTop = "10";
		if (pLeft == '0') pLeft = "10";	
	}
	
	//PopUp default properties if parameter not "1"
	var resize = (resizable == '1') ? "yes" : "no";
	var sbars = (scrollbars == '1') ? "yes" : "no";
 	var mbar = (menubar == '1') ? "yes" : "no";
	var tbar = (toolbar == '1') ? "yes" : "no";
	var location = (location == '1') ? "location" : "";
	var statusbar = (statusbar == '1') ? "yes" : "no";


//alert("hoehe= " + pHeight+pWidth+"center="+pcenter+ "Top=" + pTop+pLeft+resize+sbars+mbar+tbar+location);
	
	properties = "height=" + pHeight + ",width=" + pWidth + ",top=" + pTop + ",left=" + pLeft + ",resizable=" + resize + ",scrollbars=" + sbars + ",menubar=" + mbar + ",toolbar=" + tbar + "," + location + ",status=" + statusbar;
	window.open(url,name,properties); 
}

// Function Delete something
function show_question(sText)
{	
	return confirm(sText);
}

//Kalendar Popup
function popupDate(formname,fieldname)
{
window.open('../common/popups/popup_calendar.cfm?FORM='+ formname + '&FIELD='+ fieldname, 'popupCalendar', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=175,height=143,top=200,left=450');
}
