var sweepssubpath="tmobile";
var sweepsname="Live's Holiday Snapshot Travel Trivia";
var date18="November 6, 2008";
var datend="December 8, 2008";

//thisMLC=_gmlc+'/contests/'+sweepssubpath;
templatedate=new Date();

styles=[
["fieldset","border:1px solid #516C7D; width:400px;"],
["legend, .butter, .overbutter","font:bold 12px arial;"],
["legend","color:#EE7000;"],
[".error","font:bold 16px arial; color:#EE7000;"],
["body","color:#3963a4;"],
["#MANDY","font-size:11px; padding-top:20px;"],
["#loginbutton, #enterbutton","width:100px;"]
];
document.writeln('<style>');  for (sty in styles){ document.writeln(styles[sty][0]+'{ '+styles[sty][1]+' }'); }  document.writeln('</style>');

rulesURL="http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/"+sweepssubpath+"/rules.html";
thisHeader={ t:sweepsname, s:"" , w:470, h:70 };
returntohomepage='<a href="http://liveregisandkelly.com/">Return to the <b>"Live with Regis and Kelly"</b> homepage</a><br><br><br><br><br>';

function goRules(){ window.location.href=rulesURL; }

function writeTravelTriviaTop(){
}


entryCopy='Complete the online entry form and upload your photo\
	<div id="spacer5"><!-- --></div>\
	for a chance to play Live\'s Holiday Snapshot Travel\
	<div id="spacer5"><!-- --></div>\
	Trivia! If you name is randomly selected, you may be\
	<div id="spacer5"><!-- --></div>\
	called to answer a trivia question for a chance to win a\
	<div id="spacer5"><!-- --></div>\
	prize valued up to $50,000! Remember, you must be\
	<div id="spacer5"><!-- --></div>\
	18 years of age or older as of the date of entry to enter.\
	<div id="spacer5"><!-- --></div>\
	Only one online entry per user per day. All online\
	<div id="spacer5"><!-- --></div>\
	entries must be received by 11:59 p.m. Pacific Time\
	<div id="spacer5"><!-- --></div>\
	("PT") on December 8,2008.';

successCopy='<div id="spacer50"><!-- --></div>\
	<b>Thanks for entering\
	<div id="spacer20"><!-- --></div>Live\'s Holiday Snapshot Travel Trivia Sweepstakes!<div id="spacer20"><!-- --></div>\
You can enter once a day through '+ datend +'!\
<div id="spacer50"><!-- --></div>\
'+returntohomepage;

mandatory='<b>NO PURCHASE OR PHOTO NECESSARY.</b> Void in Quebec and where prohibited. Open to permanent legal residents \
	of the fifty states of the U.S., D.C. and Canada (excluding Quebec), who are 18 years of age or older as of the date \
	of entry. Entries start on 11/6/08. Internet and mail photo entries must be received by 12/8/08 and alternate mail \
	entries must be received by 12/11/08. <a href="http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/tmobile/LivesOnAirPhotoRelease.pdf" \
	target="_blank" style="color:#316AC5;"><u>On Air Photo Releases</u></a> are required from every person appearing \
	in a snapshot for Internet and mail photo entrants if selected for the Trivia Game. For details/Official Rules \
	<a href="http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/tmobile/rules.html" style="color:#316AC5;"><u>click here</u></a>. Prize restrictions apply.';
	
	
	 

	
	

loginbutton='<input type="submit" value="LOG-IN >>" class="butter" id="loginbutton" onmouseover="this.className=\'overbutter\'" onmouseout="this.className=\'butter\'">';
enterbutton='<input type="submit" value="NEXT >>" class="butter" id="enterbutton" onmouseover="this.className=\'overbutter\'" onmouseout="this.className=\'butter\'">';

