﻿var alertTimerId = 0;

function SwitchImages(image1id, image2id) {

    var e1 = document.getElementById(image1id);
    e1.style.display = 'none';

    var e2 = document.getElementById(image2id);
    e2.style.display = 'block';
}


function validateRadioButton(radioButtonGroup, sMsg, sError) 
{
    //var rateService = document.forms[0].RateService;
    
    var VALIDATION_TEXT = sError + '\n';        

    var cnt = -1;
    for (var i = radioButtonGroup.length - 1; i > -1; i--) 
    {
        if (radioButtonGroup[i].checked) 
        {
            cnt = i; 
            i = -1;
        }
    }
    if (cnt <= -1) 
    {
        sMsg = sMsg + VALIDATION_TEXT; //alert('Please rate our service');
        return false;

    }
}

// show 10 free promotions offer if nl start
//function ChooseOffe() {
//    CurrencyVal = document.getElementById("txtCurrency").value;
//    CountryVal = document.getElementById("txtCountry").value;
//    LanguageVal = document.getElementById("txtLanguage").value;

//    if (CountryVal == "nl") {

//        $("div." + CurrencyVal + "-10-offe").css({ "display": "block" });
//        $("div." + CurrencyVal + "-500-offe").css({ "display": "none" });
//    }
//    else {

//        $("div." + CurrencyVal + "-500-offe").css({ "display": "block" });
//        $("div." + CurrencyVal + "-10-offe").css({ "display": "none" });
//    }
//}

// show 10 free offer if nl End

// show 10 free offer if nl Start
//function ChooseOffer() {
//    CurrencyVal = document.getElementById("txtCurrency").value;
//    CountryVal = document.getElementById("txtCountry").value;
//    LanguageVal = document.getElementById("txtLanguage").value;

//    if (CountryVal == "nl") {

//        if (!(exclude10Free())) {

//        $("div." + CurrencyVal + "-10-offer").css({ "display": "block" });
//        $("div." + CurrencyVal + "-500-offer").css({ "display": "none" });
//          }
//         else {

//            $("div." + CurrencyVal + "-500-offer").css({ "display": "block" });
//            $("div." + CurrencyVal + "-10-offer").css({ "display": "none" });
//        }
//    }
//    else {

//        $("div." + CurrencyVal + "-500-offer").css({ "display": "block" });
//        $("div." + CurrencyVal + "-10-offer").css({ "display": "none" });
//    }
//}
// show 10 free offer if nl Ends

// Don't show 10 free offer if these AffIds

//function exclude10Free() {
//    var affID = document.getElementById("txtAffiliateID").value;
//    var excludedSource = 'aff84319,aff88041,aff111768,aff112664,aff103561,aff108167,aff112966,aff113225,aff115923,aff51051,aff52313,aff86973,aff104545,aff89501,aff105360,aff101732,aff102543,aff104869,aff92808,aff20307,aff106173,aff52951,aff94328,aff113968,aff104158,aff115608,aff89766,aff114199,aff115668,aff108770,aff104678,aff115696';
//    var source = excludedSource.split(',');
//    for (var i = 0; i < source.length; i++) {
//        var sourceValue = source[i];
//        if (sourceValue == affID)
//            return true;
//    }
//    return false;
//}

function removePages() {
    url = window.location.href;
    doExitTraffic = true;
    
    //pages to be excluded from exit strategy, add the pages below;    
    var excludedPages = new Array();
    excludedPages[0] = "promotion-claim-page";
    excludedPages[1] = "thank-you";
    excludedPages[2] = "rules.aspx";
    excludedPages[3] = "help.aspx";
    excludedPages[4] = "casino-security.aspx";    
      
    //check if exclude page was found, if found, set 'doExitTraffic' to false  
    for (p in excludedPages){ 
        var page = RegExp(excludedPages[p]); 
               
        if ((page.test(url)) ) {        
            doExitTraffic = false; 
            break;                                   
        }
    }
    // if page was not found do the exit strategy, pop the page up!
    if (!(excludeExitPopUp())) {
        if (doExitTraffic)
         getExitTraffic();
    }
}

//Exclude certain affiliates from exit strategy
function excludeExitPopUp() {
    var affID = document.getElementById("txtAffiliateID").value;
    var excludedSource = 'aff113458,aff113486,aff113487,aff113488,aff113489,aff113491,aff113492,aff113493,aff113975,aff113977,aff114205,aff114324,aff114513,aff114514,aff114521,aff114532,aff115563,aff115579,aff115580,aff115602,aff115737';
    var source = excludedSource.split(',');
    for (var i = 0; i < source.length; i++) {
        var sourceValue = source[i];
        if (sourceValue == affID)
            return true;
    }
    return false;
}

function changeImage(element, newElement) {
    document.getElementById(element).style.display = 'none';
    document.getElementById(newElement).style.display = 'block';

    setTimeout('changeImage(\'' + newElement + '\', \'' + element + '\')', 3000);
}

function highlightMenu() {
    var as = document.getElementById('navigation').getElementsByTagName('a');
    var url = window.location.href;
    for (i = 0; i < as.length; i++) {
        if (as[i].href == url) {
            as[i].style.fontWeight = 'bold';
            as[i].style.color = '#FBC803';
            //as[i].style.color = '#FBC803';
        }
    }
} 
function toggle_visibility2(id) {
    var e = document.getElementById(id);
    if (e.style.visibility == 'visible')
        e.style.visibility = 'hidden';
    else
        e.style.visibility = 'visible';
}
function toggle_TermsDisplay(id) {
    var e = document.getElementById(id);
    if (e.style.display == 'block')
        e.style.display = 'none';
    else
        e.style.display = 'block';
}
function flashMovie(movieName) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[movieName] : document[movieName];
}

function sendVar() {
    var urlString = urlVAR;
    flashMovie("JPC_Anim_Logo").sendToFlash(urlString);

}
function disableEnterKey(e) {
    if (e.keyCode == 13) {
        e.returnValue = false;
        e.cancel = true;
    }
}

function validateVipLogin() {

    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var msgAccount = document.getElementById("validateyouraccount").value;
    var msgPassword = document.getElementById("validatepassword").value;
    var AccountNumber = document.getElementById("VipAccount");
    var VipPassword = document.getElementById("VipPassword");    

    Error = validateField(VipPassword, Error, msgPassword);
    Error = validateField(AccountNumber, Error, msgAccount);    

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }

}


function validateSurvey()
{

    var rateService = document.forms[0].RateService;
    var msgRateService = document.getElementById("validateoptionselected").value;
    

    if( !validateRadioButtonGroup( rateService ) )
    {
        alert(msgRateService);
        return false;
    }

}

