/***********************************************************************************************/
/************ Windows Functions ****************************************************************/
/***********************************************************************************************/

/* popWinUrl: url of the window to popup
 * returnObjName: Name of the object in the main page on which the value from the popup window gets returned
 */ 
function OpenCalculationWindow(popWinUrl, returnObjName, width,height)
{ 
alert('opencal');
  if (width == null)
  { width = 400; }
  if (height == null)
  { height = 250; }
  Window = window.open(popWinUrl,"calWub", "width=" + width +",height="+ height + ",top=360,left=360,status=no,scrollbars=yes,resizable=yes,location=0,menubar=0,toolbar=no");
	/*
	// this allows us to bypass window.opener limitation
	var ret = showModalDialog(popWinUrl,"","dialogWidth:" + width +"px;dialogHeight:" + height + "px;status:no"); 
	// if there is a value to return
	if (ret !=  null) 
	{
		// creates a temp object referenced to passed textBox
		var temp = document.getElementById(returnObjName);
		
		// sets the value
		temp.value = ret;
	}
	*/
}

/* Open Calendar Picker Window */
function openCalendar(dateval,  caltype, name)
{
			Window = window.open("/eClientBeta/App_Help/Calendar.aspx?date="+dateval+"&type="+caltype+"&name="+name,"popupcalendar","width=177,height=140,top=360,left=360'status=no,scrollbars=no,resizable=no,location=0,menubar=0,toolbar=no");
			
			Window.focus();
}

/* Open dexcription code list Window */
function openClassDesc(classcode, objid)
{
		//alert(document.getElementById(classcodeobj));
		
		
			Window = window.open("/eClientBeta/App_Help/ClassDesc.aspx?classcode="+classcode,"popupQuoteHelp","width=400,height=140,top=360,left=360'status=no,scrollbars=yes,resizable=no,location=0,menubar=0,toolbar=no");
			
			Window.focus();
			
			
}


/* Open Help Window */    
function openHelp(which,  name, width, height)
{
   if (name == null) name="helpWIndow";
  if (width == null) width = 480;
  if (height == null) height = 320;  
	Window=window.open(which, name,"width="+width +",height=" + height +",status=no,scrollbars=yes,resizable=yes,location=0,menubar=no,toolbar=no");
	Window.focus();
}


/* Open Help Window */    
function openDescription(which)
{
	Window=window.open(which,"descWindow","width=480,height=180,status=no,scrollbars=yes,resizable=no,location=0,menubar=0,toolbar=no");
	Window.focus();
}




/* Open Popup Window */
function openWindow(which, name, width,  height)
{
if (width == null)
{
width = 480;
}
if (height == null)
{
height = 320;
}
	Window=window.open(which, name,"width="+width +",height=" + height +",status=yes,scrollbars=yes,resizable=yes,location=0,menubar=yes,toolbar=no");
	Window.focus();
}

/* Open New Page on Opener Page */
function openInMainWindow(which)
{
	window.opener.location.href = which;
	window.opener.focus();
}
/* Open Popup Window Without any toolbar */
function popupPDF(which,  name)
{

	Window=window.open(which, name, "width=480,height=320,status=no,scrollbars=yes,resizable=yes,location=0,menubar=1,toolbar=no");
	Window.focus();
}
	
/* Open Popup Window */
function popupPDF(which, name,   width,  height)
{
	Window=window.open(which, name,"width="+width +",height=" + height +",status=yes,scrollbars=no,resizable=yes,location=0,menubar=no,toolbar=no");
	Window.focus();
}

