var czwin="";

function addEvent(obj, evType, fn)
{ 
	if (obj.addEventListener)
	{obj.addEventListener(evType, fn, false);return true;}
	else if (obj.attachEvent)
	{var r = obj.attachEvent("on"+evType, fn);return r;}
	else {return false;} 
}

function popup(info)
{
	width=screen.width/2
	height=screen.height/2
	
	if(window.innerWidth)
	{
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/4)-50;
	}
	else
	{
		LeftPosition =(parseInt(window.screen.width)-	width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;
	}
	
	attr = 'resizable=no,scrollbars=yes,width=' + width + ',height=' +
	height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
	TopPosition + '';
	popWin=open('', 'new_window', attr);
	popWin.document.write(info);
	popWin.document.write('<body>');
}

function Popup2(var1, var2)
{window.open(var1, var2, "width=450,height=500,resizable=1,scrollbars=1");}

function mapinfo(office)
{
	document.getElementById("mapinfo").innerHTML=ajaxrun("ajaxpgs/locations.php?Page=mapinfo&office="+office, "");
}


function rotatePage()
{
	var ids=ajaxrun("ajaxpgs/index.php?Page=random", "");
	document.getElementById("dispTable").innerHTML=ajaxrun("ajaxpgs/index.php?Page=rotate&ids="+ids, "");
}

function rotatePage2(id)
{
	//alert(id);
	var ids=ajaxrun("ajaxpgs/index.php?Page=random&id="+id,"");
	//alert(ids);	
	document.getElementById("dispTable").innerHTML=ajaxrun("ajaxpgs/index.php?Page=rotate&ids="+ids, "");
}

function conferences()
{document.getElementById("content").innerHTML=ajaxrun("conferences_ajax.php?Page=cons", document.getElementById("conf"));}

function newWindow(URL, WinWidth, WinHeight, resizeable, menubar, scrollbar)
{
	var ScreenVars="";
	//status=1,location=1,resizable=1,scrollbars=1,menubar=1,toolbar=1,directories=1
	
	if ((screen.width<=800) && (screen.height<=600))
	{ScreenVars = ScreenVars+"left=0,top=0";}
	else
	{
		if(WinWidth!="")
		{ScreenVars = ScreenVars+"left="+screen.width*.25+",top=200";}
		else
		{ScreenVars = ScreenVars+"left=0,top=0";}
	}
	
	if (resizeable == "Y")
	{ScreenVars = ScreenVars+",resizable=1";}
	if (scrollbar == "Y")
	{ScreenVars = ScreenVars+",scrollbars=1";}
	if (menubar == "Y")
	{
		ScreenVars = ScreenVars+",menubar=1";
		if(BrowserDetect.browser+BrowserDetect.version=="Explorer7")
		{ScreenVars = ScreenVars+",toolbar=1";}
	}
	
	if (WinWidth!="" && WinHeight!="")
	{ScreenVars = ScreenVars+",width="+WinWidth+",height="+WinHeight;}
	else
	{ScreenVars = ScreenVars+",width="+screen.width+",height="+screen.height;}
		
	//alert(URL+'::KLJ Pop Up::'+ ScreenVars);				
	czwin=window.open(URL, 'KLJFTP', ScreenVars);
}