function validateDefaultClaimPromotion(msgPromo, msgName, msgEmail, msgAccount, msgTerms, ul) {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var PromoID = document.getElementById("DefaultPromotionId");
    var FullName = document.getElementById("DefaultName");
    var AccountNumber = document.getElementById("DefaultAccountNumber");
    var EmailAddress = document.getElementById("DefaultEmailAddress");
    var Terms = document.getElementById("terms");
    var thankYouPageUrl = "/thank-you.aspx";

    if (document.getElementById("ul") != null) {
        ul = document.getElementById("ul").value;
    }
    if (document.getElementById("referer") != null) {
        referer = document.getElementById("referer").value
    } else {
        referer = "/" + ul + "/promotion-claim-page.aspx";
    }

    Error = validateField(PromoID, Error, msgPromo);
    Error = validateField(FullName, Error, msgName);
    Error = validateEmail(EmailAddress, Error, msgEmail);
    Error = validateAccountJPC(AccountNumber, Error, msgAccount);
    Error = validateTerms(Terms, Error, msgTerms);

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }

    if (ul != "en" || ul != "")
        thankYouPageUrl = "/" + ul + thankYouPageUrl

    window.location = "/promo/promo.aspx?txtpromoid=" + PromoID.value + "&txtaccno=" + AccountNumber.value + "&txtinterested=Y&txtAfterSubmit=/thank-you.aspx&ul=" + ul + "&referer=" + referer;
}
function validateDefaultClaimPromotionWithPromoId(msgError, msgName, msgEmail, msgAccount, msgTerms, ul) {
    var Error = "";
    var MainError = '';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '';
    }
    var PromoID = document.getElementById("DefaultPromotionId");
    var FullName = document.getElementById("DefaultName");
    var AccountNumber = document.getElementById("DefaultAccountNumber");
    var EmailAddress = document.getElementById("DefaultEmailAddress");
    var Terms = document.getElementById("terms");
    var thankYouPageUrl = "/thank-you.aspx";

    if (document.getElementById("ul") != null) {
        ul = document.getElementById("ul").value;
    }
    if (document.getElementById("referer") != null) {
        referer = document.getElementById("referer").value
    } else {
        referer = "/" + ul + "/promotion-claim-page.aspx";
    }

    //Error = validateField(PromoID, Error, msgPromo);
    Error = validateField(FullName, Error, msgName);
    Error = validateEmail(EmailAddress, Error, msgEmail);
    Error = validateAccountJPC(AccountNumber, Error, msgAccount);
    Error = validateTerms(Terms, Error, msgTerms);

    if ('' != Error) {
        alert(MainError + Error);
        //alert(msgError);
        return false;
    }

    window.location = "/promo/promo.aspx?txtpromoid=" + PromoID.value + "&txtaccno=" + AccountNumber.value + "&txtinterested=Y&txtAfterSubmit=/thank-you.aspx&ul=" + ul + "&referer=" + referer;
}
//Validate that the email text entered is in correct format
function validateEmail(txtEmail, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtEmail) {
            var strEmail = txtEmail.value;

            if ('' != strEmail) {
                var r = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;

                if (!strEmail.match(r))
                    sMsg = sMsg + VALIDATION_TEXT;
                r = null;
            }
            else
                sMsg = sMsg + VALIDATION_TEXT;
        }
    }

    return sMsg;
}
function validatePassword(txtPassword, sMsg) {
    var VALIDATION_TEXT = 'Password cannot be left blank\n';
    var r = /The Password field cannot be empty/;
    var Characters = 'password';

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtPassword) {
            var strPassword = txtPassword.value;

            if ('' != strPassword) {
                if ((strPassword.length < 5) || (strPassword.length > 15)) {
                    VALIDATION_TEXT = 'Password cannot be less than 5 or more than 15 characters.\n';
                    r = /Password cannot be less than 5 or more than 15 characters./;
                    if (!sMsg.match(r)) {
                        sMsg = sMsg + VALIDATION_TEXT;
                    }
                }

                if (strPassword.match(Characters)) {
                    VALIDATION_TEXT = 'Password cannot contain the word "password".\n';
                    r = /Password cannot contain the word ""password""./;

                    if (!sMsg.match(r)) {
                        sMsg = sMsg + VALIDATION_TEXT;
                    }
                }

            } else {
                sMsg = sMsg + VALIDATION_TEXT;
            }
        }
    }
    return sMsg
}
//Validating if the field has contents
function validateField(txtField, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtField) {
            var strName = txtField.value;

            if ('' == strName) {
                sMsg = sMsg + VALIDATION_TEXT;
            }
        }
    }

    return sMsg;
}


function validateRadioButtonGroup(radioButtonGroup) 
{       

    var cnt = -1;
    for (var i = radioButtonGroup.length - 1; i > -1; i--) 
    {
        if (radioButtonGroup[i].checked) 
        {
            cnt = i; 
            i = -1;
        }
    }
    if (cnt <= -1) 
    {
        return false;
    }
    else    
        return true;
}


//Checking that two values are equal
function validateValueNotEqual(Value1, Value2, sMsg, sError) {

    var VALIDATION_TEXT = sError + '.\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != Value1 && null != Value2) {
            if (Value1 != Value2) {
                sMsg = sMsg + VALIDATION_TEXT;
            }
        }
    }

    return sMsg;

}


//Validating Account number entered
function validateAccountJPC(txtAccount, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtAccount) {
            var strAccount = txtAccount.value;

            if ('' != strAccount && strAccount.length >= 9 && strAccount.length <= 17) {
                strAccount = strAccount.toLowerCase();
                var r0 = /^tjc(r|g)?[0-9]{8}(r|g)?$/;
                //var r16 = /^tjd(r|g)?[0-9]{8}(r|g)?$/;
                var r1 = /^fjcr\d{7}(R|[0-9])$/i;
                var r2 = /^tjsr\d{7}(R|[0-9])$/i;
                var r3 = /^fjsr\d{7}(R|[0-9])$/i;
                var r4 = /^tjdr\d{7}(R|[0-9])$/i;
                var r5 = /^fjdr\d{7}(R|[0-9])$/i;
                var r6 = /^tjfr\d{7}(R|[0-9])$/i;
                var r7 = /^fjfr\d{7}(R|[0-9])$/i;
                var r8 = /^tjs(r|g)?[0-9]{8}(r|g)?$/;
                var r9 = /^fjs(r|g)?[0-9]{8}(r|g)?$/;
                var r10 = /^tjd(r|g)?[0-9]{8}(r|g)?$/;
                var r11 = /^fjd(r|g)?[0-9]{8}(r|g)?$/;
                var r12 = /^tjf(r|g)?[0-9]{8}(r|g)?$/;
                var r13 = /^fjf(r|g)?[0-9]{8}(r|g)?$/;
                var r14 = /^tjdr(r|g)?[0-9]{8}(r|g)?$/;
                var r15 = /^frpbr(r|g)?[0-9]{8}(r|g)?$/;
                //var r16 = /^jcrf(r|g)?[0-9]{8}(r|g)?$/;
                //var r17 = /^jcgf\d{8}(R|[0-9])$/i;
                var r16 = /^tj(c|ct)?[0-9]{8}(r|g)?$/i;
                var r17 = /^fjc(r|t|g)?[0-9]{8}$/i;
                var r18 = /^jc(rf|gf)?[0-9]{8}(r)?$/i;
                var r19 = /^tj(fr|fg|sr|sg)?[0-9]{8}$/i;
                var r20 = /^fj(cdr|cdg|ct|fr|fg|dr|dg)?[0-9]{8}$/i;
                var r21 = /^tjd(g)?[0-9]{8}(r|g)?$/i;
                var r22 = /^fjc(ir|ig|t)?[0-9]{8}(r)?$/i;
                var r23 = /^jjp(r|g)?[0-9]{8}$/i;
                var r24 = /^fjc(t|nr|ng)?[0-9]{8}$/i;
                var r25 = /^jsp(g|r)?[0-9]{8}$/i;
                var r26 = /^fjcsw[0-9]{8}(r|g)?$/i;
                var r27 = /^tjcm[0-9]{8}(r|g)?$/i;
                var r28 = /^(f|t)?jct[0-9]{8}$/i;
                var r29 = /^jcrf(r|g)?[0-9]{8}(r|g)?$/;
                var r30 = /^jcgf\d{8}(R|[0-9])$/i;
                var r31 = /^jcm\d{12}$/i;
                var r32 = /^jcm\d{13}$/i;                
                var r33 = /^jcm\d{11}$/i;
                var r34 = /^jcm\d{10}$/i;
                var r35 = /^jcm\d{9}$/i;
                var r36 = /^jcm\d{8}$/i;
                var r37 = /^jcm\d{7}$/i;
                var r38 = /^jcm\d{6}$/i;
                var r39 = /^tjc(r|g)?[0-9]{10}(r|g)?$/;
                var r40 = /^fjcr\d{10}$/i;
                var r41 = /^fjcig\d{8}(r|g)?$/;
                

                if (!strAccount.match(r0) && !strAccount.match(r1) && !strAccount.match(r2) &&
                    !strAccount.match(r3) && !strAccount.match(r4) && !strAccount.match(r5) &&
                    !strAccount.match(r6) && !strAccount.match(r7) && !strAccount.match(r8) &&
                    !strAccount.match(r9) && !strAccount.match(r10) && !strAccount.match(r11) &&
                    !strAccount.match(r12) && !strAccount.match(r13) && !strAccount.match(r14) &&
                    !strAccount.match(r15) && !strAccount.match(r16) && !strAccount.match(r17) &&
                    !strAccount.match(r16) && !strAccount.match(r17) && !strAccount.match(r18) &&
                    !strAccount.match(r19) && !strAccount.match(r20) && !strAccount.match(r21) &&
                    !strAccount.match(r22) && !strAccount.match(r23) && !strAccount.match(r24) &&
                    !strAccount.match(r25) && !strAccount.match(r26) && !strAccount.match(r27) &&
                    !strAccount.match(r28) && !strAccount.match(r29) && !strAccount.match(r30) && 
                    !strAccount.match(r31) && !strAccount.match(r32) && !strAccount.match(r33) &&  
                    !strAccount.match(r34) && !strAccount.match(r35) && !strAccount.match(r36) &&
                    !strAccount.match(r37) && !strAccount.match(r38) && !strAccount.match(r39) && !strAccount.match(r40) && 
                    !strAccount.match(r41)) {
                    sMsg = sMsg + 'Please enter a valid casino account.\n';

                    r0 = null; r1 = null;
                    r2 = null; r3 = null;
                    r4 = null; r5 = null;
                    r6 = null; r7 = null;
                    r8 = null; r9 = null;
                    r10 = null; r11 = null;
                    r12 = null; r13 = null;
                    r14 = null; r15 = null;
                    r16 = null; r17 = null;
                    r18 = null; r19 = null;
                    r20 = null; r21 = null;
                    r22 = null; r23 = null;
                    r24 = null; r25 = null;
                    r26 = null; r27 = null;
                    r28 = null; r29 = null;
                    r30 = null; r31 = null;
                    r32 = null; r33 = null;
                    r34 = null; r35 = null;
                    r36 = null; r37 = null;
                    r38 = null; r39 = null;
                    r40 = null; r41 = null;
                }
            }
            else
                sMsg = sMsg + VALIDATION_TEXT;
        }
    }

    return sMsg;
}

