//RenderBodyElementForSplash.xslt

function SetCookieExternal(cookieName,cookieValue) {
    var height = 0;

    var headerHeight = 139;
    var leftBanerWirth = 244;

    var browser=navigator.appName;

    if (browser=="Microsoft Internet Explorer")
    {
        headerHeight = 139;
    }

    if(browser=="Netscape")
    {
        headerHeight = 130;
    }

    if(browser=="Opera")
    {
        headerHeight = 130;
        leftBanerWirth = 235;
    }

    var screenWidth = screen.width;
    screenWidth = document.body.offsetWidth
    var headerWidth = 990;
    var restWidth = (screenWidth-headerWidth)/2;
    var leftWidth = restWidth + leftBanerWirth;

    document.getElementById("div_popup_holder").style.top = headerHeight + 'px';
    document.getElementById("div_popup_holder").style.left = leftWidth + 'px';
    document.getElementById("div_popup_holder").style.margin = 0 + 'px';
    document.getElementById("div_popup_holder").style.padding = 0 + 'px';
    document.getElementById("div_popup").style.margin = 0 + 'px';
}

//CarModelSlideShow.xslt

    function callCarModelSlideShow(input,inputAlt) {
        $(document).ready(function() {
          $("#rollOutContent").slideDown("slow");
          laatAutoZien('1',input,inputAlt);
        });
    }

    function setProgressbar() {
        var progressbarValue = $('#progressbar').progressbar('option', 'value');
        var newProgressbarvalue=0;

        if(progressbarValue < 100) {
            newProgressbarvalue=progressbarValue+25;
            $("#progressbar").progressbar('value', newProgressbarvalue);
        }else {
            $("#progressbar").progressbar('value', 0);
        }
        progressbarId=window.setTimeout("setProgressbar()", 5000);
    }
		
	function laatAutoZien(num, input, inputAlt) {
		var welke = 'p'+num;
		var duur = 5;        
		
		$("#progressbar").progressbar({value: 0});
		$("#progressbar").progressbar('value', 0);

        clearTimeout(slideShowId);
		clearTimeout(progressbarId);

		setProgressbar();

		var emilyPictureBackground1=document.getElementById('EmilyPictureBackground1');
		var emilyPictureBackground2=document.getElementById('EmilyPictureBackground2');
		var emilyPictureBackground3=document.getElementById('EmilyPictureBackground3');
		var emilyPictureBackground4=document.getElementById('EmilyPictureBackground4');
		var emilyPictureBackground5=document.getElementById('EmilyPictureBackground5');
		var emilyPictureBackground6=document.getElementById('EmilyPictureBackground6');
		var emilyPictureBackground7=document.getElementById('EmilyPictureBackground7');
		var emilyPictureBackground8=document.getElementById('EmilyPictureBackground8');
		var emilyPictureBackground9=document.getElementById('EmilyPictureBackground9');
		var emilyPictureBackground10=document.getElementById('EmilyPictureBackground10');
		var emilyPictureBackground11=document.getElementById('EmilyPictureBackground11');
		var emilyPictureBackground12=document.getElementById('EmilyPictureBackground12');

		var actieBackground1=document.getElementById('actieBackground1');
		var actieBackground2=document.getElementById('actieBackground2');
		var actieBackground3=document.getElementById('actieBackground3');
		var actieBackground4=document.getElementById('actieBackground4');
		var actieBackground5=document.getElementById('actieBackground5');
		var actieBackground6=document.getElementById('actieBackground6');
		var actieBackground7=document.getElementById('actieBackground7');
		var actieBackground8=document.getElementById('actieBackground8');
		var actieBackground9=document.getElementById('actieBackground9');
		var actieBackground10=document.getElementById('actieBackground10');
		var actieBackground11=document.getElementById('actieBackground11');
		var actieBackground12=document.getElementById('actieBackground12');

		if (welke == 'p1') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '1300';//visible
				actieBackground1.style.zIndex = '1300';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '1200';
				actieBackground2.style.zIndex = '1200';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '1100';
				actieBackground3.style.zIndex = '1100';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '1000';
				actieBackground4.style.zIndex = '1000';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '900';
				actieBackground5.style.zIndex = '900';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '800';
				actieBackground6.style.zIndex = '800';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '700';
				actieBackground7.style.zIndex = '700';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '600';
				actieBackground8.style.zIndex = '600';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '500';
				actieBackground9.style.zIndex = '500';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '400';
				actieBackground10.style.zIndex = '400';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '300';
				actieBackground11.style.zIndex = '300';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '200';
				actieBackground12.style.zIndex = '200';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p2') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '200';
				actieBackground1.style.zIndex = '200';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '1300';
				actieBackground2.style.zIndex = '1300';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '1200';
				actieBackground3.style.zIndex = '1200';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '1100';
				actieBackground4.style.zIndex = '1100';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '1000';
				actieBackground5.style.zIndex = '1000';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '900';
				actieBackground6.style.zIndex = '900';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '800';
				actieBackground7.style.zIndex = '800';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '700';
				actieBackground8.style.zIndex = '700';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '600';
				actieBackground9.style.zIndex = '600';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '500';
				actieBackground10.style.zIndex = '500';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '400';
				actieBackground11.style.zIndex = '400';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '300';
				actieBackground12.style.zIndex = '300';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p3') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '300';
				actieBackground1.style.zIndex = '300';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '200';
				actieBackground2.style.zIndex = '200';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '1300';
				actieBackground3.style.zIndex = '1300';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '1200';
				actieBackground4.style.zIndex = '1200';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '1100';
				actieBackground5.style.zIndex = '1100';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '1000';
				actieBackground6.style.zIndex = '1000';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '900';
				actieBackground7.style.zIndex = '900';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '800';
				actieBackground8.style.zIndex = '800';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '700';
				actieBackground9.style.zIndex = '700';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '600';
				actieBackground10.style.zIndex = '600';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '500';
				actieBackground11.style.zIndex = '500';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '400';
				actieBackground12.style.zIndex = '400';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p4') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '400';
				actieBackground1.style.zIndex = '400';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '300';
				actieBackground2.style.zIndex = '300';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '200';
				actieBackground3.style.zIndex = '200';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '1300';
				actieBackground4.style.zIndex = '1300';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '1200';
				actieBackground5.style.zIndex = '1200';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '1100';
				actieBackground6.style.zIndex = '1100';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '1000';
				actieBackground7.style.zIndex = '1000';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '900';
				actieBackground8.style.zIndex = '900';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '800';
				actieBackground9.style.zIndex = '800';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '700';
				actieBackground10.style.zIndex = '700';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '600';
				actieBackground11.style.zIndex = '600';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '500';
				actieBackground12.style.zIndex = '500';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p5') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '500';
				actieBackground1.style.zIndex = '500';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '400';
				actieBackground2.style.zIndex = '400';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '300';
				actieBackground3.style.zIndex = '300';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '200';
				actieBackground4.style.zIndex = '200';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '1300';
				actieBackground5.style.zIndex = '1300';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '1200';
				actieBackground6.style.zIndex = '1200';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '1100';
				actieBackground7.style.zIndex = '1100';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '1000';
				actieBackground8.style.zIndex = '1000';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '900';
				actieBackground9.style.zIndex = '900';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '800';
				actieBackground10.style.zIndex = '800';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '700';
				actieBackground11.style.zIndex = '700';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '600';
				actieBackground12.style.zIndex = '600';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p6') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '600';
				actieBackground1.style.zIndex = '600';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '500';
				actieBackground2.style.zIndex = '500';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '400';
				actieBackground3.style.zIndex = '400';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '300';
				actieBackground4.style.zIndex = '300';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '200';
				actieBackground5.style.zIndex = '200';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '1300';
				actieBackground6.style.zIndex = '1300';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '1200';
				actieBackground7.style.zIndex = '1200';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '1100';
				actieBackground8.style.zIndex = '1100';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '1000';
				actieBackground9.style.zIndex = '1000';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '900';
				actieBackground10.style.zIndex = '900';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '800';
				actieBackground11.style.zIndex = '800';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '700';
				actieBackground12.style.zIndex = '700';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p7') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '700';
				actieBackground1.style.zIndex = '700';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '600';
				actieBackground2.style.zIndex = '600';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '500';
				actieBackground3.style.zIndex = '500';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '400';
				actieBackground4.style.zIndex = '400';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '300';
				actieBackground5.style.zIndex = '300';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '200';
				actieBackground6.style.zIndex = '200';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '1300';
				actieBackground7.style.zIndex = '1300';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '1200';
				actieBackground8.style.zIndex = '1200';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '1100';
				actieBackground9.style.zIndex = '1100';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '1000';
				actieBackground10.style.zIndex = '1000';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '900';
				actieBackground11.style.zIndex = '900';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '800';
				actieBackground12.style.zIndex = '800';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p8') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '800';
				actieBackground1.style.zIndex = '800';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '700';
				actieBackground2.style.zIndex = '700';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '600';
				actieBackground3.style.zIndex = '600';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '500';
				actieBackground4.style.zIndex = '500';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '400';
				actieBackground5.style.zIndex = '400';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '300';
				actieBackground6.style.zIndex = '300';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '200';
				actieBackground7.style.zIndex = '200';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '1300';
				actieBackground8.style.zIndex = '1300';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '1200';
				actieBackground9.style.zIndex = '1200';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '1100';
				actieBackground10.style.zIndex = '1100';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '1000';
				actieBackground11.style.zIndex = '1000';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '900';
				actieBackground12.style.zIndex = '900';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p9') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '900';
				actieBackground1.style.zIndex = '900';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '800';
				actieBackground2.style.zIndex = '800';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '700';
				actieBackground3.style.zIndex = '700';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '600';
				actieBackground4.style.zIndex = '600';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '500';
				actieBackground5.style.zIndex = '500';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '400';
				actieBackground6.style.zIndex = '400';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '300';
				actieBackground7.style.zIndex = '300';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '200';
				actieBackground8.style.zIndex = '200';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '1300';
				actieBackground9.style.zIndex = '1300';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '1200';
				actieBackground10.style.zIndex = '1200';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '1100';
				actieBackground11.style.zIndex = '1100';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '1000';
				actieBackground12.style.zIndex = '1000';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p10') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '1000';
				actieBackground1.style.zIndex = '1000';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '900';
				actieBackground2.style.zIndex = '900';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '800';
				actieBackground3.style.zIndex = '800';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '700';
				actieBackground4.style.zIndex = '700';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '600';
				actieBackground5.style.zIndex = '600';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '500';
				actieBackground6.style.zIndex = '500';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '400';
				actieBackground7.style.zIndex = '400';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '300';
				actieBackground8.style.zIndex = '300';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '200';
				actieBackground9.style.zIndex = '200';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '1300';
				actieBackground10.style.zIndex = '1300';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '1200';
				actieBackground11.style.zIndex = '1200';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '1100';
				actieBackground12.style.zIndex = '1100';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p11') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '1100';
				actieBackground1.style.zIndex = '1100';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '1000';
				actieBackground2.style.zIndex = '1000';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '900';
				actieBackground3.style.zIndex = '900';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '800';
				actieBackground4.style.zIndex = '800';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '700';
				actieBackground5.style.zIndex = '700';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '600';
				actieBackground6.style.zIndex = '600';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '500';
				actieBackground7.style.zIndex = '500';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '400';
				actieBackground8.style.zIndex = '400';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '300';
				actieBackground9.style.zIndex = '300';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '200';
				actieBackground10.style.zIndex = '200';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '1300';
				actieBackground11.style.zIndex = '1300';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '1200';
				actieBackground12.style.zIndex = '1200';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
		else if (welke == 'p12') {
			if(emilyPictureBackground1){
				emilyPictureBackground1.style.zIndex = '1200';
				actieBackground1.style.zIndex = '1200';
			}
			if(emilyPictureBackground2){
				emilyPictureBackground2.style.zIndex = '1100';
				actieBackground2.style.zIndex = '1100';
			}
			if(emilyPictureBackground3){
				emilyPictureBackground3.style.zIndex = '1000';
				actieBackground3.style.zIndex = '1000';
			}
			if(emilyPictureBackground4){
				emilyPictureBackground4.style.zIndex = '900';
				actieBackground4.style.zIndex = '900';
			}
			if(emilyPictureBackground5){
				emilyPictureBackground5.style.zIndex = '800';
				actieBackground5.style.zIndex = '800';
			}
			if(emilyPictureBackground6){
				emilyPictureBackground6.style.zIndex = '700';
				actieBackground6.style.zIndex = '700';
			}
			if(emilyPictureBackground7){
				emilyPictureBackground7.style.zIndex = '600';
				actieBackground7.style.zIndex = '600';
			}
			if(emilyPictureBackground8){
				emilyPictureBackground8.style.zIndex = '500';
				actieBackground8.style.zIndex = '500';
			}
			if(emilyPictureBackground9){
				emilyPictureBackground9.style.zIndex = '400';
				actieBackground9.style.zIndex = '400';
			}
			if(emilyPictureBackground10){
				emilyPictureBackground10.style.zIndex = '300';
				actieBackground10.style.zIndex = '300';
			}
			if(emilyPictureBackground11){
				emilyPictureBackground11.style.zIndex = '200';
				actieBackground11.style.zIndex = '200';
			}
			if(emilyPictureBackground12){
				emilyPictureBackground12.style.zIndex = '1300';
				actieBackground12.style.zIndex = '1300';
			}
			RunSlideShow("EmilyPicture"+num,"EmilyPictureBackground"+num,input,inputAlt);
		}
	}

	function RunSlideShow(pictureID,backgroundID,imageFiles,imageFilesAlt){
		var imageSeparator = imageFiles.indexOf(";");
		var imageSeparatorAlt = imageFilesAlt.indexOf(";");    
		var nextImage = imageFiles.substring(0,imageSeparator);
		var nextImageAlt = imageFilesAlt.substring(0,imageSeparatorAlt);

		FadeInImage(pictureID,nextImage,nextImageAlt,backgroundID);
		var futureImages = imageFiles.substring(imageSeparator+1,imageFiles.length)+ ';' + nextImage;
		var futureImagesAlt = imageFilesAlt.substring(imageSeparatorAlt+1,imageFilesAlt.length)+ ';' + nextImageAlt;

		slideShowId=window.setTimeout("RunSlideShow('"+pictureID+"','"+backgroundID+"','"+futureImages+"','"+futureImagesAlt+"')",5000);
	}

	function FadeInImage(foregroundID,newImage,newImageAlt,backgroundID){
		var foreground=document.getElementById(foregroundID);
		if (foreground.timer) window.clearTimeout(foreground.timer);
		if (backgroundID){
			var background=document.getElementById(backgroundID);
			if (background){
				if (background.src){
					foreground.src = background.src;
					foreground.alt = background.alt;				

					SetOpacity(foreground,100);
				}
				background.src = newImage;
				background.alt = newImageAlt;
				background.style.backgroundImage = 'url(' + newImage + ')';
				background.style.backgroundRepeat = 'no-repeat';
				background.style.visibility = 'visible';
				var startMS = (new Date()).getTime();
				foreground.timer = window.setTimeout("ChangeOpacity('" + foregroundID + "'," + FadeDurationMS + "," + startMS + ",100,0)",10);
			}
		} else {
			foreground.src = newImage;
			foreground.alt = newImageAlt;
		}
	}

	var FadeDurationMS=1000;

	function SetOpacity(object,opacityPct)
	{
		// IE.
		object.style.filter = 'alpha(opacity=' + opacityPct + ')';
		// Old mozilla and firefox
		object.style.MozOpacity = opacityPct/100;
		// Everything else.
		object.style.opacity = opacityPct/100;
	}

	function ChangeOpacity(id,msDuration,msStart,fromO,toO)
	{
		var element=document.getElementById(id);
		var msNow = (new Date()).getTime();
		var opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
		if (opacity > 100)
		{
			SetOpacity(element,100);
			element.timer = undefined;
		}
		else if (opacity < 0)
		{
			SetOpacity(element,0);
			element.timer = undefined;
		}
		else
		{
			SetOpacity(element,opacity);
			element.timer = window.setTimeout("ChangeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",10);
		}
	}

