﻿// JScript File

if (typeof UseSSL == "undefined")
{
	if(location.protocol == "https:") 
	{
		UseSSL = true;
	}
	
	else
	{
		UseSSL = false;
	}
}

var WebSiteURL = (UseSSL) ? "https://vsp-online.com/vsp/" : "http://vsp-online.com/vsp/";
var JSURL = (UseSSL) ? "https://vsp-online.com/" : "http://vsp-online.com/";

//var WebSiteURL = "http://localhost:50242/VSP_Web/";
//var JSURL = "";


if (typeof SwitchedOn == "undefined")
{
    SwitchedOn = true;
}

function IncludeJavaScript(jsFile,use_defer)
{
  if(use_defer)
  {
      document.write('<script defer type="text/javascript" src="'
        + jsFile + '"></scr' + 'ipt>'); 
  }
  
  else
  {
      document.write('<script type="text/javascript" src="'
        + jsFile + '"></scr' + 'ipt>'); 
  }
}

// SwitchedOn = false;

////////////// Exceptions //////////////

if(typeof Language != "undefined")
{
	if(Language == "en")
	{
		Language = "";
	}
}


if(User == "iforexlead")
{
	//WebSiteURL = (UseSSL) ? "https://vsp.iforex.com/vsp/" : "http://vsp.iforex.com/vsp/";
	//JSURL = (UseSSL) ? "https://vsp.iforex.com/" : "http://vsp.iforex.com/";
}

else if(User == "etorouninstall")
{
    SwitchedOn = false;
}

else if(User == "etoro")
{
	Width = 435;
	Height = 508;
    PopUpWindowBorderColor = 'White';
    //NumberOfAllowedTriggers = 2;
	//TriggerDelay = 1;
	LanguageFlow = true;
	UsePromo = false;

    if(window.location.href.indexOf("registration/take-advantage.aspx") != -1)
    {
	   //MaxCyclesToTriggerPopUp = 300;
    }
	
    if(window.location.href.indexOf("it-it") != -1)
	{
		Language = "it";
	}
	
	else if(window.location.href.indexOf("fr-fr") != -1 ||  window.location.href.indexOf("de-de") != -1 || window.location.href.indexOf("ar-ae") != -1 || window.location.href.indexOf("ru-ru") != -1 || window.location.href.indexOf("es-es") != -1 || window.location.href.indexOf("ja-jp") != -1 || window.location.href.indexOf("pt-br") != -1 || window.location.href.indexOf("zh-cn") != -1 || window.location.href.indexOf("tr-tr") != -1 || window.location.href.indexOf("etoro.com.au/tv") != -1)
	{
		SwitchedOn = false;
	}
	
	PromoLink = "http://www.etoro.com/setup.aspx?dl=80888";
}

else if(User == "etorodemo")
{
	Width = 435;
	Height = 508;
	PromoLink = "http://vsp-online.com/vsp/patterns/custom/etorodemo/Instructions.php?pcode=Sophia";
}

else if(User == "dishnetwork")
{
    PopUpWindowBorderColor = 'White';
}

else if(User == "tropez" || User == "gptropez")
{
    ActivationMethod = 1;
}

else if(window.location.href.indexOf("europacasino") != -1) // if europa
{
    ActivationMethod = 1;
    Referral = "98";

    if(window.location.href.indexOf("/de") != -1) // if germany
    {
        User = "tnt_e";
        Referral = "97";
    }

    else if(window.location.href.indexOf("/uk") == -1) // if international
    {
        User = "tnt_i";
        Referral = "99";
    }
    

    function on_unload() {}
}

else if(User == "tnt" || User == "tnt_i"  || User == "tnt_e")
{
    TriggerDelay = 1000;

    var lastpos = location.href.lastIndexOf('/')+1;
    var url = location.href.substring(0,lastpos);

    ABTestingLink = url + "exit.php?profile=vspexit";
}

else if(User == "ppcbully")
{
    NumberOfAllowedTriggers = 2;
}

else if(User == "supersonicads")
{
	if(window.location.href.indexOf("/vsp/test.aspx") == -1)
	{
		//UseCookie = true;
	}
		
    //NumberOfAllowedTriggers = 2;
	//RotationLevel = 2;
}

else if(User == "whitesmoke")
{
	if(window.location.href.indexOf("/translator") != -1)
	{
		SwitchedOn = false;
	}

	PromoLink = "http://www.whitesmoke.com/GA/ga_gateway.php?gachannel=TAVision&target=buy&a=138&d=4&r=3236&p=tav";
    ActivationMethod = 1;
	DownloadLink = "http://www.whitesmoke.com/GA/ga_gateway.php?gachannel=TAVision&target=buy&a=138&d=4&r=3236&p=tav&chat_id=";
}