function validateRetrieveAccNo(Support) {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var EmailAddress = document.getElementById("RetrieveEmail");
    var FirstName = document.getElementById("RetrieveFirstName");
    var LastName = document.getElementById("RetrieveLastName");
    var VerifyInput = document.getElementById("VerifyInput").value;
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validatefirstname = document.getElementById("validatefirstname").value;
    var validatelastname = document.getElementById("validatelastname").value;
    var validateequalcaptchatext = document.getElementById("validateequalcaptchatext").value;

    Error = validateField(FirstName, Error, validatefirstname);
    Error = validateField(LastName, Error, validatelastname);
    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);
    Error = validateValueNotEqual(VerifyInput, Support, Error, validateequalcaptchatext);
    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
    return true;
}
function validateRetrieveAccountNumber() {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var EmailAddress = document.getElementById("RetrieveEmail");
    var FirstName = document.getElementById("RetrieveFirstName");
    var LastName = document.getElementById("RetrieveLastName");
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validatefirstname = document.getElementById("validatefirstname").value;
    var validatelastname = document.getElementById("validatelastname").value;

    Error = validateField(FirstName, Error, validatefirstname);
    Error = validateField(LastName, Error, validatelastname);
    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);
    
    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
    return true;
}

function validateRetrievePassword(Support) {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var AccountNumber = document.getElementById("ResetAccount");
    var FirstName = document.getElementById("ResetFirstName");
    var LastName = document.getElementById("ResetLastName");
    var EmailAddress = document.getElementById("ResetEmail");
    var VerifyInput = document.getElementById("VerifyInput").value;
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validatefirstname = document.getElementById("validatefirstname").value;
    var validatelastname = document.getElementById("validatelastname").value;
    var validateyouraccount = document.getElementById("validateyouraccount").value;
    var validateequalcaptchatext = document.getElementById("validateequalcaptchatext").value;

    Error = validateField(FirstName, Error, validatefirstname);
    Error = validateField(LastName, Error, validatelastname);
    Error = validateAccountJPC(AccountNumber, Error, validateyouraccount);
    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);
    Error = validateValueNotEqual(VerifyInput, Support, Error, validateequalcaptchatext);

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
}

function validateRetrievePassword() {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var AccountNumber = document.getElementById("ResetAccount");
    var FirstName = document.getElementById("ResetFirstName");
    var LastName = document.getElementById("ResetLastName");
    var EmailAddress = document.getElementById("ResetEmail");
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validatefirstname = document.getElementById("validatefirstname").value;
    var validatelastname = document.getElementById("validatelastname").value;
    var validateyouraccount = document.getElementById("validateyouraccount").value;

    Error = validateField(FirstName, Error, validatefirstname);
    Error = validateField(LastName, Error, validatelastname);
    Error = validateAccountJPC(AccountNumber, Error, validateyouraccount);
    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
}
//Start of Submit a Query JS Functions
function validateContactUs(Support) {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var VerifyInput = document.getElementById("VerifyInput").value;
    var EmailAddress = document.getElementById("ContactEmail");
    var YourEmailAddressRetyped = document.getElementById("ContactEmailAddressRetyped");
    var YourComments = document.getElementById("ContactQuery");
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validateequalemail = document.getElementById("validateequalemail").value;
    var validateblankmessage = document.getElementById("validateblankmessage").value;
    var validateequalcaptchatext = document.getElementById("validateequalcaptchatext").value;

    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);
    Error = validateEmail(YourEmailAddressRetyped, Error, validateyouremailaddress);
    Error = validateValueNotEqual(EmailAddress.value, YourEmailAddressRetyped.value, Error, validateequalemail);
    Error = validateField(YourComments, Error, validateblankmessage);
    Error = validateValueNotEqual(VerifyInput, Support, Error, validateequalcaptchatext);

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
}

function validateContactUs() {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var EmailAddress = document.getElementById("ContactEmail");
    var YourEmailAddressRetyped = document.getElementById("ContactEmailAddressRetyped");
    var YourComments = document.getElementById("ContactQuery");
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validateequalemail = document.getElementById("validateequalemail").value;
    var validateblankmessage = document.getElementById("validateblankmessage").value;

    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);
    Error = validateEmail(YourEmailAddressRetyped, Error, validateyouremailaddress);
    Error = validateValueNotEqual(EmailAddress.value, YourEmailAddressRetyped.value, Error, validateequalemail);
    Error = validateField(YourComments, Error, validateblankmessage);

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
}

function validateVIPContactUs() {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var EmailAddress = document.getElementById("ContactEmail");
    var YourEmailAddressRetyped = document.getElementById("ContactEmailAddressRetyped");
    var YourComments = document.getElementById("ContactQuery");
    var validateyouremailaddress = document.getElementById("validateyouremailaddress").value;
    var validateequalemail = document.getElementById("validateequalemail").value;
    var validateblankmessage = document.getElementById("validateblankmessage").value;

    Error = validateEmail(EmailAddress, Error, validateyouremailaddress);
    Error = validateEmail(YourEmailAddressRetyped, Error, validateyouremailaddress);
    Error = validateValueNotEqual(EmailAddress.value, YourEmailAddressRetyped.value, Error, validateequalemail);
    Error = validateField(YourComments, Error, validateblankmessage);

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
}
function validateAccount() {
    var Error = "";
    var AccountNumber = document.getElementById("ContactAccount");
    var divError = document.getElementById("Err");
    var validateaccountnumber = document.getElementById("validateaccountnumber").value;

    if (AccountNumber.value != '') { Error = validateAccountJPC(AccountNumber, Error, validateaccountnumber); }
    if (Error != '') {
        divError.innerHTML = validateaccountnumber;
        divError.style.display = 'block';
    }
    else 
    {
        divError.innerHTML = '';
        divError.style.display = 'none';
    }
}
function validateTerms(chkBox, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != chkBox) {

            if (!chkBox.checked) {
                sMsg = sMsg + VALIDATION_TEXT;
            }
        }
    }

    return sMsg;
}
function getPromParentTag(objStartTag) {
    var objCurrTag = objStartTag;
    while (typeof (objCurrTag.screen) == 'undefined' && isdefined(objCurrTag.className, false).toLowerCase() !== "promo_enter" && isdefined(objCurrTag.tagName, false).toLowerCase() !== "body" && isdefined(objCurrTag.name, false).toLowerCase() !== "body" && isdefined(objCurrTag.id, false).toLowerCase() !== "downloadarea" && isdefined(objCurrTag.tagName, false).toLowerCase() !== "form") {
        if (typeof (objCurrTag.parentElement) == "undefined")
        { objCurrTag = objCurrTag.parentNode; } else { objCurrTag = objCurrTag.parentElement; }
    }
    if (typeof (objCurrTag.screen) !== 'undefined') {
        objCurrTag = document;
    }
    return objCurrTag;
}
//End Of Submit a Query JS Functions
function DownloadCasino(objAnchor, strPromoID, strEventID) {
    var objCurrTag = null;
    var arrInputs;
    var strQueryString;
    //objCurrTag = getPromParentTag(objAnchor);
    var strFlashLang;

    strFlashLang = "en"; //getLanguage(document.getElementById("cbolanguage").value);

    //arrInputs = objCurrTag.getElementsByTagName("input");

    if (strPromoID == -1)

        if (strFlashLang == "en") {
        strQueryString = "/exit/FLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "fr") {
        strQueryString = "/exit/FRFLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "de") {
        strQueryString = "/exit/DEFLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "it") {
        strQueryString = "/exit/ITFLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "es") {
        strQueryString = "/exit/ESFLASHCASINO/tracking.aspx?";
    }
    else {
        strQueryString = "/exit/FLASHCASINO/tracking.aspx?";
    }

    else
        strQueryString = "/exit/casinodownload/tracking.aspx?";

    //        try {
    //            if (typeof strPromoID == "undefined") strPromoID = strDownloadPromoID;
    //        }
    //        catch (e) { }
    //        try {
    //            if (typeof strEventID == "undefined") strEventID = strDownloadEventID;
    //        }
    //        catch (e) { }

    //        if (arrInputs.length <= 0 || (typeof strPromoID !== "undefined" && typeof strEventID !== "undefined")) {
    //            if (typeof strPromoID !== "undefined") strQueryString += "pr=" + strPromoID + "&";
    //            if (typeof strEventID !== "undefined") strQueryString += "eventid=" + strEventID + "&";
    //        }
    //        else {
    //            for (var i = 0; i < arrInputs.length; i++) {
    //                if (arrInputs[i].name == "txtPromoID") { if (typeof strPromoID == "undefined") strQueryString += "pr=" + arrInputs[i].value + "&"; else strQueryString += "pr=" + strPromoID + "&"; }
    //                else if (arrInputs[i].name == "txtEventID") { if (typeof strEventID == "undefined") strQueryString += "eventid=" + arrInputs[i].value + "&"; else strQueryString += "eventid=" + strEventID + "&"; }
    //            }
    //        }

    //        strQueryString = strQueryString.substring(0,strQueryString.length - 1);

    //add in language
    strQueryString += "ul=" + strFlashLang;
    strQueryString += "&s=" + document.getElementById("txtAffiliateID").value;
    strQueryString += "&a=" + document.getElementById("txtAdID").value;
    strQueryString += "&b=" + document.getElementById("txtBannerID").value;
    //strQueryString += "&vt="+document.getElementById("txtVT").value;

    if (strPromoID != -1)

        window.location = strQueryString;
    else
    //window.location = "http://www.google.com";
        window.open(strQueryString);
    return false;

}

