/* Global Popup Fuction*/
function popup(url, name, height, width, 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') {
		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" : "";
	
	properties = "height=" + pHeight + ",width=" + pWidth + ",top=" + pTop + ",left=" + pLeft + ",resizable=" + resize + ",scrollbars=" + sbars + ",menubar=" + mbar + ",toolbar=" + tbar + "," + location;
	window.open(url, name, properties);
}

//Kalendar Popup
function popupDate(formname, fieldname){
	window.open(jsWebURL + '/_common/popup/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');
}

/*function popupPath(formname, fieldname){
	window.open('/_common/popup/popup_path.cfm?FORMNAME=' + formname + '&FORMFIELD=' + fieldname, 'popupPath', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=175,height=143,top=200,left=450');
}*/

function popupDateMonth(listname){
	window.open('/_common/popup/calendarmonthpopup.cfm?Listname=' + listname, 'popupCalendar', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=175,height=143,top=200,left=450');
}

function status_text(sStatus){
	window.status = sStatus;
}

function show_question(sText){
	return confirm(sText);
}

function popupServiceBar(filename){
	window.open(filename, 'popupServiceBar', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=806,height=600,top=100,left=100');
}

