
function popScreenshot(gCode,imgName, imgWidth, imgHeight)
{   
    imgHeight = imgHeight + 81;
    window.open("/screenshot.aspx?code=" + gCode + "&src="+imgName, "screenshot", "toolbar=no, status=no, resize, width=" + imgWidth + ", height=" + imgHeight + " ")
    return
}

function popOnlineExt(gameUrl, gameCode, origin, width, height) {    
        window.open(gameUrl + "?code=" + gameCode + "&origin=" + origin, "online", "width=" + width + ", height=" + height);
        return;
}

function omnitureLogDownload(gameCode, omnitureChannel,gameName,catName,dlDateTime) {
try{
	GameCatalog.WebAnalysis.SiteTracking.omnitureLogDownload_Real(gameCode, omnitureChannel,gameName,catName,dlDateTime);
	}
	catch(e){}
}


function OnlinePageRedirect(gameUrl,gameCode,origin)
{
	window.location.href = gameUrl + "?code=" + gameCode + "&origin=" + origin;
}


function PogoOnlinePageRedirect(gameUrl)
{
	
	StripQuerystring(ReadCookie());
	var tmpSite = GetParamValue("site");
	var tmpLkey = GetParamValue("lkey");
	StripQuerystring(window.location.href);
	var tmpTop = escape(PageFullPath() + "?" + GetQueryString(true));
	window.location.href = HostDomain + "/oberon/rooms.jsp?game=" + gameUrl + "&site=" + tmpSite +  "&lkey=" + tmpLkey + "&top=" + tmpTop;
}
 



function popPlayOnline(gCode, gWidth, gHeight){
	if (window != top)
		top.popPlayOnline(gCode, gWidth, gHeight);

	var oWidth, oHeight, oWindow
	oWidth = parseInt(gWidth) +80
	oHeight = parseInt(gHeight) - 250
	oWindow=window.open("/PlayOnline.aspx?code="+gCode,'null',"width=" + oWidth + ",Height=" + oHeight + ",status=no,toolbar=no,menubar=no,location=no,resizeable=yes")
	oWindow.focus()
}

function popPlayOnline2(gameUrl, gCode, gWidth, gHeight){
	if (window != top)
		top.popPlayOnline2(gameUrl, gCode, gWidth, gHeight)
		
	var oWidth, oHeight, oWindow
	oWidth = parseInt(gWidth) +80
	oHeight = parseInt(gHeight) - 250
	oWindow=window.open(gameUrl + "?code=" + gCode,'null',"width=" + oWidth + ",Height=" + oHeight + ",status=no,toolbar=no,menubar=no,location=no,resizeable=yes")
	oWindow.focus()
}
/*
function sendOpenerToUrl(url){
	opener.location=url;
	opener.focus();
}*/

function sendOpenerToUrl(url)
{
	var isOpenerClosed;
	try
	{
		isOpenerClosed = ( null == window.opener || window.opener.closed );
	}
	catch (ex)
	{
		isOpenerClosed = true;
	}
	
	if( isOpenerClosed )
	{
		var iWidth = screen.availWidth - 10;
        var iHeight = screen.availHeight - 150;
        window.open(url,'_blank',"width=" + iWidth + ",Height=" + iHeight + ",top=0,left=0,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,maximize=yes");
    }
    else
    {
		opener.top.location=url;
        opener.focus();
    }
}

function resizeContentIFrame(srcEvent, newHeight)
{
	 try
	 {
		 if (newHeight == null)
			 newHeight = document.frames("ContentIFrame").document.body.scrollHeight + 20;
			 document.getElementById("ContentIFrameTable").height = newHeight;
	 }
	 catch(e) { }
}

function runApp(sku)
{
	objActiveX = document.getElementById('objActiveX');
    if(ODCinstalled==1) {
        objActiveX.launchGame(sku);
        self.location.reload()
    }
    return
}

function AlignHomePageCats(){
	var total=0
	row1 = new Array('CatTable_0','CatTable_1','CatTable_2')
	row2 = new Array('CatTable_3','CatTable_4','CatTable_5')
	row3 = new Array('CatTable_6','CatTable_7','CatTable_8')
	row  = new Array(row1,row2,row3)
	tempArr=null
	
	j=0
	do{
		i=0
		tempArr = new Array()
		do{
			divID=eval(row[j][i]+"LST.offsetHeight")
			tempArr[tempArr.length]=divID
			i++
		}while (i<3)
		
		rowMax=Math.max(tempArr[0],tempArr[1],tempArr[2])
		total = total + rowMax
		i=0
		do{
			gap=rowMax-tempArr[i]
			var oid = eval(row[j][i]+"Gap")
			oid.style.height=17+gap
			i++	
		}while (i<3)
		j++
	}while(j<3)
	
	//optional to align also the HOT GAMES column
	hotLST.style.height=total+190
}


	
		

