﻿
/***********************************************
* Tab Content script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
//var initialtab=[1, "flights"]
var initialtab_product=[1]

var mymarker = new Array;

var rnd_number=Math.floor(Math.random()*3)+1; //0-2 + 1
//var allcities=["lasvegas", "sanfrancisco", "newyork"]
var allcities=["dallas", "newyork", "lasvegas", "london"]
var initialtab_cities=[rnd_number]
//var initialtab_cities=[1, "lasvegas"]


var previoustab_product=""
var previoustab_cities=""
var citytab_correction=83;

function expandcontent_product(aobject){ //http://localhost:4110/Brian2/Hotels.htm (as this)
    detectSourceindex_product(aobject) //get tabsourceindex_product
    highlighttab_product(aobject)  //set all to off, set aobject to on
    if (previoustab_product!="")
        document.getElementById(previoustab_product).style.display="none"
    document.getElementById(aobject.rel).style.display="block"
    ////document.getElementById("buttontext").value="Search "+cid
    ////if (cid=="Flights") {document.getElementById("buttontext").onclick=search_Flights;}
    previoustab_product=aobject.rel
    if (aobject.blur)
        aobject.blur()
    return false
}

function expandcontent_cities(aobject){  //http://localhost:4110/Brian2/lasvegas.htm (as this)
    //alert("expanding content_cities")
    //alert(cid + ":" + aobject) //lasvegas:http://localhost:4110/Brian2/lasvegas.htm (as this)
    highlighttab_cities(aobject)  //set all to off, set aobject to on
    detectSourceindex_cities(aobject) //provides tabsourceindex_cities
    document.getElementById("city_image_placeholder").style.display="none" //turn off 'loading' city image
    if (previoustab_cities!="")
        document.getElementById(previoustab_cities).style.display="none"    //show image
    document.getElementById(aobject.rel).style.display="block" //show image
    previoustab_cities=aobject.rel

    if (typeof(mygmap)=="object")
        {
        //alert("mygmap is defined")
        putpins(aobject.rel) //if page already loaded, putpins; if first load, wait until mygmap
        }   
    if (aobject.blur)
        aobject.blur()
    //alert(city_tips_array.length);
    //alert(tabsourceindex_cities);
    for (i=0; i<city_tips_array.length; i++)
        {
        //city_tips_array[i].style.display="block";
        document.getElementById(city_tips_array[i].id).style.display="none";
        //alert(city_tips_array[i].id);
        }
    document.getElementById(aobject.rel+"_tip").style.display="block";
    return false
}

function highlighttab_product(aobject){
    tabobjlinks_product[0].className="leftoff"; //first
    for (i=1; i<tabobjlinks_product.length-1; i++) //not first or last
        tabobjlinks_product[i].className="off";
    tabobjlinks_product[tabobjlinks_product.length-1].className="rightoff"; //last
    
    if (tabsourceindex_product==0) {aobject.className="lefton"}
    else if (tabsourceindex_product==tabobjlinks_product.length-1) {aobject.className="righton"}
    else {aobject.className="on"}
}
function highlighttab_cities(aobject){
    for (i=0; i<tabobjlinks_cities.length; i++)
        {
        //alert(tabobjlinks_cities[i].rel)
        tabobjlinks_cities[i].className="off";
        }
    aobject.className="on";
}

function detectSourceindex_product(aobject){
    for (i=0; i<tabobjlinks_product.length; i++){
        if (aobject==tabobjlinks_product[i]){
            tabsourceindex_product=i //source index of tab bar relative to other tabs
            break
            }
        }
}

function detectSourceindex_cities(aobject){
    //alert("detect cities")
    for (i=0; i<tabobjlinks_cities.length; i++){
        if (aobject==tabobjlinks_cities[i]){
            //alert("detect cities found")
            tabsourceindex_cities=i //source index of tab bar relative to other tabs
            break
            }
        }
}

function pageWidth()  {return window.innerWidth   != null? window.innerWidth :  document.documentElement && document.documentElement.clientWidth ?   document.documentElement.clientWidth :  document.body != null ? document.body.clientWidth :  null;}

function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;} 

function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} 

function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} 

function do_onload(){
    firefox = document.getElementById && !document.all;
    //alert("onload")
    //fix for flicker:
    //Response.AddHeader("Cache-Control", "post-check=3600,pre-check=43200");
    //System.Net.HttpListenerResponse.AddHeader("Cache-Control", "post-check=3600,pre-check=43200");
    try {document.execCommand("BackgroundImageCache", false, true);} catch(err) {}


        
    expandcontent_cities(tabobjlinks_cities[initialtab_cities[0]]);  //0-indexed product, needs map to be there

    //alert(document.getElementById("gmap").id)
    
    mygmap = new GMap2(document.getElementById("gmap"));
    mygmap.addControl(new GLargeMapControl());
    mygmap.addControl(new GMapTypeControl());
    baseIcon = new GIcon();
      baseIcon.iconSize=new GSize(32,32);
      baseIcon.shadowSize=new GSize(56,32);
      baseIcon.iconAnchor=new GPoint(16,32);
      baseIcon.infoWindowAnchor=new GPoint(16,0);
    load_markers_v2();
    
    //run putpins if not already
    if (mygmap.getCenter()==null)
        {
        //alert("first load put pins")
        putpins(previoustab_cities)
        }
  
    detectPopupBlocker();
    document.getElementById("checkbox_hotel_load").className="cbox_hidden";
    if (block_override=='y' || (block_override!='y' && block_override!='n' && popups=="blocked"))
        {document.getElementById("checkbox_air_blocked").className="cbox";
        document.getElementById("checkbox_hotel_blocked").className="cbox";
        document.getElementById("checkbox_car_blocked").className="cbox";
        document.getElementById("btnFlights").className="buttontext_hidden";
        document.getElementById("btnHotels").className="buttontext_hidden";
        document.getElementById("btnCars").className="buttontext_hidden";
        }
    else
        {document.getElementById("checkbox_air").className="cbox";
        document.getElementById("checkbox_hotel").className="cbox";
        document.getElementById("checkbox_car").className="cbox";
        //alert(document.getElementById("checkbox_car").style.width + ":" + document.getElementById("checkbox_car").style.height)
        }
    //alert(document.getElementById("checkbox_hotel_blocked").style.width)
    /*
    var cookiename_product=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent_product" : window.location.pathname
    var cookiecheck_product=window.get_cookie && get_cookie(cookiename_product).indexOf("|")!=-1
    tabobjlinks_product=document.getElementById("tablist_product").getElementsByTagName("A")
    //alert(typeof enablepersistence + ":" + enablepersistence + ":" + cookiecheck_product)  //boolean, true, false
    if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck_product){
        var cookieparse_product=get_cookie(cookiename_product).split("|")
        var whichtab=cookieparse_product[0]
        var tabcontentid_product=cookieparse_product[1]
        //alert("cookie product")
        expandcontent_product(tabcontentid_product, tabobjlinks_product[whichtab])
        }
    else
        {
        expandcontent_product(initialtab_product[1], tabobjlinks_product[initialtab_product[0]-1])
        //alert("nocookie product")
        }
    var cookiename_cities=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent_cities" : window.location.pathname
    var cookiecheck_cities=window.get_cookie && get_cookie(cookiename_cities).indexOf("|")!=-1
    tabobjlinks_cities=document.getElementById("tablist_cities").getElementsByTagName("A");
    city_tips_array=document.getElementById("city_tips_div").getElementsByTagName("div");

    if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck_cities){
        var cookieparse_cities=get_cookie(cookiename_cities).split("|")
        var whichtab=cookieparse_cities[0]
        var tabcontentid_cities=cookieparse_cities[1]
        //alert("cookie load:expandcontent_cities("+tabcontentid_cities+","+tabobjlinks_cities[whichtab]+")")
        expandcontent_cities(tabcontentid_cities, tabobjlinks_cities[whichtab])  //reload: lasvegas,http://path/lasvegas.htm
        }
    else
        {
        //alert("nocookie load:expandcontent_cities("+initialtab_cities[1]+","+tabobjlinks_cities[initialtab_cities[0]-1]+")")
        expandcontent_cities(initialtab_cities[1], tabobjlinks_cities[initialtab_cities[0]-1]) //fresh: lasvegas, http://path/lasvegas.htm
        }
    */
	
	// Initializing the date picker object:
	start_today=new Date();
	A_fDP = new FDP(start_today,"A","start");
	H_fDP = new FDP(start_today,"H","start");
	C_fDP = new FDP(start_today,"C","start"); 
    
	document.getElementById('calendarContainerleave').appendChild(A_fDP.calendar())
	document.getElementById('calendarContainercheckin').appendChild(H_fDP.calendar())
	document.getElementById('calendarContainerpickup').appendChild(C_fDP.calendar())

    
    
    //load up other tabs:
    //var divDeals = document.getElementById("Deals");
    //divDeals.innerHTML = "<div style='float:left; width: 234px; border: solid 0px; margin-left: 1px'><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10486853' target='_blank'> <img src='http://www.lduhtrp.net/image-2414186-10486853' width='234' height='60' alt='Book tours & activities for your next trip.' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.anrdoezrs.net/click-2414186-9785897' target='_blank'> <img src='http://www.lduhtrp.net/image-2414186-9785897' width='234' height='60' alt='The New York Pass' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-6925785' target='_blank'> <img src='http://www.lduhtrp.net/image-2414186-6925785' width='234' height='60' alt='Get FREE entry to over 55 top London attractions!' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.jdoqocy.com/click-2414186-10405861' target='_blank'> <img src='http://www.ftjcfx.com/image-2414186-10405861' width='234' height='60' alt='' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.kqzyfj.com/click-2414186-10276295' target='_blank'> <img src='http://www.ftjcfx.com/image-2414186-10276295' width='234' height='60' alt='Getaway Specials from Marriott.' border='0'/></a></div></div><div style='float:right; width: 120px; border: solid 0px; margin-right: 1px'><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10428577' target='_blank'> <img src='http://www.tqlkg.com/image-2414186-10428577' width='120' height='60' alt='Site59 Last-Minute Weekend Getaways' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10420056' target='_blank'> <img src='http://www.tqlkg.com/image-2414186-10420056' width='120' height='60' alt='Railpass' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10400236' target='_blank'> <img src='http://www.tqlkg.com/image-2414186-10400236' width='120' height='60' alt='Travel Guard Insurance' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10406494' target='_blank'> <img src='http://www.ftjcfx.com/image-2414186-10406494' width='120' height='60' alt='120x60 Westin' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10486519' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10486519' width='120' height='60' alt='See Paris For Free - Buy Paris Pass Now' border='0'/></a></div></div><div style='clear: both; margin: 0px auto; text-align: center; padding-bottom: 5px'><script src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=100094.4291&catid=4&gridnum=0&type=14&subid=0' target='new'></script><noscript><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=100094&type=4&subid='><img src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=100094&subid=&type=4&gridnum=0'></a></noscript></div>";
    
    var divVacations = document.getElementById("Vacations");
    var divActivities = document.getElementById("Activities");
    //---------------------------------------
    //orig local:
    //divVacations.innerHTML = "<div style='float:left; width: 234px; border: solid 0px red; margin-left: 1px;'><div style='padding-bottom: 10px'><a href='http://www.anrdoezrs.net/click-2414186-10397665' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10397665' width='234' height='60' alt='Hotels, Car Hire, Sightseeing and Transfers' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10460810' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10460810' width='234' height='60' alt='Spirit Vacations' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10421700' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10421700' width='234' height='60' alt='no one deals like we do!' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=136622.10000448&subid=0&type=4' target='new'><IMG border='0'   alt='Orbitz- Keeping You A Step Ahead! 234x60' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=136622.10000448&subid=0&type=4&gridnum=3'></a></div><div style='padding-bottom: 10px'><a href='http://www.kqzyfj.com/click-2414186-10276696' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10276696' width='234' height='60' alt='Marriott Romance Packages' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10519600' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10519600' width='234' height='60' alt='' border='0'/></a></div><div style='padding-bottom: 0px'><a href='http://www.anrdoezrs.net/click-2414186-10405861' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10405861' width='234' height='60' alt='' border='0'/></a></div></div>"
    //divVacations.innerHTML = divVacations.innerHTML + "<div style='float:right; width: 120px; border: solid 0px green; margin-right: 1px;'><div style='padding-bottom: 10px'><a href='http://www.anrdoezrs.net/click-2414186-10514559' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10514559' width='120' height='60' alt='Lastminute.com' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10544335' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10544335' width='120' height='60' alt='Expedia.com' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=120349.10000292&subid=0&type=4' target='new' ><IMG border='0'   alt='Hotwire ' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=120349.10000292&subid=0&type=4&gridnum=6'></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10395469' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10395469' width='120' height='60' alt='' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=130340.10000335&subid=0&type=4' target='new' ><IMG border='0'   alt='Vacations Under $500 (120x60)' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=130340.10000335&subid=0&type=4&gridnum=6'></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10432151' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10432151' width='120' height='60' alt='Comfort Inn' border='0'/></a></div><div style='padding-bottom: 0px'><a href='http://www.jdoqocy.com/click-2414186-10406948' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10406948' width='120' height='60' alt='120x60 Westin Banner' border='0'/></a></div></div>"
    //divVacations.innerHTML = divVacations.innerHTML + "<div style='border: solid 1px #DDDDDD; clear: both; margin: 0 auto; text-align: center; padding-bottom: 0px;'></div>";
    
    //new local:
    //divVacations.innerHTML = "<div style='float:left; width: 234px; border: solid 0px red; margin-left: 1px;'><div style='padding-bottom: 10px'>XXX</div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10460810' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10460810' width='234' height='60' alt='Spirit Vacations' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10421700' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10421700' width='234' height='60' alt='no one deals like we do!' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=136622.10000448&subid=0&type=4' target='new'><IMG border='0'   alt='Orbitz- Keeping You A Step Ahead! 234x60' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=136622.10000448&subid=0&type=4&gridnum=3'></a></div><div style='padding-bottom: 10px'><a href='http://www.kqzyfj.com/click-2414186-10276696' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10276696' width='234' height='60' alt='Marriott Romance Packages' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10519600' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10519600' width='234' height='60' alt='' border='0'/></a></div><div style='padding-bottom: 0px'><a href='http://www.anrdoezrs.net/click-2414186-10405861' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10405861' width='234' height='60' alt='' border='0'/></a></div></div>"
    //divVacations.innerHTML = divVacations.innerHTML + "<div style='float:right; width: 120px; border: solid 0px green; margin-right: 1px;'><div style='padding-bottom: 10px'><a href='http://www.anrdoezrs.net/click-2414186-10514559' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10514559' width='120' height='60' alt='Lastminute.com' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10544335' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10544335' width='120' height='60' alt='Expedia.com' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=120349.10000292&subid=0&type=4' target='new' ><IMG border='0'   alt='Hotwire ' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=120349.10000292&subid=0&type=4&gridnum=6'></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10395469' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10395469' width='120' height='60' alt='' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=130340.10000335&subid=0&type=4' target='new' ><IMG border='0'   alt='Vacations Under $500 (120x60)' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=130340.10000335&subid=0&type=4&gridnum=6'></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10432151' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10432151' width='120' height='60' alt='Comfort Inn' border='0'/></a></div><div style='padding-bottom: 0px'><a href='http://www.jdoqocy.com/click-2414186-10406948' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10406948' width='120' height='60' alt='120x60 Westin Banner' border='0'/></a></div></div>"
    //divVacations.innerHTML = divVacations.innerHTML + "<div style='border: solid 1px #DDDDDD; clear: both; margin: 0 auto; text-align: center; padding-bottom: 0px;'></div>";
    
    
    //site orig- just a left column:
    //divVacations.innerHTML = "<div style='float:left; width: 234px; border: solid 0px red; margin-left: 1px;'><div style='padding-bottom: 10px'><a href='http://www.anrdoezrs.net/click-2414186-10397665' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10397665' width='234' height='60' alt='Hotels, Car Hire, Sightseeing and Transfers' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10460810' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10460810' width='234' height='60' alt='Spirit Vacations' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.tkqlhce.com/click-2414186-10421700' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10421700' width='234' height='60' alt='no one deals like we do!' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://click.linksynergy.com/fs-bin/click?id=WzYABhJPpAQ&offerid=136622.10000448&subid=0&type=4' target='new'><IMG border='0'   alt='Orbitz- Keeping You A Step Ahead! 234x60' src='http://ad.linksynergy.com/fs-bin/show?id=WzYABhJPpAQ&bids=136622.10000448&subid=0&type=4&gridnum=3'></a></div><div style='padding-bottom: 10px'><a href='http://www.kqzyfj.com/click-2414186-10276696' target='_blank'><img src='http://www.tqlkg.com/image-2414186-10276696' width='234' height='60' alt='Marriott Romance Packages' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.dpbolvw.net/click-2414186-10519600' target='_blank'><img src='http://www.lduhtrp.net/image-2414186-10519600' width='234' height='60' alt='' border='0'/></a></div><div style='padding-bottom: 0px'><a href='http://www.anrdoezrs.net/click-2414186-10405861' target='_blank'><img src='http://www.awltovhc.com/image-2414186-10405861' width='234' height='60' alt='' border='0'/></a></div></div>"
    //divVacations.innerHTML = "hello"
    //-----------------------------------------
    
    //divActivities.innerHTML = "<div style='float:left; width: 160px; border: solid 1px yellow; margin-left:15px; margin-right:10px'><!--#include file='viator_activity.html'--></div>"
    //divActivities.innerHTML = "<div style='float:left; width: 160px; border: solid 1px yellow; margin-left:15px; margin-right:10px'>"+escape("<!--#include file='viator_activity.html'-->")+"</div>" //writes escaped text
    //divActivities.innerHTML = "<div style='float:left; width: 160px; border: solid 1px yellow; margin-left:15px; margin-right:10px'>\<\!\-\-\#include file='viator_activity.html'\-\-\></div>" //writes nothing
    //divActivities.innerHTML = "<div style='float:left; width: 160px; border: solid 1px yellow; margin-left:15px; margin-right:10px'>"+ <![CDATA[<!--#include file='viator_activity.html'-->]]> +"</div>"
    //divActivities.innerHTML = "<div style='float:left; width: 160px; border: solid 1px yellow; margin-left:15px; margin-right:10px'>" + "<" + "!" + "--" + "#" + "include file=" + "'viator_activity.html'" + "--" + ">" + "</div>"
    //myjack="<div style='float:left; width: 160px; border: solid 1px yellow; margin-left:15px; margin-right:10px'>" + "<" + "!" + "--" + "#" + "include file=" + "'viator_activity.html'" + "--" + ">" + "</div>"
    //alert(myjack)
    
    //divActivities.innerHTML = "<div style='float:left; width: 160px; border: solid 0px yellow; margin-left:15px; margin-right:10px'>" + inc_htmlinclude_js + "</div>";
    //divActivities.innerHTML = divActivities.innerHTML + "<div style='float:right; width: 120px; border: solid 0px red; margin-right:15px; margin-left:10px'><div style='padding-bottom: 10px'><a href='http://www.jdoqocy.com/click-2414186-10498438' target='_blank'> <img src='http://www.awltovhc.com/image-2414186-10498438' width='125' height='125' alt='' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.kqzyfj.com/click-2414186-543969' target='_blank'> <img src='http://www.lduhtrp.net/image-2414186-543969' width='125' height='125' alt='Get in FREE to over 50 top London attractions!' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.jdoqocy.com/click-2414186-10486522' target='_blank'> <img src='http://www.tqlkg.com/image-2414186-10486522' width='125' height='125' alt='Sightseeing In Paris? See 60+ Sights -Paris Pass' border='0'/></a></div><div style='padding-bottom: 10px'><a href='http://www.kqzyfj.com/click-2414186-10420056' target='_blank'> <img src='http://www.tqlkg.com/image-2414186-10420056' width='120' height='60' alt='Railpass' border='0'/></a></div><div style='padding-bottom: 0px'><a href='http://www.anrdoezrs.net/click-2414186-10400236' target='_blank'> <img src='http://www.lduhtrp.net/image-2414186-10400236' width='120' height='60' alt='Travel Guard Insurance' border='0'/></a></div></div>"
    //divActivities.innerHTML = divActivities.innerHTML + "<div style='clear: both; margin: 0 auto; text-align: center; padding-bottom: 0px;'></div>"
    
    //alert(inc_htmlinclude_js)
    //var fileref=document.createElement("script")
    //fileref.setAttribute("type","text/javascript");
	//fileref.setAttribute("src", "viator.js");
    //divActivities.appendChild(fileref)

} //end onload

