<!--
function isIE(){ //ie? 
   if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
    return true; 
   else 
    return false; 
}

if(!isIE()){   //firefox   browser 
    HTMLElement.prototype.__defineGetter__(     "innerText", 
    function(){
     var anyString = "";
     var childS = this.childNodes;
     for(var i=0; i<childS.length; i++) {
      if(childS[i].nodeType==1)
       anyString += childS[i].tagName=="BR" ? '\n' : childS[i].innerText;
      else if(childS[i].nodeType==3)
       anyString += childS[i].nodeValue;
     }
     return anyString;
    } 
   ); 
   HTMLElement.prototype.__defineSetter__(     "innerText", 
    function(sText){ 
     this.textContent=sText; 
    } 
   ); 
} 

function InfoWindow_Open(theURL, winName) 
{ 
	window.open(theURL,winName,"height=700, width=770, top=0, left=240,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no");
}
function InfoWindow_OpenMax(theURL, winName) 
{ 
	var owin=window.open(theURL,winName,"top=0, left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no");
	owin.moveTo(0,0)
	owin.resizeTo(screen.availWidth,screen.availHeight);
}
function GoToPage(alertmsg, url)
{
    if( alertmsg == 1 )
    {
        if( confirm("Are you sure to give up current order?") )
        {
            document.location = url;
        }
    }
    else
    {
        document.location = url;
    }
}
function GoFormDownloadPage(alertmsg)
{
    var url = "FormDownload.html";
    if( alertmsg == 1 )
    {
        if( confirm("Are you sure to give up current order?") )
        {
            document.location = url;
        }
    }
    else
    {
        document.location = url;
    }
}
function GoTestimonialsPage(alertmsg)
{
    var url = "Testimonials.html";
    if( alertmsg == 1 )
    {
        if( confirm("Are you sure to give up current order?") )
        {
            document.location = url;
        }
    }
    else
    {
        document.location = url;
    }
}
function GoContactPage(alertmsg)
{
    var url = "Contact.html";
    if( alertmsg == 1 )
    {
        if( confirm("Are you sure to give up current order?") )
        {
            document.location = url;
        }
    }
    else
    {
        document.location = url;
    }
}
function HidRow(pic)
{
    var rows = new Array("Sightseeing", "RelatedCity", "TourItinerary", "IncludedFeatures", "NotIncludedFeatures", "DepartureDates", "TourFare", "AirfareAddOn", "VisaInformation", "OtherInformation");
    for( var i = 0; i < rows.length; i++ )
    {
        if( i == 0 && pic == "" )
        {
            //document.getElementById("tr" + rows[i] + "1").style.display = "none";
            //document.getElementById("tr" + rows[i] + "2").style.display = "none";
        }
        if( i != 0 )
        {
            if( document.getElementById("lb" + rows[i]).innerText == "" )
            {
                document.getElementById("tr" + rows[i] + "1").style.display = "none";
                document.getElementById("tr" + rows[i] + "2").style.display = "none";
            }
        }
    }
}

function DrawImage(ImgD,maxSize)
{
      var image=new Image();
      image.src=ImgD.src; 
      if(image.width>0  &&  image.height>0)
      { 
          if(image.width/image.height>=1)
          {
             if(image.width>maxSize)
             {
                 ImgD.width=maxSize;
                 ImgD.height=(image.height*maxSize)/image.width;
             }
             else
             {
                 ImgD.width=image.width;
                 ImgD.height=image.height;
             } 
          }
          else
          {
             if(image.height>maxSize)
             {
                ImgD.height=maxSize;
                ImgD.width=(image.width*maxSize)/image.height;
             }
             else
             {
                ImgD.width=image.width;
                ImgD.height=image.height; 
             }
          }
     }
}
function ShowRelatedCity(cityid)
{
    InfoWindow_Open("TourRelatedCity.html?CityID="+cityid, "TourRelatedCity");
}
function WriteReview(productid)
{
    InfoWindow_Open("WriteReview.html?ProductID="+productid, "WriteReview");
}
function EmailToFriend(productid)
{
    InfoWindow_Open("EmailToFriend.html?ProductID="+productid, "EmailToFriend");
}
function SetCtrlValue(objid, val)
{
    var obj = document.getElementById(objid);
    if( obj != null )
    {
        if( val != null )
        {
            obj.value = val;
        }
        else
        {
            obj.value = "";
        }
    }
}
function DoPrint(){
    document.getElementById("btnPrint").style.display="none";
    document.getElementById("btnClose").style.display="none";
    try
    {
        var   bodystr=document.body.innerHTML;   
        var   p_content=document.getElementById("areaPrint").innerHTML;   
        if   (window.print)   
        {   
            document.body.innerHTML   =   p_content;   
            window.print();   
            document.body.innerHTML=bodystr;  
        }
    }
    catch(e)
    {
        alert(e.name + ": " + e.message);
    }
    document.getElementById("btnPrint").style.display="";
    document.getElementById("btnClose").style.display="";
}
function getthedate(){
	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

	var mydate=new Date();
	var year=mydate.getYear();
	if (year < 1000)
		year+=1900;
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym<10)
		daym="0"+daym;
		
	var retDate = dayarray[day]+", "+montharray[month]+" "+daym+", "+year;
	document.write(retDate);
}

