//////////////////////////////////////////
//popwindow.js
//Client functions for popping up a window
//////////////////////////////////////////
function popWindow (URL, width, height, resizable) 
{
	screenWidth = 350;

    if ( parseInt(navigator.appVersion) >= 4 )
		screenWidth = screen.width - width;
    
	winname=width+'_'+height;
	//thepopup=window.open(URL,winname,'top=100,left='+screenWidth+',toolbar=no,directories=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable='+(resizable?'yes':'no')+',copyhistory=no,width='+width+',height='+height);
	thepopup=window.open(URL,winname,'toolbar=no,directories=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable='+(resizable?'yes':'no')+',copyhistory=no,width='+width+',height='+height);	
	thepopup.focus();
}

function popwin (URL){
	thepopup=window.open(URL,'langlay','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=630,height=530');	
	thepopup.focus();
}


function popSizedWin (URL, width, height){
	thepopup=window.open(URL,'sized','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+width+',height='+height);	
	thepopup.focus();
}

function popNokiaWin (URL, width, height, noscroll){
	thepopup=window.open(URL,'sized','toolbar=yes,directories=no,location=yes,status=yes,menubar=no,scrollbars='+(noscroll?'no':'yes')+',resizable=zno,copyhistory=no,width='+width+',height='+height);	
	thepopup.focus();
}

function popRulesWin (URL, winname, width, height){
	thepopup=window.open(URL, winname,'toolbar=no,directories=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+width+',height='+height);	
	thepopup.focus();
}

function popNewsWindow (URL){
	thepopup=window.open(URL,'news','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=600,height=450');	
	thepopup.focus();
}

function popNormalWindow (URL, width, height) 
{
	winname=width+'_'+height;
	thepopup=window.open(URL,winname,'toolbar=yes,directories=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height);	
	thepopup.focus();
}

function popSameWindow (URL) //normal window popup with same dimentions as standard window
{
	winname='_new';
	thepopup=window.open(URL,winname,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');	
	thepopup.focus();
}

function closePopWindow(){ window.close(); }

function popContentWindow(index, obj, width, height) 
{
	thepopup=window.open('',obj.name(i),'toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height);
	thepopup.document.write(obj.HTMLcontent(index));
	thepopup.focus
}

function showPopup( url, posX, posY, width, height, noscroll) {
	var win = window.open( url, "popupWin", "width=" + width + ",height=" + height + ",resizable=no,scrollbars='+(noscroll?'no':'yes')+',left=" + posX + ",top=" + posY );
   	if( parseFloat(navigator.appVersion) >= 4.0 ) {
		win.moveTo( posX, posY );
   		if( navigator.appName.indexOf("Netscape") != -1 )
			win.focus( );
	}
	win.focus()
}

function centerPopup( url, default_left, default_top, width, height, scrollbars, winName) {    
	var posX, posY;

	posX = default_left;
	posY = default_top;

	if( parseFloat(navigator.appVersion) >= 4.0 ) {
		posX = parseInt(screen.availWidth / 2.0) - (width / 2.0);
		posY = parseInt(screen.availHeight / 2.0) - (height / 2.0);
	}

	if (scrollbars) {
		var win = window.open( url, (winName==null ? "popupWin" : winName), "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,location=no,status=yes,left=" + posX + ",top=" + posY );
	} else {
		var win = window.open( url, (winName==null ? "popupWin" : winName), "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=no,left=" + posX + ",top=" + posY );
	}

	if( parseFloat(navigator.appVersion) >= 4.0 ) {
		win.moveTo( posX, posY );
		if( navigator.appName.indexOf("Netscape") != -1 )
			win.focus( );
	}
}

//////////////////////////////////////////
//Udate parent window to use within popups
//////////////////////////////////////////
function updateParent(newURL) {
	opener.document.location = newURL;
	onBlur = setTimeout('window.close()', 1000)
}


//////////////////////////////////////////
//name: New centerpop 
//created: Jason
//date: Jan-16-2006
//////////////////////////////////////////
function popUp(URL, width, height, scrollbars, menubar, location) {
    var popday = new Date();
    var popupid = popday.getTime();
    eval("page" + popupid + " = window.open(URL, '" + popupid + "', 'toolbar=0,scrollbars="+ (scrollbars ? 1 : 0) +",location="+ (location ? 1 : 0) +",statusbar=1,menubar="+ (menubar ? 1 : 0) +",resizable=0,width="+width+",height="+height+",left = 390,top = 249.5');");
}
