﻿var isQA;
var IWEProtocol;
var DEBUGflag;
function fLaunchInstant_PowerScratch(){	
    if (typeof lottoIstantWinEnvironment != "undefined" && (lottoIstantWinEnvironment == 'QA'))
	{
	var QAflag = 1;
	IWEProtocol = "https" // don't use ":" here
	DEBUGflag = "false";
	}
    else 
	{
	var QAflag = 0;
	IWEProtocol = "https" // don't use ":" here
	DEBUGflag = "false";
	}
    
    var flashvars = {	
	    businessUnitID:"1",
	    deviceID: "1",
	    DEBUG: DEBUGflag, // 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 + "Packages/75/assets/instantwin_scratchcard.swf", "flashGame", "700", "600", "9.0.0", null, flashvars, params, attributes);
	//flb_Show("#lbGame")
	return true;
}
//Load Black Card $25000K
function fLaunchInstant(){	
    if (typeof lottoIstantWinEnvironment != "undefined" && (lottoIstantWinEnvironment == 'QA'))
	{
	var QAflag = 1;
	IWEProtocol = "https" // don't use ":" here
	DEBUGflag = "true";
	}
    else 
	{
	var QAflag = 0;
	IWEProtocol = "https" // don't use ":" here
	DEBUGflag = "false";
	}
    
    var flashvars = {	
	    businessUnitID:"1",
	    deviceID: "7",
	    DEBUG: DEBUGflag, // set to "true" to see full XML response from engine
	    QA:QAflag,
	    protocol: IWEProtocol,
	    accessKey:"O882ZC2WXIIx4g6kjBoZlv6YcSN95CVN",
	    email:GetEmailFromCookie()
    };


	var params = {
	  swliveconnect : "true",
	  allowscriptaccess : "always",
	  wmode: "transparent",
	  menu:"false"
	};
	
	var attributes = {
		id: "flashGame",
		name: "flashGame"
	};	
	
	swfobject.embedSWF(  mediaBasePath + "Packages/75/assets/instantwin_blackcard.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();
}