function writeText(_text){
switch(_text){
case 'LOGGED_IN': break;
case 'NOT_LOGGED_IN':
document.writeln('<div class="darkBlue" align="left" id="ABOVEENTERFORM">\
	You need to be a registered member of <b>Live with Regis and Kelly</b> before entering this sweepstakes.\
	</div>');
break;
case 'REQUIRED_FIELDS':
document.writeln('Phone numbers submitted for <b>Live\'s Holiday Snapshot Trivia</b> will be used exclusively for contacting <b>Live\'s Holiday Sanpshot Travel Trivia</b> contestants. The phone numbers will NOT be shared or used for any purpose beyond the "Live with Regis and Kelly" <b>Holiday Snapshot Travel Trivia Sweepstakes</b>.');
break;
case 'SUCCESS':
document.writeln(successCopy);
break;
case 'FAMILY_OF_SITES':
document.writeln('<div class="darkBlue" align="left" style="font:10px arial;">\
	(** <b>Note:</b> If you are already registered at LiveRegisandKelly.com, ABC.com, ABCNEWS.com, ESPN.com, FamilyFun.com, Movies.com, \
	or Disney Online, you may use your existing Member ID and Password. You do NOT have to re-register... just login with your member \
	ID and password.)</div>');
break;
case 'CLICK_HERE_TO_REGISTER':
document.writeln('<b>Not yet registered? <a href="../../index?appRedirect=sweeps/'+sweepssubpath+'/index">CLICK HERE</a></b>');
default:break;
}
}


function writeErrorMsg(irma){
document.writeln('<div align="center">');
switch(irma){
case 'ALREADY_ENTERED_IN_TIMEUNIT':
document.writeln('<div id="spacer50"><!-- --></div><span class="errorRed">Sorry but you\'ve already entered today.</span><div id="spacer25"><!-- --></div><span style="font-size:12px">You can enter <b>Live\'s Holiday Snapshot Travel Trivia Sweepstakes</b> <br>once per day through 11:59 PM Pacific Time on '+datend+'.<br><br></span>'); break;
case 'EARLY':
document.writeln('<div id="spacer50"><!-- --></div><span class="errorRed">SORRY!</span><div id="spacer25"><!-- --></div><b>'+sweepsname+'</b> has not yet started.<br>  Please return <b>'+date18+'</b> to enter for your chance to win.'); break;
case 'OVER':
document.writeln('<div id="spacer50"><!-- --></div><span class="errorRed">SORRY!</span><div id="spacer25"><!-- --></div>Online entry in <b>'+sweepsname+'</b> is now closed.'); break;
case 'INVALID_AGE':
document.writeln('<div id="spacer50"><!-- --></div><span class="errorRed">SORRY!</span><div id="spacer25"><!-- --></div>You must be at least 18 years of age to enter <b>'+sweepsname+'</b>.'); break;
case 'QUEBEC':
document.writeln('<div id="spacer50"><!-- --></div><span class="errorRed">SORRY!</span><div id="spacer25"><!-- --></div><b>LIVE\'s '+sweepsname+'</b> is not open to residents of Quebec.<br><br><a href="../../update?appRedirect=sweeps/'+sweepssubpath+'/entry">Verify/Update address information</a>'); break;
default:break;
}
document.writeln('<div id="spacer50"><!-- --></div>'+returntohomepage+'</div>');
}


function checkStuff(me) {
eee=[
["line1", "Please confirm your address."],
["city", "Please confirm your city."],
["stateProvince", "Please confirm your state."],
["postalCode", "Please confirm your zip code."],
["phonenumber", "Please type in your phone number."],
["militaryname", "Please type in the entrant's name."],
["relation", "Please type in your relationship with entrant"]
];
for (cc=0; cc<eee.length; cc++){
elle = me.elements[eee[cc][0]];
if (((elle.type=="text" || elle.type=="textarea" || elle.type=="file") && elle.value=='') || (elle.type=="select-one" && elle.selectedIndex==0)){
	alert(eee[cc][1]); elle.focus(); return false;
}
}

stripped=me.value.value.replace(/[\(\)\.\-\ ]/g,'');
if (!(!isNaN(parseInt(stripped)) && stripped.length==10)){ alert('Please check your phone numbers for errors. Suggested format: XXX-XXX-XXXX'); me.value.focus(); return false; }

return true;
}

function writeTopAd(){
document.writeln('<IFRAME SRC="https://3ps.go.com/DynamicAd?srvc=bvtv&itype=Banner&url=*/holidaytrivia/*&secure=true" border="0" width="728"height="90" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0"MARGINWIDTH="0"></IFRAME>');
}
function writePosterAd(){
document.writeln('<IFRAME SRC="https://3ps.go.com/DynamicAd?srvc=bvtv&itype=Skyscraper&url=*/holidaytrivia/*&secure=true" border="0" width="160"height="616" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0"MARGINWIDTH="0"></IFRAME><br><br>');
}


/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires
     a secure transmission
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}



