﻿// JScript File
//swapImage - main page tabs
function swapImage(x, oldImg, newImg)
{
    x.src = (x.src==oldImg)?oldImg:newImg;
    if (x.name != document.imgEnt.name)
        document.images['imgEnt'].src = '_img/theme01/rgiaitri_off.gif';
        
    if (x.name != document.imgShop.name)
        document.images['imgShop'].src = '_img/theme01/rmuasam_off.gif';
        
    if (x.name != document.imgHealth.name)
        document.images['imgHealth'].src = '_img/theme01/rsuckhoe_off.gif';
                
    if (x.name != document.imgSchool.name)
        document.images['imgSchool'].src = '_img/theme01/rhoctap_off.gif';
        
    if (x.name != document.imgHotel.name)
        document.images['imgHotel'].src = '_img/theme01/rkhachsan_off.gif';
       
    if (x.name != document.imgHotel.name)
        document.images['imgServices'].src = '_img/theme01/rproservices_off.gif';
               
    
    if (x.name == 'imgEnt')
        getDetail('entertainment.aspx');
    if (x.name == 'imgShop')
        getDetail('shops.aspx');
    if (x.name == 'imgHealth')
        getDetail('health.aspx');
    if (x.name == 'imgSchool')
        getDetail('schools.aspx');
    if (x.name == 'imgHotel')
        getDetail('hotels.aspx');
    if (x.name == 'imgServices')
        getDetail('hotels.aspx');
/*    
    if (x.name != document.imgEnt.name)
        document.images['imgEnt'].src = '_img/theme01/entertainment_off.jpg';
        
    if (x.name != document.imgShop.name)
        document.images['imgShop'].src = '_img/theme01/shops_off.jpg';
        
    if (x.name != document.imgHealth.name)
        document.images['imgHealth'].src = '_img/theme01/health_off.jpg';
                
    if (x.name != document.imgSchool.name)
        document.images['imgSchool'].src = '_img/theme01/School_off.jpg';
        
    if (x.name != document.imgHotel.name)
        document.images['imgHotel'].src = '_img/theme01/hotels_off.jpg';
       
        
    
    if (x.name == 'imgEnt')
        getDetail('entertainment.aspx');
    if (x.name == 'imgShop')
        getDetail('shops.aspx');
    if (x.name == 'imgHealth')
        getDetail('health.aspx');
    if (x.name == 'imgSchool')
        getDetail('schools.aspx');
    if (x.name == 'imgHotel')
        getDetail('hotels.aspx');
 */       
}

//swapImage - pricing tabs
function swapImage_p(x, oldImg, newImg)
{
    x.src = (x.src==oldImg)?oldImg:newImg;
    
    if (x.name != document.imgBen.name)
        document.images['imgBen'].src = '_img/theme01/ptab_benefit_off.jpg';
    if (x.name != document.imgShop.name)
        document.images['imgShop'].src = '_img/theme01/ptab_shop_off.jpg';
    if (x.name != document.imgEnt.name)
        document.images['imgEnt'].src = '_img/theme01/ptab_ent_off.jpg';
    if (x.name != document.imgClinic.name)
        document.images['imgClinic'].src = '_img/theme01/ptab_clinic_off.jpg';
        
    //if (x.name != document.imgCamNhan.name)
    //    document.images['imgCamNhan'].src = '_img/theme01/camnhan_off.jpg';
    
    if (x.name == 'imgBen')
        getDetail('pricelist.aspx?ID=4');
    if (x.name == 'imgEnt')
        getDetail('pricelist.aspx?ID=5');
    if (x.name == 'imgShop')
        getDetail('pricelist.aspx?ID=6');
    if (x.name == 'imgClinic')
        getDetail('pricelist.aspx?ID=7');
        
}

function LoadMainPic(urlName)
{
    document.images['MainPhoto'].src = urlName;
}

function CreateBookMarkLink( title, url) 
{ 

    if (window.sidebar) 
    { 
        // Mozilla Firefox Bookmark		
        window.sidebar.addPanel(title, url,"");	
    } 
    else if( window.external ) 
    {   // IE Favorite		
        window.external.AddFavorite( url, title); 
    }	
    else if(window.opera && window.print) 
    { // Opera Hotlist		
        return true; 
    } 

}