function DownloadCasino100(objAnchor, strPromoID, strEventID) {



    var objCurrTag = null;
    var arrInputs;
    var strQueryString;
    objCurrTag = getPromParentTag(objAnchor);
    var strFlashLang;
    var strPromoID100 = ""


    strFlashLang = "en"; //getLanguage(document.getElementById("cbolanguage").value);

    arrInputs = objCurrTag.getElementsByTagName("input");

    if (strPromoID == -1)

        if (strFlashLang == "en") {
        strQueryString = "/exit/FLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "fr") {
        strQueryString = "/exit/FRFLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "de") {
        strQueryString = "/exit/DEFLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "it") {
        strQueryString = "/exit/ITFLASHCASINO/tracking.aspx?";
    }
    else if (strFlashLang == "es") {
        strQueryString = "/exit/ESFLASHCASINO/tracking.aspx?";
    }
    else {
        strQueryString = "/exit/FLASHCASINO/tracking.aspx?";
    }

    else
        strQueryString = "/exit/CASINODOWNLOAD/tracking.aspx?";

    try {
        if (typeof strPromoID == "undefined") strPromoID = strPromoID100;
    }
    catch (e) { }
    try {
        if (typeof strEventID == "undefined") strEventID = strDownloadEventID;
    }
    catch (e) { }

    if (arrInputs.length <= 0 || (typeof strPromoID100 !== "undefined" && typeof strEventID !== "undefined")) {
        if (typeof strPromoID !== "undefined") strQueryString += "pr=" + strPromoID100 + "&";
        if (typeof strEventID !== "undefined") strQueryString += "eventid=" + strEventID + "&";
    }
    else {
        for (var i = 0; i < arrInputs.length; i++) {
            if (arrInputs[i].name == "txtPromoID") { if (typeof strPromoID == "undefined") strQueryString += "pr=" + arrInputs[i].value + "&"; else strQueryString += "pr=" + strPromoID + "&"; }
            else if (arrInputs[i].name == "txtEventID") { if (typeof strEventID == "undefined") strQueryString += "eventid=" + arrInputs[i].value + "&"; else strQueryString += "eventid=" + strEventID + "&"; }
        }
    }

    //        strQueryString = strQueryString.substring(0,strQueryString.length - 1);

    //add in language
    strQueryString += "ul=" + strFlashLang;
    strQueryString += "&s=" + document.getElementById("txtAffiliateID").value;
    strQueryString += "&a=" + document.getElementById("txtAdID").value;
    strQueryString += "&b=" + document.getElementById("txtBannerID").value;
    //strQueryString += "&vt="+document.getElementById("txtVT").value;
    if (strPromoID != -1)

        window.location = strQueryString;
    else
    //window.location = "http://www.google.com";
        window.open(strQueryString);
    return false;
}

function createNewElement(inputForm, elementName, elementValue) {
    var newElement = document.createElement("<input name='" + elementName + "' type='hidden'>");
    inputForm.appendChild(newElement);
    newElement.value = elementValue;
    return newElement;
}

function formQuiz(promoId, accountNumber, afterPageSubmit) {
    var radioAnswer;
    var Error = '';
    var MainError = 'The following error(s) occurred:\n\n';
    var accError = 'Please insert a valid account number.';
    var answerError = 'Please select an answer\n';
    var accountValue = accountNumber.value;
    radioAnswer = document.getElementsByName("Answer");
    var len = radioAnswer.length;
    var chosen = '';

    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }

    if (document.getElementById("accerror") != null) {
        accError = document.getElementById("accerror").value + '\n';
    }

    if (document.getElementById("answerError") != null) {
        answerError = document.getElementById("answerError").value + '\n';
    }

    for (i = 0; i < len; i++) {
        if (radioAnswer[i].checked) {
            chosen = radioAnswer[i].value
        }
    }

    if (chosen == "") {
        Error = answerError;
    }
    Error = validateAccountJPC(accountNumber, Error, accError);

    if (Error != "") {
        alert('The following error(s) occurred:\n\n' + Error);
        return false;
    }

    window.location = "quiz/quiz.aspx?loginname=" + accountValue + "&txtpromoid=" + promoId + "&txtaftersubmit=" + afterPageSubmit + "&answer=" + chosen;
    return false

}
function formQuizTerms(promoId, accountNumber, afterPageSubmit, bTermsAccepted) {
    var radioAnswer;
    var Error = '';
    var MainError = 'The following error(s) occurred:\n\n';
    var accError = 'Please insert a valid account number.';
    var answerError = 'Please select an answer\n';
    var termsError = 'Please confirm you have read and agreed to the terms and conditions.';
    var accountValue = accountNumber.value;
    radioAnswer = document.getElementsByName("Answer");
    var len = radioAnswer.length;
    var chosen = '';

    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }

    if (document.getElementById("accerror") != null) {
        accError = document.getElementById("accerror").value + '\n';
    }

    if (document.getElementById("answerError") != null) {
        answerError = document.getElementById("answerError").value + '\n';
    }
    if (document.getElementById("tersmserror") != null) {
        termsError = document.getElementById("tersmserror").value + '\n';
    }

    for (i = 0; i < len; i++) {
        if (radioAnswer[i].checked) {
            chosen = radioAnswer[i].value
        }
    }

    if (chosen == "") {
        Error = answerError;
    }
    Error = validateAccountJPC(accountNumber, Error, accError);
    if (!bTermsAccepted) {
        Error += termsError;
    }

    if (Error != "") {
        alert(MainError + Error);
        return false;
    }

    window.location = "quiz/quiz.aspx?loginname=" + accountValue + "&txtpromoid=" + promoId + "&txtaftersubmit=" + afterPageSubmit + "&answer=" + chosen;
    return false

}
function submitClaim(promoId, accountNumber, actionURL, afterPageSubmit, bTermsAccepted, Interested, ul) {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    var accError = 'Please insert a valid account number.';
    var termsError = 'Please confirm you have read and agreed to the terms and conditions.';
    var promoidError = "Please insert a promotion id.";

    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }

    if (document.getElementById("accerror") != null) {
        accError = document.getElementById("accerror").value;
    }

    if (document.getElementById("tersmserror") != null) {
        termsError = document.getElementById("tersmserror").value
    }

    if (document.getElementById("promoiderror") != null) {
        promoidError = document.getElementById("promoiderror").value
    }

    if (document.getElementById("ul") != null) {
        ul = document.getElementById("ul").value;
    }
    if (document.getElementById("referer") != null) {
        referer = document.getElementById("referer").value
    } else {
        referer = "/casino-promotions/";
    }

    Error = validateField(promoId, Error, promoidError);
    Error = validateAccountJPC(accountNumber, Error, accError);

    if (!bTermsAccepted) {
        Error += termsError;
    }

    if (Error != "") {
        alert(MainError + Error);
        return false;
    }

    window.location = "/promo/promo.aspx?txtpromoid=" + promoId + "&txtaccno=" + accountNumber.value + "&txtinterested=" + Interested + "&txtAfterSubmit=" + afterPageSubmit + "&ul=" + ul + "&referer=" + referer;
}