else if(User == "rummyroyal")
{
	PromoLink = "http://www.rummyroyal.com/newsletter/landing36.html";
}

else if(User == "babylon")
{
	PromoLink = "http://www.babylon.com/redirects/download.cgi?type=3195&affID=9368";
    ActivationMethod = 1;
	Height = 444;
	MaxCyclesToTriggerPopUp = 4;
	UseDarkScreen = false;
	PopUpWindowBorderColor = '#888';
	TriggerDelay = 1;
}

else if(User == "traderxp")
{
    SwitchedOn = false;
	ActivationMethod = 3;
	PromoLink = "http://www.traderxp.com/OpenAccount?a_aid=4b867b9c57085&a_bid=f1bc9324";
	TriggerDelay = 1;
}

else if(User == "imesh")
{
    ActivationMethod = 1;
	TriggerDelay = 1;
	UseDarkScreen = false;
	SwitchedOn = false;
	//RotationLevel = 5;
	PopUpWindowBorderColor = '#4e9918';
}

else if(User == "kinglotto")
{
	TriggerDelay = 1;
	UseCookie = false;
}

else if(User == "dsnr")
{
    ActivationMethod = 3;
	
	if(typeof Custom != "undefined")
	{
		Custom = Custom.replace("[Currency|USD]","[Currency|$]");
		Custom = Custom.replace("[Currency|EUR]","[Currency|€]");
		Custom = Custom.replace("[Currency|GBP]","[Currency|£]");
	}
}

else if(User == "casinoking")
{
    UseCookie = false;
	PromoLink = "http://banner.casinoking.com/cgi-bin/SetupCasino.exe?creferer=parameter:english+vsp";
}

else if(User == "casinoswiss")
{
    UseCookie = false;
	PromoLink = "http://banner.scasino.com/cgi-bin/SetupCasino.exe?creferer=parameter:english+vsp";
}

else if(User == "casinonoble")
{
    UseCookie = false;
	PromoLink = "http://banner.scasino.com/cgi-bin/SetupCasino.exe?creferer=parameter:english+vsp";
}

else if(User == "casinocom")
{
	UseCookie = false;
	TriggerDelay = 1;
	ActivationMethod = 3;
	PromoLink = "http://stat.casino.com/stats/track.php?__r=1&__b=cc&r=exitchat&pixel=vsp&pb=vsp:1&__sp=1&dp=";
}

else if(User == "anyoption")
{
	// MaxCyclesToTriggerPopUp = 45;
	//LanguageFlow = true;
	ActivationMethod = 0;
	
	GUITranslate = true;
	
	if(typeof Language != "undefined")
	{
		if(Language != "en")
		{
			UsePromo = false;
		}
	}
}

else if(User == "play65" || User == "gammonempire")
{
	//TriggerDelay = 1;

    if(window.location.href.indexOf(".gr") != -1)
    {
		Language = "el";
    }

    else if(window.location.href.indexOf(".de") != -1)
    {
		Language = "de";
    }

    else if(window.location.href.indexOf(".es") != -1)
    {
		Language = "es";
    }

    else if(window.location.href.indexOf(".ru") != -1)
    {
		Language = "ru";
    }

    else if(window.location.href.indexOf(".fr") != -1)
    {
		Language = "fr";
    }

    else if(window.location.href.indexOf(".ro") != -1 || window.location.href.indexOf("/RO/") != -1)
    {
		Language = "ro";
    }

    else if(window.location.href.indexOf(".fi") != -1)
    {
		Language = "fi";
    }

    else if(window.location.href.indexOf("tawla.") != -1)
    {
		Language = "ar";
    }

    else if(window.location.href.indexOf(".it") != -1)
    {
		Language = "it";
    }

    else if(window.location.href.indexOf("tavla65.") != -1)
    {
		Language = "tr";
    }

    else if(window.location.href.indexOf("oyna65.") != -1)
    {
		Language = "tr";
    }
}

///////////////////////////////////////


if(SwitchedOn)
{
    if(typeof ABTestingLink != "undefined")
    {
        IncludeJavaScript(JSURL + "ABTesting.js.aspx?User=" + User, false);
        IncludeJavaScript(JSURL + "ABTestingAnalysis.js.aspx", false);
    }

    else if(typeof RotationLevel != "undefined")
    {
        IncludeJavaScript(JSURL + "Rotation.js.aspx?User=" + User, false);
        IncludeJavaScript(JSURL + "RotationAnalysis.js.aspx", false);
    }

    else
    {
        IncludeJavaScript(JSURL + "VSPWindow.js.aspx", false);
    }
}
