	document.writeln('<scr'+'ipt language="javascript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></scr'+'ipt>');
	
	strTemplatePath = 'vote/guestcohostsearch/index'
	strRedirectURL = 'http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/guestcohostsearch/vote.html'
	
	strRulesURL = 'http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/guestcohostsearch/rules.html';
	strGuidelinesURL = 'http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/guestcohostsearch/guidelines.html';
	
	thisHeader = { t:"From Local to LIVE Co-host for a Day Search", s:"",w:530,h:35 };
  
	isVotingActive = true; // Change value to "false" to redirect

	/* If "isVotingEvent" is equal to "false," redirect user to "strRedirectURL" value */
	if (!isVotingActive) {
		location.replace(strRedirectURL)
	}
	
	var listMaleCandidates = [
		{ id:'1entry01', name:'Louis Aguirre', station:'WSVN', citystate:'Miami, FL', bctid:'30468802001' },
		{ id:'1entry02', name:'Charley Belcher', station:'WTVT', citystate:'Tampa, FL', bctid:'30465997001' },
		{ id:'1entry03', name:'Tom Brown', station:'CTV', citystate:'Ontario, Canada', bctid:'30465798001' },
		{ id:'1entry04', name:'Shaun Broyls', station:'KCTV ', citystate:'Kansas City, MO', bctid:'30466595001' },
		{ id:'1entry05', name:'Jason Colthorp', station:'WILX', citystate:'Lansing, MI', bctid:'30466593001' },
		{ id:'1entry06', name:'Pete Kenworthy', station:'WEWS ', citystate:'Cleveland, OH', bctid:'30468803001' },
		{ id:'1entry07', name:'Chris Parente', station:'KWGN', citystate:'Denver, CO', bctid:'30363455001' },
		{ id:'1entry08', name:'Larry Potash', station:'WGN', citystate:'Chicago, IL', bctid:'30465797001' },
		{ id:'1entry09', name:'Pat Tomasulo', station:'WGN', citystate:'Chicago, IL', bctid:'30465800001' },
		{ id:'1entry10', name:'Jeff Varner', station:'WWMT', citystate:'Kalamazoo, MI', bctid:'30465999001' }
	];
	
	var listFemaleCandidates = [
		{ id:'2entry01', name:'Wendy Bell', station:'WTAE', citystate:'Pittsburgh, PA', bctid:'30465829001' },
		{ id:'2entry02', name:'Lucy Bustamante', station:'WWL', citystate:'New Orleans, LA', bctid:'30465831001' },
		{ id:'2entry03', name:'Kimberly Gill', station:'WEWS', citystate:'Cleveland, OH', bctid:'30468829001' },
		{ id:'2entry04', name:'Fiona Gorostiza', station:'KDFW ', citystate:'Dallas, TX', bctid:'30466035001' },
		{ id:'2entry05', name:'Tram Mai', station:'KPNX', citystate:'Phoenix, AZ', bctid:'30466624001' },
		{ id:'2entry06', name:'Lynn Martinez', station:'WSVN', citystate:'Miami, FL', bctid:'30468830001' },
		{ id:'2entry07', name:'Tisha Powell', station:'WTVD', citystate:'Raleigh.-Durham, NC', bctid:'30466623001' },
		{ id:'2entry08', name:'Sandra Shaw', station:'WBAL', citystate:'Baltimore, MD', bctid:'30466036001' },
		{ id:'2entry09', name:'Tamara Taggart', station:'CTV', citystate:'Ontario, Canada', bctid:'30465830001' },
		{ id:'2entry10', name:'Janelle Wang', station:'KGO', citystate:'KGO ', bctid:'30468828001' },
	];

	/* Page Copies  */
	strIntrocopy = '<div align="left" style="width: 910px; font: 12px Arial,sans-serif"></div>'
							
	strLowercopy = '<div align="left" style="width: 910px; font: 12px Arial,sans-serif"></div>'
									
	strSuccesscopy = 'http://bventertainment.go.com/tv/buenavista/regisandkelly/contests/guestcohostsearch/thanks.html'
	
	strDisclaimercopy =
		'<div style="position: relative; border-top: dotted #6C6C6C 0.1em; margin-top: 10px"><!----></div>'+
		'<div align="left" style="position: relative; color: #646464; font: 8pt arial; line-height: 12pt; padding-top: 10px;">'+
		  'NO PURCHASE NECESSARY. 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. '+
		  '<a href=\"'+strRulesURL+'\" style="color: #d7150b;">Click here</a> '+
		  'for the Official Rules'+
		'</div>.'
	
	renderHeader = function() {
		writeHeader(thisHeader);
	}
  
	renderForm = function() {
		document.writeln(
			'<form id="voteform" name="voteform" action="index" method="post" onsubmit="return okayToSubmit(this.id)">\
				<div id="divMaleCandidates">\
					<p>Watch all ten videos and select the five broadcasters you would like to see co-host with Kelly, then click "Next"</p>\
					<table cellpadding="0" cellspacing="0" border="0">\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[0].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[0].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[0].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[1].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[1].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[1].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[2].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[2].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[2].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[3].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[3].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[3].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[4].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[4].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[4].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[5].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[5].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[5].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[6].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[6].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[6].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[7].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[7].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[7].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[8].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[8].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[8].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listMaleCandidates[9].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listMaleCandidates[9].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listMaleCandidates[9].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
					</table>\
					<br>\
					<input type="button" name="next" style="width:130px;font:bold 12px Arial,sans-serif" value="NEXT >" onclick="okayToGoNext(\'voteform\')"></input>\
				</div>\
				<div id="divFemaleCandidates" style="display:none;">\
					<p>Watch all ten videos and select the five broadcasters you would like to see co-host with Regis, then click "Submit"</p>\
					<table cellpadding="0" cellspacing="0" border="0">\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[0].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[0].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[0].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[1].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[1].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[1].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[2].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[2].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[2].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[3].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[3].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[3].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[4].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[4].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[4].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[5].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[5].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[5].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[6].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[6].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[6].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[7].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[7].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[7].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
						<tr>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[8].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[8].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[8].name+'</strong></li></ul>\
								</div>\
							</td>\
							<td width="20">&nbsp;</td>\
							<td>\
								<script language="javascript" type="text/javascript">renderBCPlayer(\''+listFemaleCandidates[9].bctid+'\')</script><br/>\
								<div>\
									<input type="checkbox" name="'+listFemaleCandidates[9].id+'" value="Y" style="float:left;"></input>\
									<ul style="list-style:none;margin-top:0px;padding-left:25px;*margin-left:0px;"><li><strong>'+listFemaleCandidates[9].name+'</strong></li></ul>\
								</div>\
							</td>\
						</tr>\
					</table>\
					<br>\
					<input type="submit" name="SUBMIT" style="width:130px;font:bold 12px Arial,sans-serif" value="SUBMIT"></input>\
				</div>\
			</form>'
		)
	}
	
	
	renderBCPlayer = function(bctid){
		document.writeln(
			'<object id="bc'+bctid+'" class="BrightcoveExperience">'+
				'<param name="wmode" value="transparent" /><param name="bgcolor" value="#FFFFFF" /><param name="width" value="270" /><param name="height" value="204" />'+
				'<param name="playerID" value="30292902001" /><param name="publisherID" value="296474766"/><param name="isVid" value="true" /><param name="cacheAMFURL" value="http://services.brightcove.com/services/messagebroker/amf"/>'+
				'<param name="@videoPlayer" value="'+bctid+'"/>'+
			'</object>'
		);
	}
									
	/* Error Messages */
	strInactivecopy =
		'<div align="center" style="width: 910px; font: 12px Arial,sans-serif; padding-bottom: 70px;">\
		  <br/><br/><br/>\
		  <span style="font-size: 18px; font-weight: bold">The voting event has not yet started! Check back soon!</span><br>\
		  Tune in Wednesday to see who wins!\
		  <br/><br/>\
		  <img src="https://bventertainment.go.com/tv/buenavista/regisandkelly/contests/celebritylookalike09/images/rk/RandKvotelanding.jpg"></img><br/><br/>\
		  <br/><br/>\
		  <a style="color: #f78610;" href="http://liveregisandkelly.com/">Back to "Live with Regis and Kelly" homepage</a>\
		</div>'
										
		strInvalidagecopy =
		'<div align="center" style="width: 910px; font: 12px Arial,sans-serif; padding-bottom: 70px;">\
		  <br/><br/><br/>\
		  <span style="font-size: 18px; font-weight: bold">Sorry! You must at least be 18 years of age to vote.</span><br>\
		  Tune in Monday to see who wins!\
		  <br/><br/>\
		  <img src="https://bventertainment.go.com/tv/buenavista/regisandkelly/contests/celebritylookalike09/images/rk/RandKvotelanding.jpg"></img><br/><br/>\
		  <br/><br/>\
		  <a style="color: #f78610;" href="http://liveregisandkelly.com/">Back to "Live with Regis and Kelly" homepage</a>\
		</div>'
											
	strInvalidregioncopy =
		'<div align="center" style="width: 910px; font: 12px Arial,sans-serif; padding-bottom: 70px;">\
		  <br/><br/><br/>\
		  <span style="font-size: 18px; font-weight: bold">Sorry! Voting event is not open to residents of Quebec.</span><br>\
		  Tune in Monday to see who wins!\
		  <br/><br/>\
		  <a href="../../update?appRedirect='+strTemplatePath+'" style="text-decoration: underline">Click here to verify/update address information</a>\
		  <br/><br/>\
		  <img src="https://bventertainment.go.com/tv/buenavista/regisandkelly/contests/celebritylookalike09/images/rk/RandKvotelanding.jpg"></img><br/><br/>\
		  <br/><br/>\
		  <a style="color: #f78610;" href="http://liveregisandkelly.com/">Back to "Live with Regis and Kelly" homepage</a>\
		</div>'
													
	strAlreadytakencopy =
		'<div align="center" style="width: 910px; font: 12px Arial,sans-serif; padding-bottom: 70px;">\
		  <br/><br/><br/>\
		  <span style="font-size: 18px; font-weight: bold">Sorry! You\'ve already voted. You can only vote once per day.</span><br>\
		  Tune in Wednesday to see who wins!\
		  <br/><br/>\
		  <img src="https://bventertainment.go.com/tv/buenavista/regisandkelly/contests/celebritylookalike09/images/rk/RandKvotelanding.jpg"></img><br/><br/>\
		  <br/><br/>\
		  <a style="color: #f78610;" href="http://liveregisandkelly.com/">Back to "Live with Regis and Kelly" homepage</a>\
		</div>'
							
	/* Ads */
	adLeaderboard = '<IFRAME SRC="https://3ps.go.com/DynamicAd?srvc=bvtv&itype=Banner&url=*/guestcohostsearch/voting/*&secure=true" border="0" width="728"height="90" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0"MARGINWIDTH="0"></IFRAME>';
	
		
	function renderPage(strPageType){
		switch(strPageType){
			case 'FORM': // Display Intro copy					
					document.writeln(strIntrocopy)
					renderForm()
					document.writeln(strLowercopy)
					break
			case 'SUCCESS':	// Display Success copy
					//document.writeln(strSuccesscopy)
					location.replace(strSuccesscopy) // (OPTIONAL) Use "successcopy" to hold redirection URL
					break
			default: break
		}
	}
	
	function renderErrorMessage(strErrorType){
		switch(strErrorType){
			case 'INACTIVE': // Display Inactive message			
					document.writeln(strInactivecopy)
					break
			case 'INVALIDAGE':	// Display Invalid Age message
					document.writeln(strInvalidagecopy)
					break
			case 'INVALIDREGION': // Display Invalid Region message
					document.writeln(strInvalidregioncopy)
					break
			case 'ALREADYTAKEN':	// Display Already Taken message
					document.writeln(strAlreadytakencopy)
					break
			default: break
		}
	}
	
	function okayToGoNext(strFormId){
		pass = false
		ctr = 0
		try{
			for (i=0;i<gid(strFormId).length;i++) {
				if(gid(strFormId)[i].checked){
					ctr++
				}
			}
			if(ctr==5){
				pass = true
			}
		} catch(e) {}
		if(pass){
			gid("divMaleCandidates").style.display = "none"
			gid("divFemaleCandidates").style.display = "block"
		}
		else{
			if(ctr>5)
				alert('You can only select five(5) Male Co-Hosts!')
			else
				alert('Please select five(5) Male Co-Hosts!')
		}
		return pass
	}
  
  function okayToSubmit(strFormId){
		pass = false
		ctr = 0
		try{
			for (i=0;i<gid(strFormId).length;i++) {
				if(gid(strFormId)[i].checked){
					ctr++
				}
			}
			if(ctr==10){
				pass = true
			}
		} catch(e) {}
		if(!pass){
			if(ctr>10)
				alert('You can only select five(5) Female Co-Hosts!')
			else
				alert('Please select five(5) Female Co-Hosts!')
		}
		return pass
	}
	
	