function submitPassword() {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';
    if (document.getElementById("mainerror") != null) {
        MainError = document.getElementById("mainerror").value + '\n\n';
    }
    var txtPassword = document.getElementById("ResetPassword");
    var txtConfirm = document.getElementById("ResetPasswordConfirmation");

    var txtPasswordMsg = document.getElementById("validatepasswordlength");
    var txtPasswordConfirmMsg = document.getElementById("validatepasswordcontents");

    Error = validateResetPassword(txtPassword, Error, txtPasswordMsg, txtPasswordConfirmMsg);
    Error = validateValueNotEqual(txtPassword.value, txtConfirm.value, Error, "The passwords are not the same");

    if (Error != "") {
        alert(MainError + Error);
        return false;
    }
}

function validateResetPassword(txtPassword, sMsg, Error1, Error2) {
    var VALIDATION_TEXT = Error1.value + '\n';
    var r = /The Password field cannot be empty/;
    var CharactersEn = 'password';
    var CharactersFr = 'motdepasse';
    var CharactersIt = 'password';
    var CharactersEs = 'contraseña';
    var CharactersDe = 'kennwort';

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtPassword) {
            var strPassword = txtPassword.value.toUpperCase();

            if ('' != strPassword) {
                if ((strPassword.length < 5) || (strPassword.length > 15)) {
                    VALIDATION_TEXT = Error1.value + '\n';
                    r = /Password cannot be less than 5 or more than 15 characters./;
                    if (!sMsg.match(r)) {
                        sMsg = sMsg + VALIDATION_TEXT;
                    }
                }

                if (strPassword.match(CharactersEn.toUpperCase()) || strPassword.match(CharactersFr.toUpperCase()) || strPassword.match(CharactersIt.toUpperCase()) ||
                strPassword.match(CharactersEs.toUpperCase()) || strPassword.match(CharactersDe.toUpperCase())) {
                    VALIDATION_TEXT = Error2.value + '\n';
                    r = /Password cannot contain the word ""password""./;

                    if (!sMsg.match(r)) {
                        sMsg = sMsg + VALIDATION_TEXT;
                    }
                }

            } else {
                sMsg = sMsg + VALIDATION_TEXT;
            }
        }
    }
    return sMsg
}
last_tab = 'tab1';
last_tabs = 'tab1a';
cookie_tab = 'tab1';
cookie_tabs = 'tab1a';

function show(layerName) {
    if (document.getElementById(layerName) != null) {
        document.getElementById(layerName).style.display = '';
    }
}

function hide(layerName) {
    document.getElementById(layerName).style.display = 'none';
}

function showhide(divid, state) {
    document.getElementById(divid).style.display = state
}

function show_next(tab_name) {
    document.getElementById(last_tab).className = last_tab;
    var curr = document.getElementById(tab_name);
    curr.className = tab_name + '_hover';
    hide(last_tab + '_data');
    hide(last_tabs + '_data');
    show(tab_name + '_data');
    last_tab = tab_name;
}

function show_nexts(tab_names) {
    document.getElementById(last_tabs).className = 'tabs';
    var curr = document.getElementById(tab_names);
    curr.className = 'tab_hovers';
    hide(last_tabs + '_data');
    show(tab_names + '_data');
    last_tabs = tab_names;
}

function signup(tab) {
    show_next('tab1');
    show_nexts(tab);
    //show_nexts('tab1a');
    //show_nexts('<%=Session["tabToshow"]%>');
}
function signupFooter(tab) {
    if (document.getElementById('tabLoading') != null) {
        hide('tabLoading');
    }

    last_tabs = tab;
}

function gettingstarted() {
    show_next('tab2');
    show_nexts('tab2a');
}

function showrewards() {
    var tab4 = document.getElementById('tab4_data');
    var tab5 = document.getElementById('tab5_data');
    var tab6 = document.getElementById('tab6_data');
    var tab7 = document.getElementById('tab7_data');

    tab4.style.display = 'block';
    tab5.style.display = 'none';
    tab6.style.display = 'none';
    tab7.style.display = 'none';
}

function showauctionlogin() {
    var tab4 = document.getElementById('tab4_data');
    var tab5 = document.getElementById('tab5_data');
    var tab6 = document.getElementById('tab6_data');
    var tab7 = document.getElementById('tab7_data');

    tab4.style.display = 'none';
    tab5.style.display = 'none';
    tab6.style.display = 'none';
    tab7.style.display = 'block';
}


function showauction() {
    var tab4 = document.getElementById('tab4_data');
    var tab5 = document.getElementById('tab5_data');
    var tab6 = document.getElementById('tab6_data');
    var tab7 = document.getElementById('tab7_data');

    tab4.style.display = 'none';
    tab5.style.display = 'block';
    tab6.style.display = 'none';
    tab7.style.display = 'none';
}

function showloyalty() {
    var tab4 = document.getElementById('tab4_data');
    var tab5 = document.getElementById('tab5_data');
    var tab6 = document.getElementById('tab6_data');
    var tab7 = document.getElementById('tab7_data');

    tab4.style.display = 'none';
    tab5.style.display = 'none';
    tab6.style.display = 'block';
    tab7.style.display = 'none';
}

//Tab Selection on URL
function Set_Cookie(name, value, expires, path, domain, secure) {
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime(today.getTime());

    /*
    if the expires variable is set, make the correct
    expires time, the current script below will set
    it for x number of days, to make it for hours,
    delete * 24, for minutes, delete * 60 * 24
    */
    if (expires) {
        expires = expires * 15000;
    }
    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = name + "=" + escape(value) +
        ((expires) ? ";expires=" + expires_date.toGMTString() : "") +
        ((path) ? ";path=" + path : "") +
        ((domain) ? ";domain=" + domain : "") +
        ((secure) ? ";secure" : "");
}

function Get_Cookie(check_name) {
    // first we'll split this cookie up into name/value pairs
    // note: document.cookie only returns name=value, not the other components
    var a_all_cookies = document.cookie.split(';');
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false; // set boolean t/f default f

    for (i = 0; i < a_all_cookies.length; i++) {
        // now we'll split apart each name=value pair
        a_temp_cookie = a_all_cookies[i].split('=');

        // and trim left/right whitespace while we're at it
        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

        // if the extracted name matches passed check_name
        if (cookie_name == check_name) {
            b_cookie_found = true;
            // we need to handle case where cookie has no value but exists (no = sign, that is):
            if (a_temp_cookie.length > 1) {
                cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
            }
            // note that in cases where cookie is initialized but no value, null is returned
            return cookie_value;
            break;
        }
        a_temp_cookie = null;
        cookie_name = '';
    }

    if (!b_cookie_found) {
        return 'tab1';
    }
}