var popups="";
function detectPopupBlocker() {
	var test = window.open(null,"","width=1,height=1, top=800, left=800, scrollbars=no'");
	try {test.close(); popups="notblocked";}
	catch (e) {popups="blocked";}
}

if (window.addEventListener)
    window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
    window.attachEvent("onload", do_onload)
else if (document.getElementById)
    window.onload=do_onload

////Dynamicdrive.com persistence feature add-on

var enablepersistence=true //true to enable persistence, false to turn off (or simply remove this entire script block).
var persisttype="sitewide" //enter "sitewide" for Tab content order to persist across site, "local" for this page only

function get_cookie2(Name) { //name in nameval1|val2!nameval1|val2!
var search = Name // + "="
var returnvalue = "";
if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)  //position of n in name
    if (offset != -1) { 
        offset += search.length //offset is position of v in val1|val2
        //end = document.cookie.indexOf(";", offset);
        end = document.cookie.indexOf("zzz", offset); //end=length of val1|val2
        if (end == -1) end = document.cookie.length;
        returnvalue=unescape(document.cookie.substring(offset, end))
        //returnvalue=unescape(document.cookie.substring(offset, end))
    }
}
//alert("getcookie: "+ Name + ":" +returnvalue)
return returnvalue;
}

function get_cookie(Name) { //stock function
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function savetabstate(){
//var cookiename_product=(persisttype=="sitewide")? "tabcontent_product" : window.location.pathname 
//var cookievalue_product=(persisttype=="sitewide")? tabsourceindex_product+"|"+previoustab_product+";path=/" : tabsourceindex_product+"|"+previoustab_product
//var cookiename_cities=(persisttype=="sitewide")? "tabcontent_cities" : window.location.pathname 
//var cookievalue_cities=(persisttype=="sitewide")? tabsourceindex_cities+"|"+previoustab_cities+";path=/" : tabsourceindex_cities+"|"+previoustab_cities
var cookiename_product="tabcontent_product"
var cookiename_cities="tabcontent_cities"
var cookievalue_product=tabsourceindex_product+"|"+previoustab_product
var cookievalue_cities=tabsourceindex_cities+"|"+previoustab_cities
//alert(cookiename_product+cookievalue_product+"!"+cookiename_cities+cookievalue_cities+"!=abc;")
//document.cookie=cookiename_product+cookievalue_product+"zzz"+cookiename_cities+cookievalue_cities+"zzz=abc;"
//alert("savetabstate:" + document.cookie) //path/htmlpage.htm=0|flights
//alert("Cookies: "+document.cookie)
document.cookie=cookiename_product+"="+cookievalue_product
document.cookie=cookiename_cities+"="+cookievalue_cities
}

window.onunload=savetabstate

///hover calendars:
function getObject( obj ) {
  if ( document.getElementById ) {
    obj = document.getElementById( obj );
  } else if ( document.all ) {
    obj = document.all.item( obj );
  } else {
    obj = null;
  }
  return obj;
  }
function moveObject( obj, e ) { //moveObject('calendarContainerreturn', event)
  var tempX = 0;
  var tempY = 0;
  var offsetY = -75;
  var offsetX = -50;
  var objHolder = obj;
  obj = getObject( obj );
  if (obj==null) return;

  if (document.all) {
    //IE6
    //alert(ref_field);
    //alert(document.getElementById(ref_field).style.left);
    //alert(document.getElementById(ref_field).style.top);
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {
    tempX = e.pageX;
    tempY = e.pageY;
  }

  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}
  obj.style.top  = (tempY + offsetY) + 'px';
  obj.style.left = (tempX + offsetX) + 'px';
  show_hide(objHolder);
  //obj.style.display='block';
  //swapstyle(document.getElementById(objHolder));
}
  
function show_hide(id, show) {
        if (el = document.getElementById(id)) {
                //alert("2")
                if (null==show) show = el.style.display=='none'; //show is true if obj is none
                //alert(show ? 'block' : 'none');  //block when turning on, 'none' when turning off
                el.style.display = (show ? 'block' : 'none');  //works also with (show ? '' : 'none')
                
        }
}

function loadXMLDoc(dname)
{
var xmlDoc;
if (window.XMLHttpRequest)
  {
  xmlDoc=new window.XMLHttpRequest();
  xmlDoc.open("GET",dname,false);
  xmlDoc.send("");
  return xmlDoc.responseXML;
  }
// IE 5 and IE 6
else if (ActiveXObject("Microsoft.XMLDOM"))
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async=false;
  xmlDoc.load(dname);
  return xmlDoc;
  }
alert("Error loading document");
return null;
}