// Scripts from RedirectPage.xslt

function setExternScriptRedirectPage(pageName){
    afterLoadURL = pageName+'.aspx';

    //after intro, redirects to the selected page
    window.location.replace(afterLoadURL);
}

// Scripts from RequestProcessingText.xslt

function setExternScriptReqProcText(third, confirm){
   var currentStep = '';
    if(document.getElementById('currentStep') != null){
        currentStep = document.getElementById('currentStep').value;
    }     
    var processingText  = document.getElementById('processingText');

    if(currentStep == 'third'){
	    processingText.value = third;
    } else if(currentStep == 'confirmation'){
	    processingText.value = confirm;
    }		
}

//Scripts from [Default Page] Default Page Zoek Occasions.htm

function GetExtScriptDefaultPageZoekOccasions(){
    var leftWidth = document.getElementById('leftPercent').value;
    var rightWidth = document.getElementById('rightPercent').value;
    var leftColumn = document.getElementById('leftColumn');
    var rightColumn = document.getElementById('rightColumn');
    var overlayPosition = document.getElementById('leftOverlayPos').value;
    var rightColumn = document.getElementById('LeftOverlayHeader').value;
    var overlayPosition = document.getElementById('LeftOverlayText').value;

    var leftImageWidth= document.getElementById('leftImageWidth').value;

    /*setRelativeLayer("underlay_div", 'overlay_div', 'Bottom', 10, overlayPosition ,4/5);*/
    setOverlayPosition("underlay_div", 'overlay_div', overlayPosition, 'Bottom', '-10px', 4/5 , '300');

    var  boxLeft = document.getElementById('boxLeft2');
    if(!rightColumn && !overlayPosition && boxLeft != null){
	    document.getElementById('boxLeft2').display='none';
    }

    if(leftWidth && leftColumn){
	    leftColumn.style.width = (leftWidth - 7) +'%';
    }

    if (rightColumn) {
        if(rightWidth){
	        rightColumn.style.width = (rightWidth - 8) +'%';	
        }else {
	        rightColumn.style.display = 'none';
        }
    }

    if(leftImageWidth > ((leftWidth*690)/100-60)){
        document.getElementById('under_image').style.width = (leftWidth*710)/100-60 + "px";
    }

    if (document.getElementById('under_image_right') != null) {
        var  rightImageWidth = document.getElementById('under_image_right').offsetWidth;

        if(rightImageWidth > ((rightWidth*690)/100-60)){
            document.getElementById('under_image_right').style.width = (rightWidth*690)/100-60 + "px";
        }
    }
}