// this deletes the cookie when called
function Delete_Cookie(name, path, domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
        ((path) ? ";path=" + path : "") +
        ((domain) ? ";domain=" + domain : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function showCorrectPromoTab(tabName, subTabName) {
    if (tabName != 'tab1') {
        show_next(tabName);

        // Ensure that the tab1 stuff is hidden
        hide('tab1a'); hide('tab1a_data');
        hide('tab1b'); hide('tab1b_data');
        hide('tab1c'); hide('tab1c_data');
        hide('tab1d'); hide('tab1d_data');
    }

    if (tabName == null || tabName == "" || tabName == 'tab1') {
        // set default sub tab
        if (subTabName == null || subTabName == "")
            subTabName = 'tab1a_data';

        show(subTabName);
        // highlight the default tab too
        document.getElementById('tab1').className = 'tab1_hover';
    }

    if (document.getElementById('tabLoading') != null) {
        hide('tabLoading');
    }
}

function set_correct_tab() {
    var tabCookie = Get_Cookie("tabholder");

    if (tabCookie != 'tab1') {
        show_next(tabCookie);
    }

    if (tabCookie == null || tabCookie == "" || tabCookie == 'tab1') {
        // display the default information
        show('tab1a_data');
        // highlight the default tab too
        document.getElementById('tab1').className = 'tab1_hover';
    }

    if (document.getElementById('tabLoading') != null) {
        hide('tabLoading');
    }

    Delete_Cookie('tabholder', '/', '');
    //(Get_Cookie('tabholder')) ? alert(Get_Cookie('tabholder')) :
    //    alert('it is gone');
}

function MakeTwoDigits(InputValue) {
    var returnvalue = "";
    var inputarray = (InputValue).toString().split(".");

    if (inputarray.length == 2) {
        returnvalue = inputarray[0]

        if (inputarray[1].length == 0) {
            returnvalue += "." + inputarray[1] + "00";
        }
        else if (inputarray[1].length == 1) {
            returnvalue += "." + inputarray[1] + "0";
        }
        else if (inputarray[1].length == 2) {
            returnvalue += "." + inputarray[1];
        }
    }
    else {
        returnvalue = InputValue + ".00";
    }

    return returnvalue;
}

function AddCommas(nStr) {
    nStr += '';
    x = nStr.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ',' + '$2');
    }
    return x1 + x2;
}

function GameTicker() {
    var currentvalue = ""
    var increment = ""
    var label;
    var newvalue;

    var jptickers = document.getElementsByName("jpticker");

    if (jptickers.length > 0) {
        for (var i = 0; i < jptickers.length; i++) {
            label = jptickers[i];
            currentvalue = parseFloat(label.getAttribute("value"));

            increment = parseFloat(label.getAttribute("increment"));
            newvalue = currentvalue + increment;
            label.innerHTML = AddCommas(MakeTwoDigits(Math.round(newvalue * Math.pow(10, 2)) / Math.pow(10, 2)));
            label.setAttribute("value", newvalue);
        }
        setTimeout('GameTicker();', 1000);
    }
}
function validateCasinoAccount(txtAccount, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var bValid = false;
    var arrClientCodes = new Array("RBC", "JPC", "LNC", "GCC");
    var sNewMsg;
    alert(sMsg);
    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    for (x in arrClientCodes) {
        if (arrClientCodes[x]) {
            sNewMsg = '';

            sNewMsg = eval("validateAccount" + arrClientCodes[x] + "(txtAccount,sMsg,sError)");
            alert(sNewMsg);
            if (sNewMsg == '') {
                return sMsg;
            }

        }
    }
    return sMsg = sMsg + VALIDATION_TEXT;
}
function validateAccountRBC(txtAccount, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtAccount) {
            var strAccount = txtAccount.value;

            if ('' != strAccount && strAccount.length >= 10) {
                strAccount = strAccount.toLowerCase();
                var r = /^trb(r|g)?[0-9]{8}(r|g)?$/;
                var r0 = /^frbr\d{7}(R|[0-9])$/i;
                var r1 = /^rb\d{7}(R|[0-9])$/i;
                var r2 = /^pbr\d{8}$/i;
                var r3 = /^fprb\d{8}(R|[0-9])$/i;
                var r4 = /^fprb(r|g)?[0-9]{8}(r|g)?$/;
                var r5 = /^(t|f)car[0-9]{8}$/i;
                var r6 = /^(t|f)sd(r|g)?[0-9]{8}$/i;
                var r7 = /^(t|f)ah(r|g)?[0-9]{8}(r|g)?$/i;
                var r8 = /^th(r|g)?[0-9]{8}(r|g)?$/i;
                var r9 = /^(t|f)hc(r|g)?[0-9]{8}(r|g)?$/i;
                var r10 = /^frpbr\d{8}$/i;
                var r11 = /^frpbr(r|g)?[0-9]{8}(r|g)?$/;
                var r12 = /^frbpr\d{8}$/i;
                var r13 = /^frbpr(r|g)?[0-9]{8}(r|g)?$/;

                if (!strAccount.match(r) && !strAccount.match(r0) && !strAccount.match(r1) &&
                                                                                !strAccount.match(r2) && !strAccount.match(r3) && !strAccount.match(r4) &&
                                                                                !strAccount.match(r5) && !strAccount.match(r6) && !strAccount.match(r7) &&
                                                                                !strAccount.match(r8) && !strAccount.match(r9) && !strAccount.match(r10) && !strAccount.match(r11) && !strAccount.match(r12) && !strAccount.match(r13))

                    sMsg = sMsg + VALIDATION_TEXT;
                r = null;
                r0 = null;
                r1 = null;
                r2 = null;
                r3 = null;
                r4 = null;
                r5 = null;
                r6 = null;
                r7 = null;
                r8 = null;
                r9 = null;
                r10 = null;
                r11 = null;
                r12 = null;
                r13 = null;


            }
            else
                sMsg = sMsg + VALIDATION_TEXT;
        }
    }

    return sMsg;
}
function validateAccountGCC(txtAccount, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtAccount) {
            var strAccount = txtAccount.value;

            if ('' != strAccount && strAccount.length >= 10) {
                strAccount = strAccount.toLowerCase();
                var r = /^tgc(r|g)?[0-9]{8}(r|g)?$/;
                var r0 = /^fgcr\d{7}(R|[0-9])$/i;
                var r1 = /^gc\d{7}(R|[0-9])$/i;
                var r7 = /^gc\d{8}(R|[0-9])$/i;
                var r2 = /^pgc\d{8}(R|[0-9])$/i;
                var r3 = /^tgu\d{8}(R|[0-9])$/i;
                var r4 = /^fgu\d{8}(R|[0-9])$/i;
                var r5 = /^vgcj\d{8}(R|[0-9])$/i;
                var r6 = /^gj\d{8}(R|[0-9])$/i;

                if (!strAccount.match(r) && !strAccount.match(r7) && !strAccount.match(r0) && !strAccount.match(r1) && !strAccount.match(r2) && !strAccount.match(r3) && !strAccount.match(r4) && !strAccount.match(r5) && !strAccount.match(r6))
                    sMsg = sMsg + VALIDATION_TEXT;
                r = null;
            }
            else
                sMsg = sMsg + VALIDATION_TEXT;
        }
    }

    return sMsg;
}
function validateAccountLNC(txtAccount, sMsg, sError) {
    var VALIDATION_TEXT = sError + '\n';
    var r = new RegExp(sError);

    if (sMsg == null || sMsg == 'undefined')
        sMsg = '';

    if (sMsg == '' || !sMsg.match(r)) {
        if (null != txtAccount) {
            var strAccount = txtAccount.value;
            if ('' != strAccount && strAccount.length >= 10) {
                strAccount = strAccount.toLowerCase();
                var r = /^tln(r|g)?[0-9]{8}(r|g)?$/;
                var r0 = /^flnr\d{7}(R|[0-9])$/i;
                var r1 = /^ln\d{7}(R|[0-9])$/i;
                var r2 = /^pln\d{8}(R|[0-9])$/i;
                var r3 = /^Lnr\d{7}(R|[0-9])$/i;

                if (!strAccount.match(r) && !strAccount.match(r0) && !strAccount.match(r1) && !strAccount.match(r2) && !strAccount.match(r3))
                    sMsg = sMsg + VALIDATION_TEXT;
                r = null;
            }
            else
                sMsg = sMsg + VALIDATION_TEXT;
        }
    }

    return sMsg;
}

function detect() {
    var browser = navigator.appName;
    var b_version = navigator.appVersion;
    var version = parseFloat(b_version);
    if ((browser != "Microsoft Internet Explorer") && (version >= 4)) {
        document.getElementById('oopsPopUp').style.visibility = 'visible';
    }
}

function switchimage(gameNum, language, state) {

    var oImage = eval("document.images.game" + gameNum);

    if (state == "on") {
        oImage.src = "/instant-casino-games/" + language + "images/games/game" + gameNum + ".jpg"
    } else {
        oImage.src = "/instant-casino-games/" + language + "images/games/game-" + gameNum + ".png"
    }
}


