// JavaScript Functions for creating the Popup Windows

//**********************************************************************

/***********************************************************************

	Description: Creates the popup for the portfolio page.

 **********************************************************************/
function drawPopup(lnk, country){
	var popupWidth = 480;
	var popupHeight = 360;
	
	var x, y;

	if (self.screenTop) { // Explorer returns coordinates of viewport
		x = self.screenLeft + (document.documentElement.clientWidth - popupWidth)/2;
		y = self.screenTop + 215;
	} 
	else { // Gecko returns coordinates of browser window
		x = self.screenX + (self.outerWidth - popupWidth)/2;
		y = self.screenY + 380;
	}
	
	window.name = 'homeWindow';
	var url="tpl/detail.php?"+lnk+"&"+country;
	var pf=window.open(url,"companyInfo","width="+popupWidth+",height="+popupHeight+",resizable=1,scrollbars=1,status=1,toolbar=0,menubar=0");

	pf.moveTo(x,y);
	pf.focus();
}


//**********************************************************************

/***********************************************************************

	Description: Creates the popup for the news page.

 **********************************************************************/
function drawNewsPopup(storyNum, country){
	var popupWidth = 650;
	var popupHeight = 700;

	var x, y;

	if (self.screenTop) { 			// Explorer returns coordinates of viewport
		x = self.screenLeft + (document.documentElement.clientWidth - popupWidth)/2;
		y = self.screenTop + 215;
	} 
	else {  										// Gecko returns coordinates of browser window
		x = self.screenX + (self.outerWidth - popupWidth)/2;
		y = self.screenY + 380;
	}
	
	var url="tpl/template_full_news.php?"+storyNum+"&"+country;
	var pf=window.open(url,"newsItem","width="+popupWidth+",height="+popupHeight+",resizable=1,scrollbars=1,status=1");

	pf.moveTo(x,y);
	pf.focus();
}

//**********************************************************************

/***********************************************************************

	Description: Creates the popup for the video page.

 **********************************************************************/

function drawVideoPopup(){
	var popupWidth = 650;
	var popupHeight = 700;

	var x, y;

	if (self.screenTop) { 			// Explorer returns coordinates of viewport
		x = self.screenLeft + (document.documentElement.clientWidth - popupWidth)/2;
		y = self.screenTop + 215;
	} 
	else {  										// Gecko returns coordinates of browser window
		x = self.screenX + (self.outerWidth - popupWidth)/2;
		y = self.screenY + 380;
	}
	
	var url="video/svsizzle/index.php";
	var pf=window.open(url,"videoItem","width="+popupWidth+",height="+popupHeight+",resizable=1,scrollbars=1,status=1");

	pf.moveTo(x,y);
	pf.focus();
}