// Scripts from [Default Page] Default Page.htm

function GetExtScriptDefaultPage() {
    var leftWidth = document.getElementById('leftPercent').value;
    var rightWidth = document.getElementById('rightPercent').value;
    var leftColumn = document.getElementById('leftColumn');
    var rightColumn = document.getElementById('rightColumn');
    var overlayPosition = document.getElementById('leftOverlayPos').value;
    var rightColumn = document.getElementById('LeftOverlayHeader').value;
    var overlayPosition = document.getElementById('LeftOverlayText').value;


    var leftImageWidth= document.getElementById('leftImageWidth').value;
    if (leftImageWidth == "") {
        leftImageWidth = 0;
    }

    if (leftColumn.style.width != "") {
        leftColumn.style.width = (((leftWidth - 7)*690)/100) +'px';
    }
    if(rightWidth != '' && (rightWidth) - 8> 0){
        document.getElementById('box').style.width = (((rightWidth - 8)*690)/100) +'px';
    } else {
        document.getElementById('box').style.width = 0 +'px';
    }
    
    var overlayWidth = (((leftWidth - 7)*690)/100)+'';
    
    /* In case leftWidth percentage value is not set */
    if (overlayWidth > 0) {
        /*setRelativeLayer("underlay_div", 'overlay_div', 'Bottom', 10, overlayPosition ,4/5);*/
        setOverlayPosition("underlay_div", 'overlay_div', overlayPosition, 'Bottom', '-10px', 4/5 , overlayWidth);    
    }

    if(leftImageWidth > ((leftWidth*690)/100-60)){
        var  leftImage = document.getElementById('under_image');
        if(leftImage != null){
            document.getElementById('under_image').style.width = (leftWidth*710)/100-60 + "px";
        }
    }
}

