function openNewWindow(fileName,windowName,theWidth,theHeight,theLeft,theTop)
{
	if (windowName == "newMessageWindow") 
		{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
		}
	var childwindow = window.open(fileName,windowName,"dependent, alwaysRaised, toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+theWidth+",height="+theHeight)
	var ScreenWidth = window.screen.width;
	var ScreenHeight = window.screen.height;
	if(theLeft>0 && theTop>0)
		{
		if(theLeft+theWidth>ScreenWidth)
			theLeft = (ScreenWidth-theWidth)/2;
		if(theTop+theHeight>ScreenHeight)
			theTop = (ScreenHeight-theHeight)/2;
		try
			{
			childwindow.moveTo(theLeft, theTop);
			}
		catch(e)
			{
			}
		}
	return childwindow;
}
	

function openNewListingWindow(fileName,windowName,theWidth,theHeight,theLeft,theTop)
{
	//This Function was inserted by Joe Schmidt on 9/27/2001 to generate a new window that has Ageng Full report in it from the Single Line tax search.
	if (windowName == "newMessageWindow") 
		{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
		}
	var childwindow = window.open(fileName,windowName,"dependent, alwaysRaised, toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=fullscreen,height=fullscreen")

}
function openNewWindowFinan(fileName,windowName,theWidth,theHeight,theLeft,theTop)
{
	if (windowName == "newMessageWindow") 
		{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
		}
	var childwindow = window.open(fileName,windowName,"dependent, alwaysRaised, toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width="+theWidth+",height="+theHeight)
	var ScreenWidth = window.screen.width;
	var ScreenHeight = window.screen.height;
	if(theLeft>0 && theTop>0)
		{
		if(theLeft+theWidth>ScreenWidth)
			theLeft = (ScreenWidth-theWidth)/2;
		if(theTop+theHeight>ScreenHeight)
			theTop = (ScreenHeight-theHeight)/2;
		try
			{
			childwindow.moveTo(theLeft, theTop);
			}
		catch(e)
			{
			}
		}
	return childwindow;
}

function openNewWindow2(fileName,windowName,theWidth,theHeight,theLeft,theTop)
{
	if (windowName == "newMessageWindow") 
		{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
		}
	var childwindow = window.open(fileName,windowName,"dependent, alwaysRaised, toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+theWidth+",height="+theHeight)
	var ScreenWidth = window.screen.width;
	var ScreenHeight = window.screen.height;
	if(theLeft>0 && theTop>0)
		{
		if(theLeft+theWidth>ScreenWidth)
			theLeft = (ScreenWidth-theWidth)/2;
		if(theTop+theHeight>ScreenHeight)
			theTop = (ScreenHeight-theHeight)/2;
		try
			{
			childwindow.moveTo(theLeft, theTop);
			}
		catch(e)
			{
			}
		}
	return childwindow;
}

function getPhoto(agent_id,type,reload)
{
	var sReloadCode = '';
	if(reload==1)
		sReloadCode = '&reload=1';
	
	var sTypeCode = '';
	if(type!='')
		sTypeCode = '&orig=start&type=' + type;
	
	openNewWindow(protocol + domain + '/wizards/photo/wiz_addphotowhich.asp?opcode=add&agent_id=' + agent_id + sReloadCode + sTypeCode,'newMessageWindow',400,400,200,90);
	return;
}

function BugReport()
{
	openNewWindow(protocol + domain + '/tools/bug_report/bug_report.asp','newMessageWindow',405,358,0,0);
}

function SarCalc()
{
	//openNewWindow(protocol + domain + '/mortTools1.htm','newMessageWindow',600,500,0,0);
	openNewWindowFinan(protocol + domain + '/Java/index.html','newMessageWindow',775,600,0,0);
}

function openNewMapWindow(fileName,windowName,theWidth,theHeight,theLeft,theTop)
{
	if (windowName == "newMessageWindow") 
		{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
		}
	var childwindow = window.open(fileName,windowName,"dependent, alwaysRaised, toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+theWidth+",height="+theHeight)
	var ScreenWidth = window.screen.width;
	var ScreenHeight = window.screen.height;
	if(theLeft>0 && theTop>0)
		{
		if(theLeft+theWidth>ScreenWidth)
			theLeft = (ScreenWidth-theWidth)/2;
		if(theTop+theHeight>ScreenHeight)
			theTop = (ScreenHeight-theHeight)/2;
		try
			{
			childwindow.moveTo(theLeft, theTop);
			}
		catch(e)
			{
			}
		}
}

function ValidateEmail(thisform)
{
	if(thisform.Email1.value == '' && thisform.Client1.selectedIndex < 1 && thisform.Email2.value == '' && thisform.Client2.selectedIndex < 1)
	{
		alert('Please select a recipient for this report.');
		return false;
	}
	else
		return true;
}

