
//********************************Changed for Multiple Parameters - 13-Oct-2004***************** 


function fncLookUp(strSQL, strPKey, arrColHead, strCopy)
{	
	//Used to connect to OMIS DB, and when filed names are not passed
	
//	alert('test');
	
	var strColHead; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead 		
	
	//Size and width of window for width = 800
	if(intResolution==800)
	{	
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (54/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=210";		
		
	}
	
	//Size and width of window for width = 1024
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (43/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";
	}	
	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strCopy="+strCopy
	
	strURL= "../Lookup/Lookup.aspx"+"?"+strQuery		
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();	
	
}  

function fncCDBLookUp(strSQL, strPKey, arrColHead, strConnTo)
{

	//Used to connect to CORP DB, and when filed names are not passed
	var strColHead; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead 		
			
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (52/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=210";				
	}
	
	//Size and width of window for width = 1024
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (43/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";
	}	
		
	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strConnTo="+strConnTo
	strURL= "../Lookup/Lookup.aspx"+"?"+strQuery			
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();			
	
}  


function fncAliasLookUp(strSQL, strPKey, arrColHead, arrColField, strCopy)
{
	//Used to connect to OMIS, and when filed names are passed

	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	strColField="";
		
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead	
	
	/* Alias Fields */
	for(i=0; i < arrColField.length; i++)
	{
		if(strColField.length > 0)
		{
			strColField = strColField + "~" + arrColField[i]
		}
		else
		{
			strColField  = arrColField[i]
		}		
	}	
	
	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strColField="+strColField+"&"+"strCopy="+strCopy
				
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (56/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=205";				
	}
	
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (42/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";		
	}	
	strURL= "../Lookup/Lookup.aspx"+"?"+strQuery		
	
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();			
}  
function fncAliasLookUp1(strSQL, strPKey, arrColHead, arrColField, strCopy)
{
	//Used to connect to OMIS, and when filed names are passed

	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	strColField="";
		
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead	
	
	/* Alias Fields */
	for(i=0; i < arrColField.length; i++)
	{
		if(strColField.length > 0)
		{
			strColField = strColField + "~" + arrColField[i]
		}
		else
		{
			strColField  = arrColField[i]
		}		
	}	
	
	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strColField="+strColField+"&"+"strCopy="+strCopy
				
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (56/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=205";				
	}
	
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (42/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";		
	}	
	strURL= "../Lookup/Lookup1.aspx"+"?"+strQuery		
	
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();			
}  

function fncAliasLookUpNew(strSQL, strPKey, arrColHead, arrColField, strCopy)
{
	//Used to connect to OMIS, and when filed names are passed

	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	strColField="";
		
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead	
	
	/* Alias Fields */
	for(i=0; i < arrColField.length; i++)
	{
		if(strColField.length > 0)
		{
			strColField = strColField + "~" + arrColField[i]
		}
		else
		{
			strColField  = arrColField[i]
		}		
	}	
	
	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strColField="+strColField+"&"+"strCopy="+strCopy
				
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (56/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=205";				
	}
	
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (42/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";		
	}	
	strURL= "./Lookup/Lookup.aspx"+"?"+strQuery		
	alert(strURL);
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();			
}  


function fncAliasLookUpDynamic(strSQL, strPKey, arrColHead, arrColField, strRow, strCopy)
{
	//Used to connect to OMIS, and when filed names are passed
	
	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	strColField="";
		
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead	
	
	/* Alias Fields */
	for(i=0; i < arrColField.length; i++)
	{
		if(strColField.length > 0)
		{
			strColField = strColField + "~" + arrColField[i]
		}
		else
		{
			strColField  = arrColField[i]
		}		
	}	

	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strColField="+strColField+"&"+"strCopy="+strCopy + "&strRow=" + strRow
		
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (56/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=205";				
	}
	
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (42/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";		
	}	
	alert("H");
	strURL= "./Lookup/Lookup.aspx"+"?"+strQuery			
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();			
}  


function fncCDBAliasLookUp(strSQL, strPKey, arrColHead, strConnTo, arrColField)
{

	//Used to connect to CORP DB, and when filed names are passed
	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	strColField="";
	
	// Query String for Col Header	
	for(i=0; i < arrColHead.length ; i++)
	{	
		if(strColHead.length > 0)
		{
			strColHead = strColHead  + "~" + arrColHead[i]		
		}
		else
		{
			strColHead = arrColHead[i]			
		}		
	}	
	strColHead = "strColHead=" + strColHead	
	
	/* Alias Fields */
	for(i=0; i < arrColField.length; i++)
	{
		if(strColField.length > 0)
		{
			strColField = strColField + "~" + arrColField[i]
		}
		else
		{
			strColField  = arrColField[i]
		}		
	}
	

	strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strConnTo="+strConnTo+"&"+"strColField="+strColField
	//strQuery="strSQL="+strSQL+"&"+"strPKey="+strPKey+"&"+strColHead+"&"+"strConnTo="+strConnTo+"&"+"
	//alert(strQuery)
			
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (52/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=210";				
	}
	
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (38/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";		
	}		
	
	strURL= "../Lookup/Lookup.aspx"+"?"+strQuery			
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();			
	
}  

function fncPopUpInfo(strURL,strAccountNo,strGLCode)
{
	
	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;	
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		
		w = (screen.width)* (60/100)
		h = (screen.height)* (30/100)
		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		sparamv = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0'
		//sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=400,top=300";
	}
	
	if(intResolution >=1024)
	{
		newX = 0;
		newY = 0;
		w = (screen.width)* (40/100)
		h = (screen.height)* (20/100)
				
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;		
		sparamv = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0'
		//sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";
	}			
		
	strURL = strURL + "?strGLCode=" + strGLCode + "&strAccountNo=" + strAccountNo	
	window.open(strURL,"Info",sparamv);
	//window.open(strURL);

}