// Scripts from [Request] Thankyou Page.htm

function GetExtScriptThankYouPage(){
    var leftWidth = document.getElementById('leftPercent').value;
    var rightWidth = document.getElementById('rightPercent').value;
    var leftColumn = document.getElementById('leftColumn');
    var rightColumn = document.getElementById('rightColumn');
    var overlayPosition = document.getElementById('leftOverlayPos').value;

    var leftImageWidth= document.getElementById('leftImageWidth').value;

    /*setRelativeLayer("underlay_div", 'overlay_div', 'Bottom', 10, overlayPosition ,4/5);*/
    setOverlayPosition("underlay_div", 'overlay_div', overlayPosition, 'Bottom', '-10px', 4/5 , '300');

    if(leftWidth && leftColumn){
	    leftColumn.style.width = (leftWidth - 7) +'%';    	
    }
    
    if(rightWidth && rightColumn ){
	    rightColumn.style.width = (rightWidth - 8) +'%';	
    	
    }

    if(leftImageWidth > ((leftWidth*690)/100-60)){
        document.getElementById('under_image').style.width = (leftWidth*710)/100-60 + "px";
    }
    
    var  rightImageWidth = 0;
    var  rightImage = document.getElementById('under_image_right');
    if(rightImage != undefined){
        rightImageWidth = document.getElementById('under_image_right').offsetWidth;
    }
    
    
    if(rightImageWidth > ((rightWidth*690)/100-60)){
        document.getElementById('under_image_right').style.width = (rightWidth*690)/100-60 + "px";
    }

    $.cookies.del('GeneralInfo');
    $.cookies.del('RequestsInfo');
    $.cookies.del('selectedModels0');
    $.cookies.del('selectedModels1');
    $.cookies.del('previousSelectedModel0');
    $.cookies.del('previousSelectedModel1');
    $.cookies.del('FinancialInfo');
    $.cookies.del('LeaseInfo');
    $.cookies.del('ErsteInfo');
    $.cookies.del('TweedeInfo');
    $.cookies.del('isConfirmationPage');
}

// Scripts from [Request] Thankyou Page.htm

function GetExtScriptThankYouPageNew(){
    var leftWidth = document.getElementById('leftPercent').value;
    var rightWidth = document.getElementById('rightPercent').value;
    var leftColumn = document.getElementById('leftColumn');
    var rightColumn = document.getElementById('rightColumn');
    var overlayPosition = document.getElementById('leftOverlayPos').value;

    var leftImageWidth= document.getElementById('leftImageWidth').value;

    /*setRelativeLayer("underlay_div", 'overlay_div', 'Bottom', 10, overlayPosition ,4/5);*/
    setOverlayPosition("underlay_div", 'overlay_div', overlayPosition, 'Bottom', '-10px', 4/5 , '300');

    if(leftWidth && leftColumn){
	    leftColumn.style.width = (leftWidth - 7) +'%';    	
    }
    
    if(rightWidth && rightColumn ){
	    rightColumn.style.width = (rightWidth - 8) +'%';	
    	
    }

    if(leftImageWidth > ((leftWidth*690)/100-60)){
        document.getElementById('under_image').style.width = (leftWidth*710)/100-60 + "px";
    }
    
    var  rightImageWidth = 0;
    var  rightImage = document.getElementById('under_image_right');
    if(rightImage != undefined){
        rightImageWidth = document.getElementById('under_image_right').offsetWidth;
    }
    
    
    if(rightImageWidth > ((rightWidth*690)/100-60)){
        document.getElementById('under_image_right').style.width = (rightWidth*690)/100-60 + "px";
    }

    $.cookies.del('GeneralInfoNew');
    $.cookies.del('RequestsInfo');
    $.cookies.del('selectedModels2');
    $.cookies.del('selectedModels3');
    $.cookies.del('previousSelectedModel0');
    $.cookies.del('previousSelectedModel1');
    $.cookies.del('FinancialInfo');
    $.cookies.del('LeaseInfo');
    $.cookies.del('ErsteInfo');
    $.cookies.del('TweedeInfo');
    $.cookies.del('isConfirmationPage');
}