function load_markers_v2() {
  xmlDoc=loadXMLDoc("poi.xml");
  
      var mycities = xmlDoc.documentElement.getElementsByTagName("city");
      for (var i = 0; i < mycities.length; i++) {
      	var myitems = mycities[i].getElementsByTagName("item");

      	array_item = new Array;
      	for (var j = 0; j < myitems.length; j++) {      		
      	  	array_attrib = new Array;
      	  	for (var k = 0; k < myitems[j].attributes.length; k++) {
      	  	  	array_attrib.push(myitems[j].attributes.item(k).value);
      	  	}
      	  	array_item.push(array_attrib);
      	}
      	mymarker[mycities[i].getAttribute("name")] = array_item;
      }            
}

function load_markers_v3() { //async, doesn't work as putpins runs before this is done
  var request = GXmlHttp.create();
  request.open("GET", "poi.xml", true);
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      var xmlDoc = request.responseXML; //new
      var mycities = xmlDoc.documentElement.getElementsByTagName("city");
      for (var i = 0; i < mycities.length; i++) {
      	var myitems = mycities[i].getElementsByTagName("item");

      	array_item = new Array;
      	for (var j = 0; j < myitems.length; j++) {      		
      	  	array_attrib = new Array;
      	  	for (var k = 0; k < myitems[j].attributes.length; k++) {
      	  	  	array_attrib.push(myitems[j].attributes.item(k).value);
      	  	}
      	  	array_item.push(array_attrib);
      	}
      	mymarker[mycities[i].getAttribute("name")] = array_item;
      }            
    } //end if state=4
  } //end onready func
  request.send(null);
}