function ChangeShippingVia(shippingvia)
{
    var arr = shippingvia.split("_");
    if( arr.length != 2 )
    {
        SetText(document.getElementById("lbShippingHandling"), "0.00");
    }
    else
    {
        SetText(document.getElementById("lbShippingHandling"), arr[1]);
    }
    RecalOrderAmount();
}
function ChangeDeliveryState(state)
{
    if( state == "CA" )
    {
        var amount = Multiply2(document.getElementById("lbSubTotal").innerText, "0.0925");
        SetText(document.getElementById("lbTax"), amount);
    }
    else
    {
        SetText(document.getElementById("lbTax"), "0.00");
    }
    RecalOrderAmount();
}
function RecalOrderAmount()
{
    var amount = Plus3(document.getElementById("lbSubTotal").innerText, document.getElementById("lbShippingHandling").innerText, document.getElementById("lbTax").innerText);
    SetText(document.getElementById("lbOrderTotal"), amount);
}

function CopyBillInfo(checked)
{
    if(checked)
    {
        //var itemName = new Array("Title", "FirstName", "MiddleName", "LastName", "Address1", "Address2", "City", "State", "Zip", "Country", "Phone");
        var itemName = new Array("Title", "FirstName", "MiddleName", "LastName", "Address1", "Address2", "City", "State", "Zip", "Country", "StateName");
        var countrycode = "";
        var statecode = "";
        for( var i = 0; i < itemName.length; i++ )
        {
            var itemObjSrc = null;
            var itemObjTag = null;
            if( itemName[i] == "Country" || itemName[i] == "Title" || itemName[i] == "State" )
            {
                itemObjSrc = document.getElementById("lsBill" + itemName[i] + "_l");
                itemObjTag = document.getElementById("lsShip" + itemName[i] + "_l");
            }
            else
            {
                itemObjSrc = document.getElementById("tbBill" + itemName[i]);
                itemObjTag = document.getElementById("tbShip" + itemName[i]);
            }
            var itemValue = "";
            if( itemObjSrc != null )
            {
                itemValue = itemObjSrc.value;
            }
            if( itemName[i] == "Country" )
            {
                countrycode = itemValue;
            }
            if( itemName[i] != "State" )
            {
                SetValue(itemObjTag, itemValue);
            }
            else
            {
                statecode = itemValue;
            }
        }
        
        ChangeCountryEx(countrycode, "lsShipState_l", "hdShipState", statecode);
    }
}

function renewimg()
{   
    document.getElementById("verify_img").src='../common/GetImage.html?k='+Math.random();
}


function ShowImage(curId)
{
    var smallImg = document.getElementById(curId);
    var largeId = curId.replace("smallImage_", "largeImage_");
    var largeImg = document.getElementById(largeId);
    if( largeImg != null )
    {   
        document.getElementById("imgProduct").src = largeImg.value;
    }
    else
    {
        return;
    }
    if( smallImg != null )
    {
        for( var i = 0; i < 10; i++ )
        {
            var smallImg2 = document.getElementById("smallImage_" + i);
            if( smallImg2 != null )
            {
                smallImg2.className = "bdr";
            }
            else
            {
                break;
            }
        }
        smallImg.className = "bdr-focus";
    }
}
-->