// Scripts from CarModelExterior.htm

function GetExtScriptCarModelExteriorFirst() {
    var selectedTabId       = GetQueryString("tabId");
	var selectedDealerId    = GetQueryString("dealerId");

	function GetUrl(argsUrl, isFlashUrl)
	{
	    var url = argsUrl;
    
    	if(selectedTabId != null && selectedTabId!="")
    	{
    	    url+="?tabId="+selectedTabId;
    	    
    	    if(!isFlashUrl && selectedDealerId != null && selectedDealerId != "")
    	    {
    	        url+="?dealerId="+selectedDealerId;
    	    }
    	}
    
    	return url;
	}    
    
	function gotoSmallView(xmlFileString) 
	{
		window.location	= GetUrl(modelURL, false);
	}
		
	function backToOverview(xmlFileString) 
	{
		window.location	= GetUrl(modelURL, false);
	}
	
	function tabClicked(tabId)
	{
		selectedTabId = tabId;
	}
}

function GetExtScriptCarModelExteriorSecond() {
    AC_FL_RunContent(
		"src", modelCarouselFlash,
		"width", "100%",
		"height", "100%",
		"align", "middle",
		"id", "TabDetailsBig",
		"quality", "high",
		"bgcolor", "#869ca7",
		"name", "TabDetailsBig",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer",
		"flashvars","xmlURL=" + GetUrl(modelCarouselFlashXML, true)			
	);
}

// Scripts from 404Page.htm

function GetExtScript404Page() {
    var leftWidth = document.getElementById('leftPercent').value;
    var rightWidth = document.getElementById('rightPercent').value;
    var leftColumn = document.getElementById('leftColumn');
    var rightColumn = document.getElementById('rightColumn');
    var overlayPosition = document.getElementById('leftOverlayPos').value;
    var rightColumn = document.getElementById('LeftOverlayHeader').value;
    var overlayPosition = document.getElementById('LeftOverlayText').value;


    var leftImageWidth= document.getElementById('leftImageWidth').value;

    /*setRelativeLayer("underlay_div", 'overlay_div', 'Bottom', 10, overlayPosition ,4/5);*/
    setOverlayPosition("underlay_div", 'overlay_div', overlayPosition, 'Bottom', '-10px', 4/5 , '300');

    leftColumn.style.width = (((leftWidth - 7)*690)/100) +'px';
    if(rightWidth != '' && (rightWidth) - 8> 0){
    document.getElementById('box').style.width = (((rightWidth - 8)*690)/100) +'px';
    } else {
    document.getElementById('box').style.width = 0 +'px';
    }

    if(leftImageWidth > ((leftWidth*690)/100-60)){
        document.getElementById('under_image').style.width = (leftWidth*710)/100-60 + "px";
    }
}

// Scripts from Site Master Template.htm

function GetExtScriptSiteMasterTemplate() {
   	hideEmptyImages();
	hideEmptyOverlayDivs();
	setDocHeight();
	setTimeout('setSubmenu()',100);
}

// Scripts from Home Page.htm

function GetExtScriptHomePage() {
    function metrixlab_onready(el, func){
	    this.args = new Array(el, func);
	    this.doTry = function(){
		    try{
			    var el = eval(this.args[0]);
			    el.onloading = this.args[1];
			    el.onloading();
			    clearInterval(this.args[2]);
		    }
		    catch(e){}
	    }
	    this.doTry.bind = function(object){
		    var method = this;
		    return function(){
			    method.apply(object);
		    }
	    }
	    this.args[2] = setInterval(this.doTry.bind(this), 250);
	    return this;
    }

    new metrixlab_onready("document.body", function(){
	    var metrixlab_body = top.document.getElementsByTagName('body').item(0);
	    var metrixlab_script = top.document.createElement('script');
	    metrixlab_script.setAttribute('defer','defer');
	    metrixlab_script.src='http://invitation.opinionbar.com/popups/p08816/overlay.js';
	    metrixlab_script.type='text/javascript';
	    metrixlab_body.insertBefore(metrixlab_script, metrixlab_body.childNodes[0]);
    });
}

// Scripts from [News] Letter Archive.htm

function GetExtScriptLetterArchive() {
    $(document).ready( function() {
        $("A.external_link").click( function() {
            window.open( $(this).attr('href') );
            return false;
        });
    });
}

// Scripts from [Services] Services.htm

function GetExtScriptServicesFirst() {
    var requestFormVis = document.getElementById('requestFormVisibility');
    var userControlDiv = document.getElementById('userControlDiv');
    if(requestFormVis != null)
    {	
        if(requestFormVis.value != 1)
        {
            if(userControlDiv != null)
            {			
                userControlDiv.style.display = 'none';
            }
        }
        else
        {
            if(userControlDiv != null)
            {			
                userControlDiv.style.display = 'block';
            }
        }
    }
}

function GetExtScriptServicesSecond() {
    var videoFileVis = document.getElementById('videoFileVisiblity');

    if(videoFileVis != null)
    {
        if(videoFileVis.value == 1)
        {
            insertServicesFlash();
        }
        else
        {
            var rightColumn = document.getElementById("right_column");
            if(rightColumn != null)
            {
                rightColumn.style.display = 'none';
            }
        }
    }	
}

/*
* Scripts from [Request] ConfirmationPage.htm;
*               [Request] ThirdStep;
*               [Request] SecondStep;
*               [Request] Main Request;
*               [Request] ConfirmationPage;
*/

function GetExtScriptRequestPages(page){
    var selectedModels = new Array(); // Initialize to empty array.

    if(page != 'Main'){
    	var selectedStepValue = document.getElementById('selectedStepValue');
    }
}

function GetExtScriptRequestPagesNew(page){
    var selectedModelsNew = new Array(); // Initialize to empty array.

    if(page != 'Main'){
    	var selectedStepValue = document.getElementById('selectedStepValue');
    }
}

// USER CONTROLS
// Scripts from ConfirmationRequestInfo.ascx