function fncPopUpGroupID(strURL)
{
	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;	
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;
	
	//Size and width of window for width = 800
	if(intResolution==800)
	{	
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (54/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=210";		
		
	}
	
	//Size and width of window for width = 1024
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (43/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";
	}		
		
	window.open(strURL,"CallPickup",sparamv);
	//window.open(strURL);
}

function fncPopUpCCM(strURL, strRequestNo, strValue, strSeqNo)
{
	
	var strColHead; 
	var strColField; 
	var strControl;
	var newX;
	var newY;	
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
			
	intResolution = screen.width;	
	
	if(intResolution==800)
	{		
		newX = 0;
		newY = 0;
		
		w = (screen.width)* (70/100)
		h = (screen.height)* (50/100)
		
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		sparamv = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0,scrollbars=1'
		//sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=400,top=300";
	}
	
	if(intResolution >=1024)
	{
		newX = 0;
		newY = 0;
		w = (screen.width)* (55/100)
		h = (screen.height)* (50/100)
				
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;		
		sparamv = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0,scrollbars=1'
		//sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";
	}			
	strURL = strURL + "?strRequestNo=" + strRequestNo + "&strValue=" + strValue + "&strSeqNo=" + strSeqNo	
	//window.open(strURL)
	
	window.open(strURL,"CCM",sparamv);

}


function fncDataLookUp(strRefId)
{	
	//Used to connect to OMIS DB, and when filed names are not passed
	
	var strColHead; 
	var strControl;
	var newX;
	var newY;
	var strURL;
	var strQuery;		
	var intResolution;
	var sparamv;
	var rpath;
	var strSQL; 
			
	intResolution = screen.width;	
	strColHead="";
	strControl="";
	strSQL = "";
	
	
	//Size and width of window for width = 800
	if(intResolution==800)
	{	
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (50/100)
		lookUpHeight = (screen.height)* (54/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max=no,screenX=" + newX + ",screenY=" + newY + ",left=375,top=210";		
		
	}
	
	//Size and width of window for width = 1024
	if(intResolution>=1024)
	{
		newX = 0;
		newY = 0;
		lookUpWidth = (screen.width)* (45/100)
		lookUpHeight = (screen.height)* (43/100)
		sparamv	= "width=" + lookUpWidth + ",height =" + lookUpHeight + ", toolbar=no,location=no,directories=no,status=no,resizable=no,max =no,screenX=" + newX + ",screenY=" + newY + ",left=450,top=350";
	}	
	strQuery="strSQL="+strSQL+"&"+"strRefId="+strRefId
	
	strURL= "../Lookup/Lookup.aspx"+"?"+strQuery		
	PopUp1=window.open(strURL,"Lookup",sparamv);
	PopUp1.focus();	
	
}  
