function opencart()
{
	servname = location.host;
	issue = "4576";
	cidval = ''; // Attempt to fill
	editval = ''; // Attempt to fill


	// Get GET argument values
	q = window.location.search
	if(q.length > 1){
		q = q.substring(1, q.length);
	}
	pairs = this.q.split("&")
	for(var i=0; i < pairs.length; i++)
	{
		thispair = pairs[i].split("=");
		if(thispair.length != 2){continue;}
		key = thispair[0];
		val = thispair[1];
		key = key.toLowerCase();

		if(key == "cid"){cidval = val;}
		if(key == "edit"){editval = val};
	}


	url = 'http://'+servname+"/sys/nl/ai.esp?iid="+issue+"&cid="+cidval+"&EDIT="+editval;
	PAGEPOPUP(url);
}
function refreshPage()
{
  document.location.reload();
}
function filePopUp( URL )
{
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=600');");
}
function ContactpopUp(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=925,height=650');");
}
function TaskPopUp(URL)
{
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=632,height=650');");
}

function ReportspopUp(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=470');");
}

function BiGpopUp(URL) 
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=610,height=600');");
}

function SopPopUp(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=632,height=650');");
}
function ApptPopUp( URL )
{
	 day = new Date();
	 id = day.getTime();
	 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=600');");
}
function PAGEPOPUP(URL)
{
//    alert('function popup')
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=925,height=700');");
}

function PICKERPOPUP(URL)
{
//    alert('function popup')
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=170,height=390');");
}

function printpage()
{
	window.print()
}

function open_reporter( url, size )
{
	url = url.replace( /&/ig, '%26' );
	window.open('/reporter.esp?fsize='+ size +'&fsrc=' + url, '_blank', 'toolbars=0,scrolling=0,statusbar=0,resizable=1,width=800,height=600' );
}

var saveNotesTimeoutId = 0;
function set_save_notes( sButton )
{

	if(typeof saveNotesTimeoutId == "number")
		window.clearTimeout(saveNotesTimeoutId);
	saveNotesTimeoutId = window.setTimeout( 'save_notes()', 1000 );
	//document.getElementById(el2id['SAVETODOS.BUTTON']).style.visibility='visible';
}

function save_notes()
{
	document.getElementById(el2id['SAVETODOS.BUTTON']).click();
	//document.getElementById(el2id['SAVETODOS.BUTTON']).style.visibility='hidden';
}


function show_tooltip(showit,celement)
{
	var id = document.getElementById(celement);

	//show msg box
	if(showit)
	id.style.display = "block";
	//hide msg box
	else
	id.style.display = "none";
}