function GetExtScriptConfReqInfoProgress(){  
    var modalProgressElement = document.getElementById('OverlayBackgroundElement');  
    if(modalProgressElement != undefined){ 
        modalProgressElement.style.display = 'none';
    }
    var updateProgressElement = document.getElementById('Overlay_PanelUpdateProgress');
    if(updateProgressElement != undefined){ 
        updateProgressElement.style.display = 'none';
    }    	
    var updateProgress = document.getElementById('Overlay_UpdateProg');
     if(updateProgress != undefined){ 
        updateProgress.style.display = 'none';
    }     
}

function GetExtScriptConfReqInfoOverlay() {

    var modalProgressElement = document.getElementById('OverlayBackgroundElement');  
    
    modalProgressElement.style.display = 'block';
    
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }    

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById('Overlay_PanelUpdateProgress');
    updateProgressElement.style.display = 'block';
    var updateProgress = document.getElementById('Overlay_UpdateProg');
    updateProgress.style.display = 'block';	

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

        updateProgressElement.style.top = finalHeight;
        updateProgressElement.style.left = finalWidth;
   
}

// Scripts from DealerContact.ascx

function GetExtScriptDealerContactRequest(modProg, pnlUpld){    
    
    var ModalProgress = modProg;  
    var UploadPanel = pnlUpld;
        
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }

    var modalProgressElement = document.getElementById(ModalProgress + "_backgroundElement");      

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById(UploadPanel);

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

        updateProgressElement.style.top = finalHeight;
        updateProgressElement.style.left = finalWidth;
}
  


// Scripts from DealerSearch.ascx

function GetExtScriptDealerSearch()
{
    if(typeof displayDealers == 'function')
	{
		displayDealers();
	}
}

// Scripts from DealerVacancyPage.ascx

function GetExtScriptDealerVacancyPage(modal, panel){
    var ModalProgress = modal;
    var panelUpdate = panel;

    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }

    var modalProgressElement = document.getElementById(ModalProgress + "_backgroundElement");      

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById(panelUpdate);

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

    updateProgressElement.style.top = finalHeight;
    updateProgressElement.style.left = finalWidth;
}

// Scripts from DealerWorkingPlaceContact.ascx

function GetExtScriptDealerWorkingPlaceContact(ModalProgress, UpdatePanel){
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }

    var modalProgressElement = document.getElementById(ModalProgress + "_backgroundElement");      

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById(UpdatePanel);

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

    updateProgressElement.style.top = finalHeight;
    updateProgressElement.style.left = finalWidth;
  
}

function customSubmit(element)
{             
    if(browserIsIE6()){
        __doPostBack(element.id,null);
        return false;
    }
    else
    {
        return true;
    }
}

function browserIsIE6(){
    return (/MSIE (6)/.test(navigator.userAgent) && navigator.platform == "Win32");
}


// Scripts from GetAllProvince.ascx

function GetExtScriptGetAllProvinceVars(latitude, longitude, hdnDealer, sessDealer, dealerInfo){
    var hdnLatitude  = latitude;
    var hdnLongitude = longitude;
    var hdnDealer    = hdnDealer;
    var hdnSessionDealer    = sessDealer;
    var hdnDealerInfo    = dealerInfo;
}


function removeGMapCookie()
{
    if($.cookies.get('selectedDealerKind') != undefined)
    {
        $.cookies.del('selectedDealerKind');
    }
}   


//function GetExtScriptGetAllProvinceUnload(){
//    $(window).unload( function () {
//      GUnload(); 
//    } );
//}

// Scripts from LeasingRequest.ascx

function GetExtScriptLeasingRequest(modal,panel){
    var ModalPanel = modal;
    var UpdatePanel = panel;
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }

    var modalProgressElement = document.getElementById(ModalPanel + "_backgroundElement");      

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById(UpdatePanel);

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;


    updateProgressElement.style.top = finalHeight;
    updateProgressElement.style.left = finalWidth;
    
}

// Scripts from MainRequest.ascx

function GetExtScriptMainReqRequest(){    
    var modalProgressElement = document.getElementById('OverlayBackgroundElement');  
    modalProgressElement.style.display = 'block';
    
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }    

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById('Overlay_PanelUpdateProgress');
    updateProgressElement.style.display = 'block';
    var updateProgress = document.getElementById('Overlay_UpdateProg');
    updateProgress.style.display = 'block';

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

    
    updateProgressElement.style.top = finalHeight;
    updateProgressElement.style.left = finalWidth;     	        
}

function endReqRequest(sender, args) {
    var modalProgressElement = document.getElementById('OverlayBackgroundElement');  
    modalProgressElement.style.display = 'none';
    var updateProgressElement = document.getElementById('Overlay_PanelUpdateProgress');
    updateProgressElement.style.display = 'none';	
    var updateProgress = document.getElementById('Overlay_UpdateProg');
    updateProgress.style.display = 'none';
    removeMainGradientDivs();
}

// Scripts from NewsletterRequest.ascx

function GetExtScriptNewsReq(ModalProgress, UpdatePanel){
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }

    var modalProgressElement = document.getElementById(ModalProgress + "_backgroundElement");      

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById(UpdatePanel);

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

    updateProgressElement.style.top = finalHeight;
    updateProgressElement.style.left = finalWidth;
}

