var sweepssubpath="watchtowin";
var sweepsname="Live\'s Drive Into HD Watch and Win Sweepstakes";
var date18="January 2, 2009";
var datend="January 14, 2009";

//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/special/"+sweepssubpath+"/rules.html";
imageRoot="http://bventertainment.go.com/tv/buenavista/regisandkelly/special/"+sweepssubpath+"/images";
thisHeader={ t:sweepsname, s:"" , w:550, h:50 };
returntohomepage='<a href="http://liveregisandkelly.com/">Return to the <b>"Live with Regis and Kelly"</b> homepage</a>';

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

function writeTravelTriviaTop(){
}

modifiedHeader='<div style="position:relative; width:500px; height:170px; text-align:center; line-height:0;"><div style="top:0; left:0; background:url('+imageRoot+'/Watchtowin224x170.jpg) center no-repeat; width:224px; height:170px; position:absolute;"></div><div style="top:0; left:225px; background:url('+imageRoot+'/SubaruWatchtoWin200x170.jpg) center no-repeat; width:200px; height:170px; position:absolute;"></div></div><div style="height:15px; line-height:0;"><!-- --></div><div class="darkBlue" style="text-align:left; line-height:0; font:bold 13pt Arial;">'+sweepsname+'</div><div style="height:10px; line-height:0;"><!-- --></div>';
entryCopy='Complete the following online entry form for a chance to win <b>'+sweepsname+'! </b>If you submit seven correct clues and your name is randomly selected, you may win a 2009 Subaru Forester! Remember, to enter you must be at least 18 years of age or older as of January 2, 2009.\
<br/><a href="javascript:goRules()">Click here for the official rules.</a>';
entryCopyLogged='Complete the following online entry form for a chance to win <b>'+sweepsname+'! </b>If your name is randomly selected, and you have submitted at least 7 out of 10 clues correctly, you may win a 2009 Subaru Forester! Remember, to enter you must be at least 18 years of age or older as of January 2, 2008.\
<br/><a href="javascript:goRules()">Click here for the official rules.</a>';

successCopy='<center><div id="spacer10"><!-- --></div><div style="background:url('+imageRoot+'/Watchtowin224x170.jpg) center no-repeat; width:224px; height:170px; position:relative;"></div>\
	<div id="spacer20"><!-- --></div>\
	<b>Thanks for entering<br/>\
	<span class="darkBlue">'+ sweepsname +'!</span></b><div id="spacer20"><!-- --></div>\
You can enter once a day through '+ datend +'!<br/>\
'+returntohomepage+'<div id="spacer20"><!-- --></div>\
<div style="background:url('+imageRoot+'/SubaruWatchtoWin200x170.jpg) center no-repeat; width:200px; height:170px; position:relative;"></div>\
<br/><span style="font:bold 10pt Arial; color:#000000;">Visit <b><a href="http://www.subaru.com" target="_blank">www.subaru.com</a></b> for more information</span>\
</center>';

mandatory='<b>NO PURCHASE NECESSARY.</b> Void where prohibited. Open to permanent legal U.S. residents of the fifty states and D.C., who are 18 years of age or older as of 1/2/09. Entries must be received by 11:59 p.m. (PT) on 1/14/09. For details/Official Rules \
	<a href="javascript:goRules()" 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="SUBMIT>>" class="butter" id="enterbutton" onmouseover="this.className=\'overbutter\'" onmouseout="this.className=\'butter\'">\
	<span style="font-size:9pt;"><br/><br/>\	PLEASE MAIL YOUR ENTRY IN IF YOU CONTINUE TO HAVE TECHNICAL ISSUES:<br/>\Send a postcard with your name, complete address, daytime telephone number, date of birth and at least seven of the ten correct clues to: <br/><br/>\
	Drive Into HD Watch And Win<br/>P.O. Box 10831<br/>Burbank, CA 91510</span>';

function writeText(_text){
switch(_text){
case 'LOGGED_IN':
	document.writeln(modifiedHeader);
	document.writeln('<div class="darkBlue" align="justify" id="ABOVEENTERFORM">\
		'+entryCopyLogged+'</div>');
	break;
case 'NOT_LOGGED_IN':
document.writeln(modifiedHeader);
document.writeln('<div class="darkBlue" align="justify" id="ABOVEENTERFORM">'+entryCopy+'\
	<div style="line-height:20px; height:20px;"></div>\
	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 Drive Into HD Watch and Win</b> will be used exclusively for contacting <b>Live\'s Drive Into HD Watch and Win</b> contestants. The phone numbers will NOT be shared or used for any purpose beyond the "Live with Regis and Kelly" <b>Drive Into HD Watch and Win 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="errorHue">Sorry but you\'ve already entered today.</span><div id="spacer25"><!-- --></div><span style="font-size:12px">You can enter <b>'+sweepsname+'!</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="errorHue">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="errorHue">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="errorHue">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="errorHue">SORRY!</span><div id="spacer25"><!-- --></div><b>'+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."]
];
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;
}
}

clueCtr = 0;
for (cc=1; cc<11; cc++){
elle = me.elements['clue'+cc];
	if(elle.value != '') { clueCtr++; }
}
cluesNeeded = 7 - clueCtr;
switch( cluesNeeded ){
	case 7:	alert('You need at least seven (' + cluesNeeded +') clues!');
			return false;
			break;
	case -3: break;
	case -2: break;
	case -1: break;
	case 0:	break;
	default:	alert('You need ' + cluesNeeded +' more clue(s)!');
				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=/regisandkelly/sweeps/watchtowin/?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=/regisandkelly/sweeps/watchtowin/?secure=true" border="0" width="160"height="600" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0"MARGINWIDTH="0"></IFRAME><br/><br/>');
}