﻿var $salesDialog;
var $testDriveDialog;
var $tipFriendDialog;
var $offertRequestDialog;
var $contactSalesCardDialog;

function htmlObjectExist(selector){
    // return true if html-object exist
    return (jQuery(selector).length !=0)
}

function initialize_CarSearchPage() {


    if(htmlObjectExist("#SlimSiteFlag")){
        // om mobil så ta bort all styling
        jQuery("*").attr("style","")
        
        jQuery(".MobileThumbContainer").mouseover(function(){
            return(true)
            
        })
        jQuery(".MobileThumbContainer").mouseout(function(){
            return(true)
        })
        
        jQuery("a.btnCustomLink").text("")
        
        
        //attr("onmouseover","alert('apa')")
        /*
        jQuery("a").click(function(){
            alert("apa")
        })
        */
        
    }
    
    if (htmlObjectExist("#allContactCardsDiv")) {
        var _title = jQuery('#saleTitleText').text()
        $salesDialog = jQuery('#allContactCardsDiv').dialog({ autoOpen: false, width: 600, height: 530, title: _title });
    }
    //$testDriveDialog = jQuery('#contactTestDriveDiv').dialog({ autoOpen: false, width: 510, height: 400, title: '' });
//    if (htmlObjectExist('#tipFormNew')) 
//        $tipFriendDialog = jQuery('#tipFormNew').dialog({ autoOpen: false, width: 510, height: 410, title: '' });
////    
    //$offertRequestDialog = jQuery('#contactOffertRequestDiv').dialog({ autoOpen: false, width: 510, height: 400, title: '' });
//    if (htmlObjectExist('#contactSalesCardDiv')) 
//        $contactSalesCardDialog = jQuery('#contactSalesCardDiv').dialog({ autoOpen: false, width: 510, height: 400, title: '' });
}