﻿function exAddFavorite(sTitle)
{
   var t=document.title;
   var sURL = document.location.href;
   if(document.all)
   {
      window.external.AddFavorite(sURL,sTitle + " - " + t);}
   else
   {
      window.sidebar.addPanel(sTitle, sURL, "");
   }
}

function openwindow(flg)
{
    if(document.getElementById("open"+flg).style.display=="none")
    {
        document.getElementById("open"+flg).style.display="";
    }
    else
    {
        document.getElementById("open"+flg).style.display="none";
    }
}

function checksc()
{
   var Pnum = parseInt(GetSC('GoodsNum')) + parseInt(GetSC('PowerNum'));
   if(Pnum == 0 || isNaN(Pnum))
   {
	   document.write('<div class="marginleft55"><span class="style4"><strong>Your shopping cart is empty</strong></span></div>');
	   document.write('<div class="topshopcart"><span class="style5">&nbsp;</div>');
   }
   else
   {
	   document.write('<div class="marginleft55"><a href="http://www.gamebuynow.com/shoppingcart.html" class="style4"><strong><u><font color="#FF0000">' + Pnum + '</font> product(s) in shopping cart</u></strong></a></div>');
	   document.write('<div class="topshopcart"><span class="style5"><strong>Total: '+GetSC('PaymentPrice').replace('+',' ')+'</strong></span></div>');
   }
}

function GetSC(sName)
{
	var arr = document.cookie.match(new RegExp("(^| )"+sName+"=([^;]*)(;|$)"));
	if(arr !=null){return unescape(arr[2])};
	return null;
}

function fChange(objid,fn)
{
   document.getElementById(objid).src="commonunit/"+fn+".asp?"+Math.random();
}
