var newWindow=null;function BSelect(pSrc,pAr,pDest,idDestSel)
{var vyber=pSrc.selectedIndex
var hodnota=pSrc.options[vyber].value
var j=0
pDest.options[j++]=new Option(" — Model — ","")
for(var i=0;i<pAr.length;i++){if(parseInt(pAr[i][2])==parseInt(hodnota)){pDest.options[j++]=new Option(pAr[i][1],pAr[i][0]);if(idDestSel==pAr[i][0])pDest.options[j-1].selected=true;}}
pDest.options.length=j}
function setModel()
{src=document.getElementById('f_make');dest=document.getElementById('f_model');BSelect(src,Models,dest,dest.value);}
function showReserveForm()
{Effect.BlindDown('reserve_form');Effect.Shrink('reserve_button');}
function closeWin(){if(newWindow!=null){if(!newWindow.closed)
newWindow.close();}}
function popUpWin(url,type,strWidth,strHeight){closeWin();if(type=="fullScreen"){strWidth=screen.availWidth-10;strHeight=screen.availHeight-160;}
leftVal=(screen.width-strWidth)/2;topVal=(screen.height-strHeight)/2;var tools="";if(type=="standard"||type=="fullScreen")tools="resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";if(type=="console")tools="resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left="+leftVal+",top="+topVal+"";if(type=="scroll")tools="resizable,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left="+leftVal+",top="+topVal+"";newWindow=window.open(url,'newWin',tools);newWindow.focus();}
function hideadvert()
{document.getElementById('advert').style.display='none';document.getElementById('currency-select').style.visibility='visible';}
function showBasicSearch()
{document.getElementById('bsearch').style.display='block';document.getElementById('esearch').style.display='none';Set_Cookie('search',1,'/');}
function showExtSearch()
{document.getElementById('esearch').style.display='block';document.getElementById('bsearch').style.display='none';Set_Cookie('search',2,'/');}
function Set_Cookie(name,value,path,domain){var today=new Date();today.setTime(today.getTime());expires=1*24;var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")}

function pollVote(option, poll, lang) { 
var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
if (!xmlhttp) return false; 
url = '/poll_vote.php?id=' + option + '&poll='+poll+'&lang='+lang;
xmlhttp.open('GET', url); 
pollLoader(poll);
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4) {
var id = (xmlhttp.responseXML.getElementsByTagName('id'))[0].firstChild.data;
var html = (xmlhttp.responseXML.getElementsByTagName('html'))[0].firstChild.data;
var al = (xmlhttp.responseXML.getElementsByTagName('alert'))[0].firstChild.data;
if(al != '-'){alert(al);}
else document.getElementById('poll_' + id).innerHTML = html;
}
};
xmlhttp.send('');
return true;
}

function pollLoader(poll){
html = '<div class="pollloader">...</div>';
}

$(document).ready(function(){

$("#menu li").mouseover(function(){
$(this).find('div.submenu').css("display","block");
}).mouseout(function(){
$(this).find('div.submenu').css("display","none");
});

$("#menu li li.active").parent().parent().parent().addClass("active");
$('.hoverc').mouseover(function(){$(this).addClass("hover")}).mouseout(function(){$(this).removeClass("hover")});
$("#menu li.active").next().css("border-left-width","0");
$("#menu li.active").prev().css("border-right-width","0");
$("a[rel^=lightbox]").lightBox();
});

function writeFlash(a,b,c){document.write('<object CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"	width="'+b+'" height="'+c+'"><param name="movie" value="'+a+'"><param name="quality" value="high"><param name="wmode" value="transparent"><embed src="'+a+'" wmode="transparent" quality="high" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+b+'" height="'+c+'"></embed></object>')}

