$(document).ready(function(){

	$('.leadButton').removeAttr('onclick');

	Shadowbox.init();
	
	// Function des boutons		
	bindSearchEvent();
	bindDropdownClickEvent();
	bindSearchClickEvent();
	bindDocClick();
	
	var featuredSpecials = new Shiftr(
	{
		bindTo: '#vehicleWrapper',
	  	animation: 'slide_horizontal',
	  	jumpAmount: 1
	}); 		
	
	$('.featuredVehicleInner').mouseover(function () {
    	$("a.imgHover").hide();
		$(this).children("a.imgHover").show();
  	})
	$("#contentContainer, #searchContainer,.pictoPromoWrapper,#navDropDownContainer,#headerContainerTop,.buttonNext,.buttonPrevious").mouseover(function () {
    	$("a.imgHover").hide();
  	})

});

	

// Application Buttons //
//Service & Body Shop

var imgOnAppointment = new Image(253,48);
imgOnAppointment.src = '/images/image.php?file=buttons/'+ISOCODE+'/appointment2.gif';
var imgOffAppointment = new Image(253,48);
imgOffAppointment.src = '/images/image.php?file=buttons/'+ISOCODE+'/appointment1.gif';

// MORE INFO BUTTON
var imgOnInfo = new Image(253,48);
imgOnInfo.src = '/images/image.php?file=buttons/'+ISOCODE+'/more_info2.gif';
var imgOffInfo = new Image(253,48);
imgOffInfo.src = '/images/image.php?file=buttons/'+ISOCODE+'/more_info1.gif';

//Parts
var imgOnPartsRequest = new Image(253,48);
imgOnPartsRequest.src = '/images/image.php?file=buttons/'+ISOCODE+'/parts_request2.gif';
var imgOffPartsRequest = new Image(253,48);
imgOffPartsRequest.src = '/images/image.php?file=buttons/'+ISOCODE+'/parts_request1.gif';

//Finance
var imgOnCreditApp = new Image(253,48);
imgOnCreditApp.src = '/images/image.php?file=buttons/'+ISOCODE+'/credit_app2.gif';
var imgOffCreditApp = new Image(253,48);
imgOffCreditApp.src = '/images/image.php?file=buttons/'+ISOCODE+'/credit_app1.gif';

function changeImg(imgName,imgPre) {
	if(document.images){
		document.images[imgName].src = eval(imgPre + '.src');
	}
}

function openWindow(url,width,height){
	newWin = window.open(url, 'viewWin', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,left='+(screen.width-width)/2+',top='+(screen.height-height)/2+',width=' + width + ',height=' + height + '');
}

function showStatus(sMsg) {//used often

	//setTimeout("window.status = \'" + sMsg + "\';", 0);

    window.status = sMsg ;

    return true ;

}

function changeImg(imgName,imgPre) {

	if(document.images){

		document.images[imgName].src = eval(imgPre + '.src');

	}

}

function changeStyle(obj, new_style) {

    obj.className = new_style;

}

function expandableContent(callObj, obj, expandedStyle, collapsedStyle) {//used for collapsable content only (include only when necessary)

		var element = document.getElementById(obj);

		

		if	(callObj.className == 'expanded')

		{

			element.className = expandedStyle;

			callObj.className = 'collapsed';

			callObj.innerHTML = 'More...';

		}

		else

		{

			element.className = collapsedStyle;

			callObj.className = 'expanded';

			callObj.innerHTML = 'Less...';

		}

}

function SwitchSiteLanguage(IsoCode)
{
  var Cookie    = '';
  var dExpires  = new Date();

  dExpires.setTime(dExpires.getTime() + 60 * 60 * 24 * 30 * 1000);

  Cookie += 'site_language=' + IsoCode + '; ';
  Cookie += 'expires=' + dExpires.toGMTString() + '; ';
  Cookie += 'path=/; ';

  document.cookie = Cookie;

  return true;
}