/////////////////////////
function exitStrat() {
    var mydomain = getDomain(window.location.href);
    var elem = document.activeElement;
    var port = document.location.port;
    var url;

    if (port != "" && port != "undefined") {
        url = 'http://' + mydomain + ":" + port + '/exitpopup.aspx?ul=en';
    }
    else {
        url = 'http://' + mydomain + '/exitpopup.aspx?ul=en';
    }



    if (elem) {
        if (elem.tagName == 'A') {
            if (elem.href) {
                var yourdomain = getDomain(elem.href);

                if (yourdomain == "") {
                    return;
                }

                if (yourdomain != mydomain) {
                    window.open(url, null, 'height=365px,width=502px');

                    return;
                }
                else {
                    return;
                }
            }
        }
    }

    window.open(url, null, 'height=365px,width=502px');
}


//function getDomain(url) {
//    var domain = url.match(/:\/\/(www\.)?([^\/:]+)/);

//    if (domain) {
//        return domain[2];
//    }
//    else {
//        return '';
//    }
//}
///////////////
//pop up window...
function windowOpen(URL, height, width, location, status) {
    window.open(URL, "openWindow", "location=" + location + ",status=" + status + ",scrollbars=1,width=" + width + ",height=" + height + "");
}
///////////////////
//show hide for banking faq
function showContent(theNum) {
    var x;
    for (i = 1; i <= 13; i++) {
        x = document.getElementById('bank' + i);
        if (theNum == i) {
            if (x.style.display == "block") {
                x.style.display = 'none';
            } else {
                x.style.display = 'block';
            }
        } else {
            x.style.display = 'none';
        }
    }
}

/*<!----  Start Change Image by VT Number (Odd or Even)---->*/

function SwitchDownloadImage(imageId) {
    var imageTag = document.getElementById(imageId);
    //var vtNumber = document.getElementById('txtVT').value;

    //if (vtNumber % 2 == 0) {
        imageTag.src = "/images/buttons/clickHere_e.gif"; // for even number: Play Now

    //}
    imageTag.alt = "Over 350+ Casino Games! Download our Free Software!";
    imageTag.title = "Over 350+ Casino Games! Download our Free Software!";
}
/*<!----  End Change Image by VT Number (Odd or Even)---->*/

/* Start Rotate homepage winners */

var i = 1;
function rotatedivshow(divprefix, numberofimages) {

    if (i > numberofimages) {
        i = 1;
    }
    bothlinked = divprefix + i;
    document.getElementById(bothlinked).style.display = 'block';

    if (i == 1) {
        a = numberofimages;
    } else {
        a = i - 1;
    }
    bothlinked2 = divprefix + a;
    document.getElementById(bothlinked2).style.display = 'none';

    i += 1;
    restartAgain(divprefix, numberofimages);

}

function restartAgain(divprefix, numberofimages) {
    holder = "rotatedivshow('" + divprefix + "'," + numberofimages + ")";
    setTimeout(holder, 6000);
}


/* End Rotate homepage winners */

function validateGameDownload(SessionSecurityCode, txtSecurityCode, txtPhone) {
    var Error = "";
    var MainError = 'The following error(s) occurred:\n\n';

    var PhoneNumber = document.getElementById(txtPhone);
    var SecurityCode = document.getElementById(txtSecurityCode);
    var sCode = document.getElementById(SessionSecurityCode);

    Error = validateField(PhoneNumber, Error, "Mobile number cannot be left blank.");
    Error = validateValueNotEqual(sCode.value, SecurityCode.value, Error, "The numbers you have entered did not match the security code verification. Please try again");

    if ('' != Error) {
        alert(MainError + Error);
        return false;
    }
}

// show NL 10 free offer text if nl start
//function ShowText() {
//    CurrencyVal = document.getElementById("txtCurrency").value;
//    CountryVal = document.getElementById("txtCountry").value;
//    LanguageVal = document.getElementById("txtLanguage").value;

//    if (CountryVal == "nl") {
//  

//    $(function() {
//        $('#text-nl').show(); 
//         $('#text-rules').show();
//    });
//}
//   
//   
//    }




function showOffer() {

    var affId = document.getElementById("txtAffiliateID");
    var affiliates = "aff113486,aff113487,aff113488,aff113489,aff113491,aff113492,aff113500,aff113975,aff113977,aff114205,aff114513,aff114514,aff114521,aff114532,aff115563,aff115579,aff115580,aff115581,aff115602,aff115737,aff115784,aff115785,aff115787,aff115936,aff115937";
    if (affiliates.indexOf(affId.value) == -1) {


        // US check 1 for language
        var ipCountry = document.getElementById("txtIPCountry");
        var country = document.getElementById("txtCountry");
        var adId = document.getElementById("txtAdID");
        var Language = document.getElementById("txtLanguage");
        var countries = "us,il";
        var ads = "205249,205406,205445,205628,205629,205630,205631,205632,205633,205634,205636,205638,205639,205640,205642,205643,205644,205645,205646,205647,205648,209360,209361,209362,209363,209364,209365,209366,209367,209369,209370,209371,209373,209378,209379,209380,209381,209420,209421,209422,209423,209424,209425,209426,209427,209429,209431,209432,209433,209438,209439,209440,209441,214843,214846,223857,223858,223859,223860";

        if (ipCountry != null && country != null && adId != null) {

            var valIpCountry = ipCountry.value;
            var valCountry = country.value;
            var valAdId = adId.value;
            var valLanguage = Language.value;


            if ((valCountry != "" && valIpCountry != "" && valAdId != "") &&
                (countries.indexOf(valCountry) > -1 && countries.indexOf(valIpCountry) > -1 && ads.indexOf(valAdId) == -1)) {

                //us content here

            }
            else {
                var BrowserDetect = new BrowserDetection();

                if (BrowserDetect.OS == "Mac") {
                    $("#apple-mac-mobile").modal({
                        closeHTML: "",
                        overlayClose: true,
                        escClose: true
                    });
                }
                
                if (valLanguage == "en" ||
                    valLanguage == "fr" ||
                    valLanguage == "it" ||
                    valLanguage == "de" ||
                    valLanguage == "es" ||
                    valLanguage == "nl"
                    ) {

                    //popup
                    $(function() {
                        $('#TheLordOfTheRingsDiv').show();
                    });

                    //close popup button
                    $("#TheLordOfTheRingsBtnClose").click(function() {
                        $("#TheLordOfTheRingsDiv").hide("slow");
                    });

                }
            }
        }
    }
}

/* tlotr */



//french exclusion
function showMessage(){

}

//french exclusion(the back up of those pages that still use showfr function)
function showfr() {
    
}

/*
 * Browser Detection Code Taken From: Quirksmode.org
 * Very cool... you can access the browser's:
 * BrowserDetect.browser - eg. Chrome
 * BrowserDetect.version - eg. 1.2
 * BrowserDetect.OS      - eg. Windows
 */
