
/*
This function opens a new window with the given link, width and height
*/
function openWindow(pageurl, intWidth, intHeight)
{	
	var windowX = (screen.width/2)-(intWidth/2);
	var windowY = (screen.height/2)-(intHeight/2);		
	//var myWindow=window;	
	window.open(pageurl,'newWin'+intWidth,'screenX='+windowX+',left='+windowX+',screenY='+windowY+',top='+windowY+',location=no,resizable=yes,menubar=no,maximize=no, scrollbars=yes,toolbar=no,width='+intWidth+',height='+intHeight);
	//myWindow.focus()
}

/*
This function returns true if the Email address is found and 
will be assigned to the html hidden control
*/
function getrecipientemail(intmailid,strRecipientFieldName)
{	var strMailId;
	strMailId="";
	strMailId=GetMailID(intmailid);
	//alert("Email id : "+strMailId);
	if (strMailId!="")
	{
		var rec
		rec=eval("document."+strRecipientFieldName);
		rec.value=strMailId;
		return true;
	}
	else
	{
		return false;
	}
}

/*
This function returns the child node text of a particular node in the xml file
*/
function GetMailID(intMailID)
{
	var i;
	var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	xmlDoc.async="false";
	//alert("http://"+location.hostname+"/includes/email/xml/emailids.xml");
	if (xmlDoc.load("http://"+location.hostname+"/includes/email/xml/emailids.xml")==true){
		var nodes=xmlDoc.documentElement.childNodes;
		for(i=0;i<nodes.length;i++)
		{
			if (nodes(i).attributes(0).text == intMailID)
			{
				return nodes(i).childNodes.item(0).text;
			}
		}
	}
	
}