// START - Demo Page Stuff
function showanswer(qust_id){
    divObject = document.getElementById(qust_id);
    if(typeof(divObject) != 'undefined') {
        divObject.style.display = (divObject.style.display=="block") ? "none" : "block";
    }
}

theParams = document.location.search;
answerAnchor = null;

if (theParams != '') {
    theStartPoint = theParams.indexOf("anchor=") + 7;
    if (theStartPoint>6) {
        if(theParams.indexOf("&", theStartPoint)>0) {
            answerAnchor = theParams.substr(theStartPoint, theParams.indexOf("&",theStartPoint)-theStartPoint);
        } else {
            answerAnchor = theParams.substr(theStartPoint);
        }
    }
}
// END - Demo Page Stuff


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


var FeaturedGameList = new Array("featuredgame_01.gif", "featuredgame_02.gif","featuredgame_03.gif", "featuredgame_04.gif", "featuredgame_05.gif", "featuredgame_06.gif", "featuredgame_07.gif", "featuredgame_08.gif");

var HpUnlimited = new Array("hp_unlimited_01.gif", "hp_unlimited_02.gif","hp_unlimited_03.gif", "hp_unlimited_04.gif", "hp_unlimited_05.gif");

var HpKids = new Array("hp_kids_01.gif", "hp_kids_03.gif","hp_kids_04.gif", "hp_kids_05.gif", "hp_kids_06.gif", "hp_kids_07.jpg");

var SpUnlimited = new Array("unlimited_main_01.gif", "unlimited_main_02.gif", "unlimited_main_03.gif", "unlimited_main_04.gif", "unlimited_main_05.gif");

var SpUnlimitedKids = new Array("unlimited_sml_01.gif", "unlimited_sml_02.gif", "unlimited_sml_03.gif", "unlimited_sml_04.gif", "unlimited_sml_05.gif", "unlimited_sml_06.gif");

var SpKids = new Array("kids_main_01.gif", "kids_main_02.gif", "kids_main_04.gif", "kids_main_05.gif", "kids_main_06.jpg", "kids_main_07.jpg");

var SpKidsUnlimited = new Array("kids_sml_01.gif", "kids_sml_02.gif", "kids_sml_03.gif", "kids_sml_04.gif", "kids_sml_05.gif");

var now = new Date();
var day = now.getDate();
var bigHand= now.getMinutes();
(bigHand<10)? bigHand="0"+bigHand:bigHand=bigHand;
var ampm=""
var theHour=""
var theTime = now.getHours();
 (theTime>12)? theHour=(theTime-12):theHour=theTime;
 (theTime>12)? ampm="pm":ampm="am";
var dayNames = new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

var monthNames = new
Array("January","February","March","April","May","June","July","August","September","October","November","December");

var theMonth = monthNames[now.getMonth()];
var Today = dayNames[now.getDay()];
var year = now.getYear();
var theYear
 if (year >= 2000) theYear = year;
  else theYear =  (1900 + now.getYear());
var ordinal="th"
 if (day==1 || day==21 || day==31) ordinal="st";
 if (day==2 || day==22) ordinal="nd";
 if (day==3 || day==23) ordinal="rd";
var whichDay = day+ordinal
var todaysDate=Today + ", " +theMonth + " " + whichDay + ", "
+theYear+"<br>";
var todaysTime=theHour+":"+bigHand+ampm+"<br>";

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function displaySwitchButton() {
return "<div><a href=\"http://www.comcast.net/express\" title=\"Switch to the Express View. Requires the Flash 7 plugin.\"><img src=\"/gamesondemand/images/express.gif\" alt=\"Go to Express\" border=\"0\" onclick=\"setSessionCookie('SESSIONHOME', 'forcedexpress', '/', '.comcast.net', false);document.location.href='http://www.comcast.net/express/';return false;\" /></a></div>"}


//Header Bar Display Functions
//***********************************************************************************************************************************************
//***********************************************************************************************************************************************
function displayLoginLogoutButton() {
    if (loggedin) {
		return "<a href=\"http://www.comcast.net/signout.jsp\">Sign Out</a>";
    } else {
		if ((document.location.href.indexOf("home.html") != -1) || (document.location.href.indexOf("comcast.html") != -1)) {
			return"<a href=\"" + domain + "/signin.jsp\">Sign In</a>";
		}
		else {
			return"<a href=\"http://www.comcast.net/signin.jsp?redirectUrl=" + document.location + "\">Sign In</a>";			
		}
    }
}

function displayGreetingYHM() {
    var tmp = "<span>Welcome, Guest!</span>";
    if (loggedin) {
        tmp = getGreeting();
        if (greeting.length >= 1) {
            tmp += ", " + "<a href=\"http://www.comcast.net/providers/greeting/\" title=\"Modify your greeting name\" class=\"greet\" onclick=\"window.open(this.href, 'greeting', 'scrollbars=no,status=no,location=no,toolbar=no,favorites=no,address=no,menubar=no,resizable=yes,width=335,height=205'); return false;\">" + greeting + "</a>!</span>";
        }
    }
    return tmp;
}