function BrowserDetection() {
    var BrowserDetect = {
        init: function() {
            this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
            this.version = this.searchVersion(navigator.userAgent)
			    || this.searchVersion(navigator.appVersion)
			    || "an unknown version";
            this.OS = this.searchString(this.dataOS) || "an unknown OS";
        },
        searchString: function(data) {
            for (var i = 0; i < data.length; i++) {
                var dataString = data[i].string;
                var dataProp = data[i].prop;
                this.versionSearchString = data[i].versionSearch || data[i].identity;
                if (dataString) {
                    if (dataString.indexOf(data[i].subString) != -1)
                        return data[i].identity;
                }
                else if (dataProp)
                    return data[i].identity;
            }
        },
        searchVersion: function(dataString) {
            var index = dataString.indexOf(this.versionSearchString);
            if (index == -1) return;
            return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
        },
        dataBrowser: [
		    {
		        string: navigator.userAgent,
		        subString: "Chrome",
		        identity: "Chrome"
		    },
		    { string: navigator.userAgent,
		        subString: "OmniWeb",
		        versionSearch: "OmniWeb/",
		        identity: "OmniWeb"
		    },
		    {
		        string: navigator.vendor,
		        subString: "Apple",
		        identity: "Safari",
		        versionSearch: "Version"
		    },
		    {
		        prop: window.opera,
		        identity: "Opera"
		    },
		    {
		        string: navigator.vendor,
		        subString: "iCab",
		        identity: "iCab"
		    },
		    {
		        string: navigator.vendor,
		        subString: "KDE",
		        identity: "Konqueror"
		    },
		    {
		        string: navigator.userAgent,
		        subString: "Firefox",
		        identity: "Firefox"
		    },
		    {
		        string: navigator.vendor,
		        subString: "Camino",
		        identity: "Camino"
		    },
		    {		// for newer Netscapes (6+)
		        string: navigator.userAgent,
		        subString: "Netscape",
		        identity: "Netscape"
		    },
		    {
		        string: navigator.userAgent,
		        subString: "MSIE",
		        identity: "Explorer",
		        versionSearch: "MSIE"
		    },
		    {
		        string: navigator.userAgent,
		        subString: "Gecko",
		        identity: "Mozilla",
		        versionSearch: "rv"
		    },
		    { 		// for older Netscapes (4-)
		        string: navigator.userAgent,
		        subString: "Mozilla",
		        identity: "Netscape",
		        versionSearch: "Mozilla"
		    }
	    ],
        dataOS: [
		    {
		        string: navigator.platform,
		        subString: "Win",
		        identity: "Windows"
		    },
		    {
		        string: navigator.platform,
		        subString: "Mac",
		        identity: "Mac"
		    },
		    {
		        string: navigator.userAgent,
		        subString: "iPhone",
		        identity: "iPhone/iPod"
		    },
		    {
		        string: navigator.platform,
		        subString: "Linux",
		        identity: "Linux"
		    }
	    ]

    };
    BrowserDetect.init();
    return BrowserDetect;
}

/* Mobile Localisation start*/
/* ---------------------------------- */

//close popup and reload page
function mobileCloseWindow() {

    $.modal.close();
    window.location.href = window.location.href;
}

//show messages
function mobilePopUpThankYou() {

    $(document).ready(function() {
        $("#mobilePopUpThankYou").modal();
        $("#simplemodal-container a.modalCloseImg").css({ "display": "none" });
    });
}

function mobilePopUpSorry(message) {

    $(document).ready(function() {
        $("#mobilePopUpSorry").modal();
        $("#mobilePopUpSorryMessage").append(message);
        $("#simplemodal-container a.modalCloseImg").css({ "display": "none" });
    });
}

//preselect dropdown game on the popup
function mobileDownloadShowForm(gameID) {

    $(document).ready(function() {

        $("#ctl00_midContentArea_mobile1_ctrMobileConsoleLocalisationPopUp_ddlGameSelect").val(gameID);
        $("#mobileFormContainerPopUpBackground").modal();
        $("#simplemodal-container a.modalCloseImg").css({ "display": "none" });
    });
}

function mobileFaqMenu(showDiv) {

    $(showDiv).toggle();
    var mobileContentHeight = $("#mobile-games-body-copy").height();
    var footerTop = mobileContentHeight + 700;
    $("#footer").css({ "top": footerTop + "px" });
}

//update country code
function CountryCodeUpdaterLocalisation(CountryDDL, CountryCodeTXT) {
    var country = document.getElementById(CountryDDL);
    var countryCode = document.getElementById(CountryCodeTXT);

    countryCode.value = "+" + country.options[country.selectedIndex].value;
}


/* ---------------------------------- */
/* Mobile Localisation end*/


/* Greek Download Message - Start */

function showGreekDownloadMessage() {

    $('#showGreekDownloadMessage').modal({ position: [50, '23%'], opacity: 60, onClose: function(dialog) {
        dialog.data.fadeOut('slow', function() {
            dialog.container.hide('slow', function() {
                dialog.overlay.slideUp('fast', function() {
                    $.modal.close();

                });
            });
        });
    }
    });

    //hide default close button
    $('#simplemodal-container a.modalCloseImg').css({ 'display': 'none' });

    //style window
    $(".simplemodal-wrap").css("width", "678px");

}
/* Greek Download Message - End */


/* Safari Scratch exit - START */

//check for affiliate and adID
function affiliateAdidCheckSafariScratchExit() {

//    var affID = document.getElementById("txtAffiliateID").value;
//    var adID = document.getElementById("txtAdID").value;

//    //add all excluded affiliate IDs and adIDs into one string - first line is affiliate IDs - second line is adIDs
//    var excludedSource = 'aff113486,aff113487,aff113488,aff113489,aff113491,aff113492,aff113493,aff113516,aff113975,aff113977,aff114205,aff114324,aff114521,aff115563,aff115579,aff115580,aff115785,aff115786,aff115852,aff115927,aff116054,aff116102,aff116310,aff116436,aff116936,aff116961,aff117131,aff117132,aff117133,aff117135,aff117136,aff117137,aff117138,aff117139,aff117140,aff117141,aff117142,aff117161,aff117253,aff117255,aff117333,aff117351,aff117376,aff117377,aff117579,aff118721,aff118722,aff118723';
//        excludedSource += ',235805,199242';
//    
//    var source = excludedSource.split(',');
//    for (var i = 0; i < source.length; i++) {
//        var sourceValue = source[i];
//        if (sourceValue == affID || sourceValue == adID)
//            return true;
//    }
    
    return false;
}

function safariScratchExit(language) {

    //only show if the affiliates do no exist
    if (!affiliateAdidCheckSafariScratchExit()) {

        //pages allowed to open
//        switch (language) {
//            case "es":
//                //if a user exits with this adID and language es then the safari exit pop will not pop
//                if (document.getElementById("txtAdID").value == "234812") {
//                    break;
//                }
//            case "de":
//            case "sv":
//            case "no":
//            case "da":
//            case "fi":
//            case "fr":    
//            case "pt":
//            case "nl":
//            case "it":
//            case "el":
//            case "en":
//                
//                window.open("/exit-strat/safari-scratch/index.aspx?ul=" + language, "_blank", "location=0,status=0,scrollbars=0,titlebar=0,fullscreen=0,menubar=0,resizable=0,toolbar=0,width=570,height=570");

//                break; 

//        }

    }

}

/* Safari Scratch exit - END */

/* New Exit Strat - START */
//window.onbeforeunload = function() {
//    var mydomain = getDomain(window.location.href);
//    var elem = document.activeElement;

//    if (elem) {
//        if (elem.tagName == 'A' | elem.tagName == 'SELECT') {
//            if (elem.href && elem.href.indexOf("javascript:") == -1) {

//                var yourdomain = getDomain(elem.href);

//                if (yourdomain != mydomain)
//                    getExitTraffic();
//            }
//        }
//        else {
//            getExitTraffic();
//        }
//    }
//    else {
//        getExitTraffic();
//    }
//}

function GetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
            return getCookieVal(j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return null;
}

var expDays = 365 * 3; // number of days the cookie should last
function SetCookie(name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}

function DeleteCookie(name) {
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval = GetCookie(name);
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var exp = new Date();
exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000));

function amt() {
    var count = GetCookie('mycount')
    if (count == null) {
        SetCookie('mycount', '1')
        return 1
    }
    else {
        var newcount = parseInt(count) + 1;
        DeleteCookie('mycount')
        SetCookie('mycount', newcount, exp)
        return count
    }
}

function getCookieVal(offset) {
    var endstr = document.cookie.indexOf(";", offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
            return getCookieVal(j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return null;
}

//Sart of the main function

function getExitTraffic() {

    var popup = GetCookie('popup');
    if (!popup) {
        SetCookie("popup", "1", exp);
        var languageVal = document.getElementById("txtLanguage").value;
        var ipCountryVal = document.getElementById("txtIPCountry").value;

        if (ipCountryVal != "fr" && ipCountryVal != "us") { // only load if ip not France or USA
            safariScratchExit(languageVal);
        };

        //var exitWindow = window.open('/exit-strategy/index.aspx?ul=en', 'exit', 'width=570,height=570');

    }
}

function getDomain(url) {
    var domain = url.match(/:\/\/(www\.)?([^\/:]+)/);
    if (domain) {
        return domain[2];
    }
    else {
        return '';
    }
}

/* New Exit Strat - END */

/* New PC Mobile Download - Richard Trevor */

function ValidatePCMobileDownload() {
    var mobid = document.getElementById("mobileID").value;
    var sessid = document.getElementById("sessionId").value;
    var secid = document.getElementById("secID").value;

    var mobval = document.getElementById("mobid").value;
    var sessval = document.getElementById("sessid").value;
    var secval = document.getElementById("secid").value;

    alert(mobval + " : " + sessval + " : " + secval);
    return false;
}