//mymarker = new Array (10) ///cities



function createMarker(point, html, icon) { //html= image, name, addr+desc; myname= name, addr+desc
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
        return marker;
    }

function putpins(city) {
    //alert("starting putpins: " + city);
    mygmap.clearOverlays();
    mygmap.setCenter(new GLatLng(mymarker[city][0][0], mymarker[city][0][1]), 8);
    var bounds = new GLatLngBounds();
    
    for (i=0; i<mymarker[city].length; i++) {
        var lat = mymarker[city][i][0];
        var lng = mymarker[city][i][1];
        var point = new GLatLng(lat,lng);
        //200x150, 10px Verdana
        var myimage = ((mymarker[city][i][4]=="")? "" : "<img src='"+mymarker[city][i][4]+"' width='200' height='150'/><br/>")
        //alert(mymarker[city][i][4].toString());
        //var myimage = "<img src='" + mymarker[city][i][4] + "' width='200' height='150'/><br/>"
        var html = myimage + "<div style='font: 10px Verdana; width:220px'> <b>"+mymarker[city][i][6]+"</b> <br/> "+mymarker[city][i][7] + "</div>";
        var tinyIcon = new GIcon();
        tinyIcon.image =  "http://maps.google.com/mapfiles/kml/"+mymarker[city][i][2]+"/"+mymarker[city][i][3]+".png";
	    tinyIcon.shadow = "http://maps.google.com/mapfiles/kml/"+mymarker[city][i][2]+"/"+mymarker[city][i][3]+"s.png";
	    tinyIcon.iconSize = new GSize(32,32); //new GSize(12, 20);
	    tinyIcon.shadowSize = new GSize(56,32); //new GSize(22, 20);
	    tinyIcon.iconAnchor = new GPoint(16,32); //new GPoint(6, 20);
	    tinyIcon.infoWindowAnchor = new GPoint(16,0); //new GPoint(5, 1);
        markerOptions= new Array;
            markerOptions["icon"]=tinyIcon;
            markerOptions["title"]=mymarker[city][i][5];
        
        var marker = createMarker(point, html, markerOptions);
        mygmap.addOverlay(marker);
        bounds.extend(point);
        }

    mygmap.setZoom(mygmap.getBoundsZoomLevel(bounds));
    mygmap.setCenter(bounds.getCenter());
    //alert(mygmap.getCenter())
    }



function submitEmail()
{
//alert("submitEmail start");
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    //alert("state: " + xmlHttp.readyState)
    if(xmlHttp.readyState!=4)
        {
        document.getElementById("submit_button").disabled=true
        }
    if(xmlHttp.readyState==4)
      {
      document.getElementById("submit_button").disabled=false
      //document.frmSubmitEmail.email_response.value=xmlHttp.responseText;
      //document.getElementById("email_response").innerHTML=xmlHttp.responseText;
      alert(xmlHttp.responseText); //need this!
      //Tha, You
      if (xmlHttp.responseText.substr(0,3)=="Tha" || xmlHttp.responseText.substr(0,3)=="You")
        document.getElementById("email_address").value="";
      }
    }
  var url = "submit_email.php"
  url = url + "?q=" + document.getElementById("email_address").value;
  //alert(url)
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

