function prefade() {
	$("#content_area").css({ display: "none" });
	$("#flash_intro").css({ display: "block" });
}

function fade() {
	$("#flash_intro").css({ display: "none" });
	$("#content_area").css({ display: "block" });
}

window.onunload = metrics_end;

// Metrics tracking for pathing, dwell time and drop off
//failing in IE, we need to pause execution before end
function metrics_end() {
	if(document.images['metrics']) {
		var endMetrics = new Image();
		endMetrics.src = document.images['metrics'].src.replace(/(page_id=)([^&]*)/, '$1$2&action=end');  ;
	}
	metrics_end_delay(endMetrics);
}
function metrics_end_delay(endMetrics) {
	return endMetrics.src;
}
// Rules Pop-Up
function rules() {
	window.open("index.tbapp?page=rules","rules","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}

// FAQ Pop-Up
function faq() {
  window.open("index.tbapp?page=contact_form","faq","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48");
}

// PRIZE Pop-Up
function prize() {
  window.open("index.tbapp?page=prize","prize","menu=no,toolbar=no,width=526,height=548,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48");
}



//Forgot password
function forgot(session_id) {
  window.opener.location="index.tbapp?page=forgot_form&session_id="+session_id;
  window.close(); 
}	

// Image Security Information Pop-Up
function img_security() {
	window.open("index.tbapp?page=img_security_info","imgsec","menu=no,toolbar=no,width=450,height=340,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=132,left=196");
}

// Generic Pop-Up
// ex: <a href="javascript:openThis('http://www.eprize.com');">Click here</a>
function openThis(URL) {
  window.open(URL);
}

// New Window

function openWindow(link) {
  window.open(link, '_blank', 'width=800,height=600,toolbar=yes,status=yes,location=yes,menubar=yes,directories=yes,resizable=yes,scrollbars=yes');
}




// No Cookies Popups

function cookies_faq() {
	window.open("index.tbapp?page=cookies_faq","cookies_faq","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}

// Move Trailer Popups

/*function move_trailer() {
	window.open("http://www.totaleclips.com/Player/Bounce.aspx?eclipid=e39524&bitrateid=412&vendorid=3&type=.mov","move_trailer","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}
*/

// Capture Pop-Up
/*var strTestLinkIdlet = "AARpfzLIIKvuJvllIIqvfwIvJKIlvL";
function Capture_red() {
  var strTestLinkAdlet = "vnd_eureka_capture_standard";
  window.open("http://cache.vendaria.com/vpop/VpopX.html?purl="+strTestLinkAdlet+"&iid="+strTestLinkIdlet+"&bg=FFFFFF&nm=BZOpener&err=0&title=&pf=t&fr=t","prize","menu=no,toolbar=no,width=560,height=630,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48");
}

function Capture_green() {
  var strTestLinkAdlet = "vnd_eureka_capture_walmart_model";
  window.open("http://cache.vendaria.com/vpop/VpopX.html?purl="+strTestLinkAdlet+"&iid="+strTestLinkIdlet+"&bg=FFFFFF&nm=BZOpener&err=0&title=&pf=t&fr=t","prize","menu=no,toolbar=no,width=560,height=630,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48");
}

function Capture_yellow() {
  var strTestLinkAdlet = "vnd_eureka_capture_plus";
  window.open("http://cache.vendaria.com/vpop/VpopX.html?purl="+strTestLinkAdlet+"&iid="+strTestLinkIdlet+"&bg=FFFFFF&nm=BZOpener&err=0&title=&pf=t&fr=t","prize","menu=no,toolbar=no,width=560,height=630,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48");
}*/

// Capture Pop-Up
function Capture_red() {
	window.open("index.tbapp?page=Capture_red","Capture","menu=no,toolbar=no,width=650,height=640,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=500");
	$("#red").css({ display: "block" });
	$("#all").css({ display: "none" });
	$("#gray").css({ display: "none" });
	$("#yellow").css({ display: "none" });
	$("#green").css({ display: "none" });
	$("#move_trailer_all").css({ display: "none" });
	$("#move_trailer_gray").css({ display: "block" });
}
function Capture_green() {
	window.open("index.tbapp?page=Capture_green","Capture","menu=no,toolbar=no,width=650,height=640,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=500");
	$("#red").css({ display: "none" });
	$("#all").css({ display: "none" });
	$("#gray").css({ display: "none" });
	$("#yellow").css({ display: "none" });
	$("#green").css({ display: "block" });
	$("#move_trailer_all").css({ display: "none" });
	$("#move_trailer_gray").css({ display: "block" });
}
function Capture_yellow() {
	window.open("index.tbapp?page=Capture_yellow","Capture","menu=no,toolbar=no,width=650,height=640,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=500");
	$("#red").css({ display: "none" });
	$("#all").css({ display: "none" });
	$("#gray").css({ display: "none" });
	$("#yellow").css({ display: "block" });
	$("#green").css({ display: "none" });
	$("#move_trailer_all").css({ display: "none" });
	$("#move_trailer_gray").css({ display: "block" });
}

// Move Trailer Popups
function move_trailer() {
	window.open("index.tbapp?page=move_trailer","Capture","menu=no,toolbar=no,width=518,height=400,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
	$("#red").css({ display: "none" });
	$("#all").css({ display: "none" });
	$("#gray").css({ display: "block" });
	$("#yellow").css({ display: "none" });
	$("#green").css({ display: "none" });
	$("#move_trailer_all").css({ display: "block" });
	$("#move_trailer_gray").css({ display: "none" });
}

function exitpop(){
	window.opener.$("#red").css({ display: "none" });
	window.opener.$("#all").css({ display: "block" });
	window.opener.$("#gray").css({ display: "none" });
	window.opener.$("#yellow").css({ display: "none" });
	window.opener.$("#green").css({ display: "none" });
	window.opener.$("#move_trailer_all").css({ display: "block" });
	window.opener.$("#move_trailer_gray").css({ display: "none" });	
}










