
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
sPage = sPage.toUpperCase();
//alert(sPage); //ZANEGREY

if (sPage == 'ZANEGREYPAGES-2-CONTACTUS.ASPX') //Contact Us //ZANEGREYCONTACTUS.ASPX
{
    document.getElementById('tdheader').className = 'contactusbg';
    document.getElementById('imgcontact').src = "images/contactusm_hover.jpg";

    document.getElementById('acontact').style.color = "#173081";
    document.getElementById('acontact').style.cursor = "text";
    document.getElementById('acontact').style.textDecoration = 'none';

    document.getElementById('divrightpanel').style.display = 'block';  
    document.getElementById('divcontact').style.display = 'none';
    document.getElementById('contactreserv2').style.display = 'block';
    document.getElementById('contactreserv1').style.display = 'none';
}
else if (sPage == 'ZANEGREYPAGES-1-ABOUTUS.ASPX') // About Us //ZANEGREYABOUTUS.ASPX
{
    document.getElementById('tdheader').className = 'aboutusbg';
    document.getElementById('imgaboutus').src = "images/aboutus_hover.jpg";

    document.getElementById('aaboutus').style.color = "#173081";
    document.getElementById('aaboutus').style.cursor = "text";
    document.getElementById('aaboutus').style.textDecoration = 'none';
}
else if (sPage == 'ZANEGREYROOMRATES.ASPX') // Rom Rate
{
    document.getElementById('tdheader').className = 'roomsratesbg';
    document.getElementById('imgrate').src = "images/roomsrates_hover.jpg";

    document.getElementById('anrates').style.color = "#173081";
    document.getElementById('anrates').style.cursor = "text";
    document.getElementById('anrates').style.textDecoration = 'none';
}
else if (sPage == 'ZANEGREYPAGES-3-SERVICES.ASPX') // services ZANEGREYSERVICES.ASPX
{
    document.getElementById('tdheader').className = 'servicebg';
    document.getElementById('imgservice').src = "images/services_hover.jpg";

    document.getElementById('aservices').style.color = "#173081";
    document.getElementById('aservices').style.cursor = "text";
    document.getElementById('aservices').style.textDecoration = 'none';
}
else if (sPage == 'ZANEGREYPAGES-4-ISLANDACTIVITIES.ASPX') // activities
{
    document.getElementById('tdheader').className = 'activities-bg';
    document.getElementById('imgactivities').src = "images/islandactivities_hover.jpg";

    document.getElementById('aActivities').style.color = "#173081";
    document.getElementById('aActivities').style.cursor = "text";
    document.getElementById('aActivities').style.textDecoration = 'none';
}
else if (sPage == 'ZANEGREYRESERVATION.ASPX' || sPage == 'ZANEGREYRESERVATIONSTEP3.ASPX' || sPage == 'ZANEGREYCONFIRMATION.ASPX') // activities ZaneGreyReservation.aspx
{
    document.getElementById('tdheader').className = 'reservation-bg';
    document.getElementById('divrightpanel').style.display = 'none';  
}
else if (sPage == 'EZPINCHECKOUT.ASPX' || sPage == 'EZPINPAYMENT.ASPX' || sPage == 'EZPINTHANKYOU.ASPX') // user login
{
    //document.getElementById('tdheader').className = 'header_order';
}
else {
    //alert('EZPINFEATURES');  // Features
}


function echeck(str) {
    var at = "@"
    var dot = "."
    var lat = str.indexOf(at)
    var lstr = str.length
    var ldot = str.indexOf(dot)
    if (str.indexOf(at) == -1) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        //alert("Invalid E-mail ID")
        return false
    }
    if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        return false
    }
    if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        return false
    }
    if (str.indexOf(at, (lat + 1)) != -1) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        return false
    }
    if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        return false
    }
    if (str.indexOf(dot, (lat + 2)) == -1) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        return false
    }
    if (str.indexOf(" ") != -1) {
        alert("Please enter a valid e-mail address.Some characters like @ or . was found to be missing");
        return false
    }
    return true
}