// Scripts from PricePageControl.ascx


    function createDiv(){
        var browser=navigator.appName;
        var overNieuws = document.getElementById("overNieuws");
        
        var content = document.getElementById("content_right");
    	
        elem = document.getElementsByClassName("gradientDiv");
        var maxHeight;
        for(i=0;i<elem.length;i++) {
		        maxHeight = elem[i].style.top ;		
        }
        
        if(browser.toUpperCase() == 'NETSCAPE'){
	            overNieuws.style.display = 'block';	
                overNieuws.style.visibility = 'visible';
                overNieuws.style.marginLeft = '-16px';		
                overNieuws.style.top = maxHeight;
                overNieuws.style.height = (content.offsetHeight - maxHeight.slice(0,-2) - 40) + "px";	        
        }
    }
  

    function hideModelsPanel(ScrollPanel){
        var scrollPanel = document.getElementById(ScrollPanel);
        if (scrollPanel != null) {
            scrollPanel.style.visibility = 'hidden';
            scrollPanel.style.display = 'none';
        }
    }

    function hidecolumn(columnId, index, downloadPatameters, scrollPanel,modelsCount,hiddenModelsCount)
    {
       //debugger;
       var DownloadPatameters = downloadPatameters;
       var ScrollPanel = scrollPanel;
       var ModelsCount = modelsCount;
       var HiddenModelsCount = hiddenModelsCount;
       var column = document.getElementById(columnId);
       if(column != null)
       {        
            column.style.display = 'none';
            column.style.visibility = 'hidden';
       }
    //   alert('index' + index);
    //   var checkBox = document.getElementById(checkBoxId);
    //   if (checkBox != null)
    //   {
    //    checkBox.checked = false;
    //   }
    //   
    //   debugger;
       var hiddenQueryStringField = document.getElementById(DownloadPatameters);
       if(hiddenQueryStringField != null)
       {
        if(hiddenQueryStringField.value != '')
            hiddenQueryStringField.value = hiddenQueryStringField.value + ',' + index;
        else
            hiddenQueryStringField.value = index;
       }
       
       var modelsCountElement = document.getElementById(ModelsCount);
       var modelsHiddenCountElement = document.getElementById(HiddenModelsCount);
       
       var modelsCount = modelsCountElement.value;
       var modelsHiddenCount = modelsHiddenCountElement.value;
       
       
       if (modelsCount != null && modelsHiddenCount != null)
       {
           modelsHiddenCount++;
           if (modelsHiddenCount == modelsCount)
           {
                hideModelsPanel(ScrollPanel);
           }
           
           modelsHiddenCountElement.value = modelsHiddenCount;
       }
    }


    function callHideColumns(downloadPatameters,modelsCount,hiddenModelsCount)
    {
        var DownloadPatameters = downloadPatameters;
        var ModelsCount = modelsCount;
        var HiddenModelsCount = hiddenModelsCount;
        hideColumns(DownloadPatameters,ModelsCount,HiddenModelsCount);
    }

    function hideColumns(downloadPatameters,modelsCount,hiddenModelsCount)
    {
        //debugger;
        var DownloadPatameters = downloadPatameters;
        var ModelsCount = modelsCount;
        var HiddenModelsCount = hiddenModelsCount;
        var hiddenColumns = document.getElementById(DownloadPatameters);
        var modelsCountElement = document.getElementById(ModelsCount);
        var hiddenModelsCountElement = document.getElementById(HiddenModelsCount);
        
        
        
        if(hiddenModelsCountElement != null && hiddenModelsCountElement.value != '' && hiddenModelsCountElement.value > 0)
        {
            if(hiddenColumns != null)
            {
                var hiddenModels = hiddenColumns.value;
                var arrayHiddenModels = hiddenModels.split(',');
                for(i=0; i< arrayHiddenModels.length; i++)
                {
                    var columnId = "model_" + arrayHiddenModels[i];
                    var column = document.getElementById(columnId);
                    if(column != null)
                    {
                        column.style.display = 'none';
                        column.style.visibility = 'hidden';
                    }
                }
            }
        }
    }

    function hideUnhide(imageButton,btnGetResults,btnResetFilter)
    {
      var BtnGetResults = btnGetResults;
      var BtnResetFilter = btnResetFilter;
      var upperTableVisibility = document.getElementById("upperTableVisibility");  
      if(upperTableVisibility != null)
      {
      
       if(upperTableVisibility.value == "true")
        {        
            hide(imageButton,btnGetResults,btnResetFilter);
        }
        else
        {        
            show(imageButton,btnGetResults,btnResetFilter);
        }
      }
    }

    function hide(imageButton,btnGetResults,btnResetFilter)
    {
       var BtnGetResults = btnGetResults;
       var BtnResetFilter = btnResetFilter;
       var panel = document.getElementById("checkboxes_panel");
       var btnUpdate = document.getElementById(BtnGetResults);
       var btnReset = document.getElementById(BtnResetFilter);
       
       var upperTableVisibility = document.getElementById("upperTableVisibility");  
       
       if(upperTableVisibility != null)
       {
            upperTableVisibility.value = "false";
       }
       
       if(panel != null)
       {
         panel.style.display = 'none';
         panel.style.visibility = 'hidden'; 
       } 
       if(btnUpdate != null)
       {
         btnUpdate.style.display = 'none';
         btnUpdate.style.visibility = 'hidden'; 
       }
       if(btnReset != null)
       {
         btnReset.style.display = 'none';
         btnReset.style.visibility = 'hidden'; 
       }
       imageButton.src = '/UI/Images/Hyundai_2.7_Prijzenpagina_Pulldown_DOWN_Button.jpg';
    }

    function show(imageButton,btnGetResults,btnResetFilter)
    {
       var BtnGetResults = btnGetResults;
       var BtnResetFilter = btnResetFilter;
       var panel = document.getElementById("checkboxes_panel");
       var btnUpdate = document.getElementById(BtnGetResults);
       var btnReset = document.getElementById(BtnResetFilter);
       var upperTableVisibility = document.getElementById("upperTableVisibility");  
       
       if(upperTableVisibility != null)
       {
            upperTableVisibility.value = "true";
       }
       
       if(panel != null)
       {
         panel.style.display = 'block';
         panel.style.visibility = 'visible'; 
       } 
       if(btnUpdate != null)
       {
          btnUpdate.style.display = 'block';
          btnUpdate.style.visibility = 'visible'; 
       }
       if(btnReset != null)
       {
          btnReset.style.display = 'block';
          btnReset.style.visibility = 'visible'; 
       }
       imageButton.src = '/UI/Images/Hyundai_2.7_Prijzenpagina_Pulldown_UP_Button.jpg';
    }

    function SelectionIsValid()
    {
        //debugger;
        var i = 0;
        var selModelCount = 0;
        
        while(1)
        {
            var columnName = "model_"+i;
            
            var column = document.getElementById(columnName);
            
            if(column != null)
            {
            
                if(column.style.display != 'none')
                {
                    selModelCount++;
                }
            }
            else
            {
                break;
            }
            i++;
        }
        
        if(selModelCount > 0 && selModelCount < 6)
        {
            return true;
        }
        else
        {
            alert('Kies maximaal 5 en minimaal 1 model(len) !');
            return false;
        }
    }

    function checkForDownload(modelsCount,hiddenModelsCount,errorMessage)
    {
        var ModelsCount = modelsCount;
        var HiddenModelsCount = hiddenModelsCount;
        var ErrorMessage = errorMessage;
        
        var toReturn = true;
        var modelsCountElement = document.getElementById(ModelsCount);
        var hiddenModelsCountElement = document.getElementById(HiddenModelsCount);

        var modelsForDownload = modelsCountElement.value - hiddenModelsCountElement.value;
        if (modelsForDownload <= 0 || modelsForDownload > 6)
        {
            toReturn = false;
            var errorMessageElement = document.getElementById(ErrorMessage);
            alert (errorMessageElement.value);
        }
        
        return toReturn;
    }


