﻿// JScript File

//  Functions for citybreaks page

function Openmap(windowurl) {

    var oWindow = window.radopen(windowurl, "UserListDialogforcitybrk");

    return false;
}

function openMoreImages(windowurl) {

    var oWindow = window.radopen(windowurl, "hotelimages");
    return false;
}

function toggleMe(a) {

    var e = document.getElementById(a);

    if (!e) return true;

    if (e.style.display == "none") {

        e.style.display = "block"

    } else {

        e.style.display = "none"

    }

    return false;

}

//Fuctions for countryinormation page

function ShowVideo(windowurl) {


    var oWindow = window.open(windowurl, "Videoplayer", "width=450,height=450,toolbar=no");
    return false;
}

function ShowMapForCountryInformation(windowurl,hrefid) {

$get(hrefid).target  = windowurl;
    mywindow = window.open(windowurl, "mywindow", "location=1,menubar=0,resizable=1,width=780,height=585");
    mywindow.moveTo(50, 50);

    return false;
}

function ShowTMFlow() {
    var oWindow;
    oWindow = window.radopen("TrunkHowItWorks.aspx", "TMDetails");
    oWindow.SetTitle("My Trunk - How it works");
    return false;
}

function CloseWindow(WindowName) {

    var oManager = GetRadWindowManager();
    var oWindow = oManager.GetWindowByName(WindowName);
    param_value = '';
    if (oWindow != null) {
        oWindow.Close();
    }
}

function ShowTMFlowForCountry() {

    var oWindow;
    oWindow = window.radopen("TrunkHowItWorks.aspx", "TMDetails");
    oWindow.SetTitle("My Trunk - How it works");    

    return false;
}

function CloseWindowForCountry(WindowName) {            


    var oManager = GetRadWindowManager();
    var oWindow = oManager.GetWindowByName(WindowName);
    param_value = '';
    if (oWindow != null) {
        oWindow.Close();
    }
}

function SetBigText(Id1, Id2, Id3, Id4, value) {
    if (value == 'true') {
        document.getElementById(Id2).style.display = 'block';
        document.getElementById(Id3).style.display = 'none';
        //document.getElementById(Id4).style.display='block';
    }
    if (value == 'false') {
        document.getElementById(Id2).style.display = 'none';
        document.getElementById(Id3).style.display = 'block';
        document.getElementById(Id4).style.display = 'none';
    }
}

function Changearrowcolourtored(Id5) {
    document.getElementById(Id5).src = 'Images/arrow_hover.gif';
}

function Changearrowcolourtoblue(Id5) {
    document.getElementById(Id5).src = 'Images/arrow.gif';
}

//Function for tailormade tour detail(not in use now u have to add radwindow manager on master page)

//


// Function for tailormade-citydetails page

function ShowDetailsForTailormadeCityDetails(windowurl,btnClientId) {
btnId=btnClientId;
    var oWindow = window.radopen(windowurl, "UserListDialog");
    oWindow.RestoreRect = null;
    oWindow.SetTitle("Hotel Details");
    return false;
}

function ShowExcursionDetails(windowurl) {

btnId=btnClientId;
    var oWindow = window.radopen(windowurl, "ExcursionListDialog");
    oWindow.RestoreRect = null;
    oWindow.SetTitle("Excursion Details");
    return false;
}

function ShowMapTailormadeCityDetails(windowurl) {
    mywindow = window.open(windowurl, "mywindow", "location=1,menubar=0,resizable=1,width=780,height=585");
    mywindow.moveTo(50, 50);
    return false;
}

function ShowGoogleMap(windowurl,hrefid) {

    var oWindow = window.radopen(windowurl, "gmapwin");
    oWindow.RestoreRect = null;
    oWindow.SetTitle("Tour map");
    return false;
//    $get(hrefid).target  = windowurl;
//    mywindow = window.open(windowurl, "gmapwin");
//    mywindow.moveTo(50, 50);

//    return false;
}

function ShowFacts(windowurl,hrefid) {

    var oWindow = window.radopen(windowurl, "factswin");
    oWindow.RestoreRect = null;
    oWindow.SetTitle("Facts & When to go");
    return false;
}

function ShowTestimonials(windowurl,absoluteurl) {

var id = $get(windowurl)
//$get(windowurl).target = "clienttestimonials.aspx?tourcode=" + TourCode + " "
$get(windowurl).target  = absoluteurl;
    var oWindow = window.radopen(absoluteurl, "UserListDialogforclienttestimonials");
    oWindow.SetTitle("Welcome to Cox and Kings - What our clients say");
    return false;
}

//function ShowTestimonials(TourCode) {
//    //debugger;
//    var oWindow = window.radopen("clienttestimonials.aspx?tourcode=" + TourCode, "RadWindow1");
//    oWindow.SetTitle("Welcome to Cox and Kings - What our clients say");
//    return false;
//}

function Showinformationtxt(windowurl) {
//To do
    var oWindow;
    oWindow = window.radopen("Onlinebookinghowto.aspx?statusCode=" + statusCode + "&brCode=" + brCode + "&depdt=" + depdt, "TMDetails");
    oWindow.SetTitle("Online booking information");
    return false;
}

// for suitcase page

function RegUser(windowurl,lbtnSendCnKClientID) {

    oWindow = window.radopen(windowurl, "RegistrationForm");
    oWindow.SetTitle("Registration Form");
    return false;
}
