function wopen(url, w_name, w_alt, w_width, w_height, topWin, leftWin, f_html){
menubar    = (f_html)? 'yes' : 'no';
scrollbars = (f_html)? 'yes' : 'no';
gWindow = window.open(url,w_name,"menubar="+menubar+",toolbar=no,scrollbars="+scrollbars+",status=no,width="+w_width+",height="+w_height+",top="+topWin+",left="+leftWin);
gWindow.focus();
if (gWindow){
        gWindow.document.open();
        gWindow.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN''http://www.w3.org/TR/html4/loose.dtd'><meta name='copyright' Content='Powered by Intercom'><meta name='keywords' content=''><meta name='description' content=''><html><head><title>"+w_alt+"</title></head><body style='background-color:#FFFFFF; margin:0; padding:0;'><a href='javascript:;' onclick='javascript:window.close();'><img src="+url+" id='popup' border='0' alt='Закрыть окно.' onload=\"ReWin('popup');\"></a><SCRIPT LANGUAGE='JavaScript' TYPE='text/javascript'>function ReWin (ImgName){imgW =document.getElementById(ImgName).width;imgH = document.getElementById(ImgName).height;imgW+=10;imgH+=29;window.resizeTo(imgW, imgH);}</SCRIPT></body></html>");
        gWindow.document.close();
}
}

function clearValue (){
        em = document.getElementById("email");
        if (em) {
                em.value = ''
                em.focus();
        };
}
function selectTours (el){
        sel = document.getElementById("selTours");
if (el.checked == true){
        if (sel)sel.style.display = 'block';
        }
        else {
        if (sel)sel.style.display = 'none';
        }
}
function selectToursHref (){
        sel = document.getElementById("selTours");
        if (sel)sel.style.display = 'block';
}
function changeHomeImage (){
        ch = document.getElementById("homeImage");
        if (ch) ch.src = "/img/home.gif";
//        document.getElementById("gl").className = "grayLight";
}
function changeHomeImage_on (){
        ch = document.getElementById("homeImage");
        if (ch) ch.src = "/img/home.gif";
//        document.getElementById("gl").className = "grayOff";
}

function changeHomeImage_on_main (){
        ch = document.getElementById("homeImage");
        if (ch) ch.src = "/img/home_on.gif";
//        document.getElementById("gl").className = "grayLine";
}

function reserveTour (el,showmess,hidemess){
        sel = document.getElementById("reserve_form");
        hel = document.getElementById(el);
        tel = document.getElementById("reserve_trigger");
if (hel.checked == true){
        hel.checked = false;
        if (sel)sel.style.display = 'block';
        tel.innerHTML = hidemess;
        }
        else {
        hel.checked = true;
        if (sel)sel.style.display = 'none';
        tel.innerHTML = showmess;
        }
}