// Scripts from ServiceRequest.ascx

function GetExtScriptServReq(hiddenCheckNo){
    var hdnCheckNo = hiddenCheckNo;

    function CheckState(checkbox)
    {
        var hdnCheck = document.getElementById(hdnCheckNo);
        if(hdnCheck == null) return;
        
        if(checkbox.checked)
        {
            if(hdnCheck.value == "2")
            {
                checkbox.checked = false;
                alert('U kunt maximaal 2 aanvragen doen');
                return;
            }
            
            hdnCheck.value ++;
        }
        else
        {
            if(hdnCheck.value != "0")
            {
                hdnCheck.value --;
            }
        }
    }

    function AnyCheckboxesChecked()
    {
        if(document.getElementById(hdnCheckNo).value == "0" )
        {
            alert('U heeft nog geen keuze gemaakt');
            //alert('You have to select at least one');
            return false;
        }
    }

    function allownumbers(e)
    {
        var key = window.event ? e.keyCode : e.which;
        var keychar = String.fromCharCode(key);
        var reg = new RegExp("[0-9.]")
        
        if (key == 8)
        {
            keychar = String.fromCharCode(key);
        }
        if (key == 13)
        {
            key=8;
            keychar = String.fromCharCode(key);     
        }
        
        return reg.test(keychar);
    } 
}
    
function beginRequest(ModalProgress, UpdatePanel){
    var height = 0;
    var width = 0;
    
    var scrollTop = 0;
    var scrollLeft = 0;

    if (document.documentElement.clientHeight != '0'){
        height = document.documentElement.clientHeight;
        width = document.documentElement.clientWidth;
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
    }
    else if (document.body.clientHeight != '0') {
        height = document.body.clientHeight;
        width = document.body.clientWidth;
    }
    else{
        height = window.innerHeight;
        width = window.innerWidth;
    }

    var modalProgressElement = document.getElementById(ModalProgress + "_backgroundElement");      

    modalProgressElement.style.height = (height + scrollTop) + 'px';
    modalProgressElement.style.width = (width + scrollLeft) + 'px';  

    var updateProgressElement = document.getElementById(UpdatePanel);

    var divHeight = updateProgressElement.clientHeight;
    var divWidth = updateProgressElement.clientWidth;

    var finalHeight = (height-divHeight)/2;
    var finalWidth = (width-divWidth)/2;

    var version=navigator.appVersion;

    updateProgressElement.style.top = finalHeight;
    updateProgressElement.style.left = finalWidth;
}

function displayButton(control) {
    if (document.getElementById(control).style.visibility == "visible") 
    { 
        document.getElementById(control).style.visibility = "hidden";
    }
    else
    {
        document.getElementById(control).style.visibility = "visible";
    }
    
    return false;
}

/*Functionality for hover image on personen/bedrijfs auto bottom image*/
function showBotImage1(){  
    var img1 = document.getElementById("firstImage");
    var img2 = document.getElementById("firstImageOver"); 
    /*if(is_chrome || is_ffox){
       img.style.marginTop='-'+19+'px';     
       document.getElementById("middleMenuItem"+imgNum).style.marginTop=8+'px';        
    }*/
    img1.style.display = 'none'; 
    img2.style.display = 'block'; 
}

function hideBotImage1(){
    var img1 = document.getElementById("firstImage"); 
    var img2 = document.getElementById("firstImageOver");  
       
    img1.style.display = 'block'; 
    img2.style.display = 'none';  
}

function showBotImage2(){  
    var img1 = document.getElementById("secondImage");
    var img2 = document.getElementById("secondImageOver"); 
    /*if(is_chrome || is_ffox){
       img.style.marginTop='-'+19+'px';     
       document.getElementById("middleMenuItem"+imgNum).style.marginTop=8+'px';        
    }*/
    img1.style.display = 'none'; 
    img2.style.display = 'block'; 
}

function hideBotImage2(){
    var img1 = document.getElementById("secondImage"); 
    var img2 = document.getElementById("secondImageOver");  
       
    img1.style.display = 'block'; 
    img2.style.display = 'none';  
}

/* include of common css styles for google chrome */
function checkBrowser() {
	if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
		 var chromeCss = document.createElement("link");
	
		 chromeCss.rel = "stylesheet";
		 chromeCss.href = "/TemporaryFiles/Version2/css/commonCss_gChrome.css";
	
		 document.getElementsByTagName("head")[0].appendChild(chromeCss);
	}
}

/* This function wraps long words in tag cloud */
function wrapWord(text, divId)
{
    var newstr = "";
    var c;
    for (var i = 0; i<text.length; i++) {
        c = text.charAt(i);
        newstr = newstr + c;
        if (i<text.length-1) {
            newstr = newstr + "&#8203;";
        }
    }
    
    var div = document.getElementById(divId);
    div.innerHTML = newstr;
}
/* function which counts offset top & left of the element */
function getOffset( el )
{
    var _x = 0;
    var _y = 0;
    while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
        _x += el.offsetLeft - el.scrollLeft;
        _y += el.offsetTop - el.scrollTop;
        el = el.offsetParent;
    }
    return {
        top: _y, left: _x
    };
}

function setSearchBoxPosition() {
    var x = getOffset( document.getElementById('content_left') ).left;
    document.getElementById('divtyperesult').style.left = x + 226 + 'px';
}
