﻿var isQA;
var IWEProtocol;
function fLaunchInstant(){	
    isQA = document.location.href.toUpperCase().indexOf('QA')
    if (isQA != -1)
	{
	var QAflag = 1;
	IWEProtocol = "https" // don't use ":" here
	}
	else
	{
	var QAflag = 0;
	IWEProtocol = "https" // don't use ":" here
	}

    
    var flashvars = {	
	    businessUnitID:"1",
	    deviceID: "1",
	    DEBUG: "false", // set to "true" to see full XML response from engine
	    QA:QAflag,
	    protocol: IWEProtocol,
	    email:GetEmailFromCookie()
    };


	var params = {
	  swliveconnect : "true",
	  allowscriptaccess : "always",
	  wmode: "transparent",
	  menu:"false"
	};
	
	var attributes = {
		id: "flashGame",
		name: "flashGame"
	};	
	
	swfobject.embedSWF(  mediaBasePath + "Microsites/PCHLotto/InstantWin/instantwin_scratchcard.swf", "flashGame", "700", "600", "9.0.0", null, flashvars, params, attributes);
	//flb_Show("#lbGame")
	return true;
}

function fWinContinue(claimFormURL){
	document.location.href = claimFormURL;
}
function fLoseContinue(){
	document.location.href = "GameDec.aspx";
}

function fShowRules(rulesURL){
    // flash will decide which environment url has to be launched...
  	//"http://qa.claim.pch.com/claim/rule.htm?deviceId=1"
    //"http://claim.pch.com/claim/rule.htm?deviceId=1"
	popScroll(rulesURL, 400, 400);
}


function fShowFacts(){
	popScroll("Facts.aspx", 400, 400);
}
function popScroll(url,w,h){
	popwin=window.open(url,"win","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=no,width="+w+",height="+h+"");
	popwin.window.focus();
}