var OpenMenu=new Array(); var OpenMenu2=new Array(); var Timer=null; var M$ = navigator.appName.indexOf("Microsoft")!=-1; var O$ = navigator.appName.indexOf("Opera")!=-1; function findObj(theObj, theDoc) { var p, i, foundObj; if(!theDoc) theDoc = document; if( (p = theObj.indexOf("?")) > 0 && parent.frames.length) { theDoc = parent.frames[theObj.substring(p+1)].document; theObj = theObj.substring(0,p); } if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj]; for (i=0; !foundObj && i < theDoc.forms.length; i++) foundObj = theDoc.forms[i][theObj]; for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) foundObj = findObj(theObj,theDoc.layers[i].document); if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj); return foundObj; } function clearTimer() { if (Timer) { clearTimeout (Timer); Timer = null; } } function setTimer() { Timer = window.setTimeout('CloseAll(0)', 500); // Timer = window.setTimeout('CloseMenu(10)', 0); } function ShowMenu(id, left, level, id2) { id1 = document.getElementById(id); id2 = document.getElementById(id2); id3 = document.getElementById("i" + id.substr(1)); id4 = document.getElementById("a" + id.substr(1)); clearTimer(); //if (IExplorer4) return ShowMenuE(id1, left, level, id2, id3, id4); //if (Netscape6) // return ShowMenuN(id, left, level); return true; } function ShowMenuE(id, left, level, id2, id3, id4) { //elem = eval (id); elem = id; elem2 = id2; if (OpenMenu[level] && OpenMenu[level]!=elem) CloseAll(level); // if (document.all.item(id) == null) if (id == null) return true; if (typeof(left) == "number") { if (document.body.clientWidth - 776 > 0) elem.style.pixelLeft = parseInt((document.body.clientWidth-776)/2) + left; if (id3) id3.style.pixelLeft = parseInt((document.body.clientWidth-776)/2) + left; else elem.style.pixelLeft = left; if (id3) id3.style.pixelLeft = left; } id5 = document.getElementById("c" + elem.id.substr(1)); if (id3) { if (id5) id5.appendChild(id3); id3.style.display = "block"; id3.style.visibility = "visible"; id3.style.pixelLeft = elem.style.pixelLeft + 1; } elem.style.display = "block"; elem.style.visibility = "visible"; if (id3) { id3.style.width = elem.offsetWidth - 1; id3.style.height = elem.offsetHeight - 1; } // elem.style.zIndex = "99"; elem2.style.display = "none"; elem2.style.visibility = "hidden"; if (id4) id4.style.display = "block"; // window.alert (elem.offsetWidth); OpenMenu[level]=elem; OpenMenu2[level]=elem2; return false; } function ShowMenuN(id, left, level) { if (OpenMenu[level] && OpenMenu[level]!=id) CloseAll(level); elem = document.getElementById(id); if (elem == undefined) return true; if (window.innerWidth - 776 > 0) elem.style.left = parseInt((window.innerWidth-776)/2) + left; else elem.style.left = left; elem.style.visibility = "visible"; elem.style.display = "block"; OpenMenu[level]=id; return false; } function CloseMenu(level,delay) { //if (IExplorer4) if (delay) { clearTimer(); // Timer = window.setTimeout("CloseMenuE(" + level + ");" ,500); } else return CloseMenuE(level); //if (Netscape6) // return CloseMenuN(level); return true; } function CloseMenuE(level) { if (OpenMenu[level]) { OpenMenu[level].style.display = "none"; OpenMenu[level].style.visibility = "hidden"; id = document.getElementById("i" + OpenMenu[level].id.substr(1)); if (id) { id.style.display = "none"; document.body.appendChild(id); } id = document.getElementById("a" + OpenMenu[level].id.substr(1)); if (id) id.style.display = "none"; OpenMenu2[level].style.display = "block"; OpenMenu2[level].style.visibility = "visible"; } OpenMenu[level]=null; OpenMenu2[level]=null; } function CloseMenuN(level) { if (OpenMenu[level]) { document.getElementById(OpenMenu[level]).style.visibility = "hidden"; document.getElementById(OpenMenu[level]).style.display = "none"; } OpenMenu[level]=null; } function CloseAll(level) { clearTimer(); for (i=level; i (document.body.clientHeight-Header.offsetHeight)) document.body.scrollTop = targetPos-Header.offsetHeight; else document.body.scrollTop = docLength-document.body.clientHeight; CloseAll(0); return false; } function ScrollPriceHeader() { if (document.body.scrollTop>88) { Header.style.top = document.body.scrollTop-88; var i=0; while (elem=document.all.item("grouplist"+i++)) elem.style.top = document.body.scrollTop+34; // ®Ј« ў«Ґ­ЁҐ §¤Ґбм } else { Header.style.top = 0; var i=0; while (elem=document.all.item("grouplist"+i++)) elem.style.top = 122; // Ё §¤Ґбм ⮦Ґ ®Ј« ў«Ґ­ЁҐ } } function ShowHide(elem) { if (document.getElementById(elem).style.display == "none") document.getElementById(elem).style.display = "block"; else document.getElementById(elem).style.display = "none"; } function Show(elem) { id1 = findObj(elem); id1.style.display = "block"; id1.style.visibility = "visible"; } function Hide(elem) { id1 = findObj(elem); id1.style.display = "none"; id1.style.visibility = "hidden"; } function doLiteOn(obj) { obj.style.backgroundImage = "url(i/w6.gif)"; } function doLiteOff(obj) { obj.style.backgroundImage = "url(i/w2.gif)"; } function simplePreload() { var args = simplePreload.arguments; document.imageArray = new Array(args.length); for(var i=0; i 1) document.getElementById("r" + (idx - 1) + "r").className = "r1pr"; if (x < tbr.cells.length - 3) document.getElementById("r" + (idx + 1) + "l").className = "r1pl"; document.getElementById("tt_" + idx).style.display = "none"; } elem.parentNode.className = "r1a"; idx = parseInt(elem.parentNode.id.substr(1,elem.parentNode.id.length - 2)); document.getElementById("r" + idx + "l").className = "r1al"; document.getElementById("r" + idx + "r").className = "r1ar"; if (idx > 1) document.getElementById("r" + (idx - 1) + "r").className = "r1sr"; if (elem.parentNode.cellIndex < tbr.cells.length - 3) document.getElementById("r" + (idx + 1) + "l").className = "r1sl"; document.getElementById("tt_" + idx).style.display = ""; // tbr.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.height = tbh; return false; } function open_sem(elem) { window.open(elem.href,elem.target ? elem.target : "_ute_seminar","width=460,height=316,resizable=no,toolbar=0,location=0,status=no,menubar=0,directories=0,scrollbars=no").focus(); return false; } var slo = {}; function getSpo(id,force_open) { var tmp = document.getElementById(id); if (tmp) { if (tmp.className == "smc" || force_open) { tmp = document.getElementById("sd_" + id.substr(3)); if (tmp) { if (tmp.innerHTML || tmp.getAttribute("noContent")) { tmp.style.display = ""; document.getElementById(id).className = "smo"; } else { var dcity = id.substr(id.indexOf("_") + 1); tmp = dcity.indexOf("_"); var cntr = dcity.substr(tmp + 1); dcity = dcity.substr(0,tmp); if (!slo[dcity + "_" + cntr]) { slo[dcity + "_" + cntr] = true; tmp = document.createElement("SCRIPT"); tmp.src = "/get_spo.php?dc=" + dcity + "&cntr=" + cntr; document.body.appendChild(tmp); window.setTimeout("slo[\"" + dcity + "_" + cntr + "\"] = false;",20000); } } } } else { tmp.className = "smc"; tmp = document.getElementById("sd_" + id.substr(3)); if (tmp) tmp.style.display = "none"; } } tmp = allSpoOpened(); setExpandName(tmp[1]); return false; } function getAllSpo() { var tbr = document.getElementById("atabs"); if (tbr) { var tmp = allSpoOpened(); tmp[0] = document.getElementById("t_" + tmp[0].substr(2)); if (tmp[0]) { for (var x = 0; x < tmp[0].childNodes.length; x++) if (tmp[0].childNodes[x] && tmp[0].childNodes[x].tagName && tmp[0].childNodes[x].tagName == "DIV") { if (tmp[0].childNodes[x].firstChild && tmp[0].childNodes[x].firstChild.id && tmp[0].childNodes[x].firstChild.id.substr(0,3) == "sc_") getSpo(tmp[0].childNodes[x].firstChild.id,!tmp[1]); } } setExpandName(!tmp[1]); } return false; } function allSpoOpened() { var ret = new Array(false,false); var tbr = document.getElementById("atabs"); if (tbr) { for (var x = 0; x < tbr.cells.length; x++) if (tbr.cells[x].firstChild.className == "s1a") { ret[0] = tbr.cells[x].firstChild.id; var tmp = document.getElementById("t_" + ret[0].substr(2)); if (tmp) { for (x = 0; x < tmp.childNodes.length; x++) if (tmp.childNodes[x] && tmp.childNodes[x].tagName && tmp.childNodes[x].tagName == "DIV") { if (tmp.childNodes[x].firstChild && tmp.childNodes[x].firstChild.id && tmp.childNodes[x].firstChild.id.substr(0,3) == "sc_") { if (tmp.childNodes[x].firstChild.className == "smc") { ret[1] = false; break; } else ret[1] = true; } } } break; } return ret; } else return false; } function setExpandName(opn) { var tmp = document.getElementById("allSpo"); if (tmp) tmp.innerHTML = (opn ? "свернуть все" : "развернуть все"); } function getSpoCntrs(val) { var tmp = document.forms["qs"].elements; tmp["cntr"].disabled = true; tmp["tn"].disabled = true; tmp["tn"].selectedIndex = 0; for (var x = tmp["cntr"].length - 1; x >= 0; x--) tmp["cntr"].remove(x); for (var x = tmp["tn"].length - 1; x > 0; x--) tmp["tn"].remove(x); tmp["dt_from"].value = ""; tmp["dt_to"].value = ""; tmp = document.getElementById("dis_cd"); if (tmp) tmp.style.display = ""; tmp = document.createElement("SCRIPT"); tmp.src = "/get_spohdrs.php?dc=" + val; document.body.appendChild(tmp); return; } function getSpoHdrs(el) { el.disabled = true; var tmp = el.form.elements["tn"]; tmp.disabled = true; tmp.selectedIndex = 0; for (var x = tmp.length - 1; x > 0; x--) tmp.remove(x); el.form.elements["dt_from"].value = ""; el.form.elements["dt_to"].value = ""; tmp = document.getElementById("dis_cd"); if (tmp) tmp.style.display = ""; tmp = el.form.elements["city_dep"]; for (x = tmp.length - 1; x >= 0; x--) if (tmp[x].checked) { x = tmp[x].value; break; } if (x > 0 && el.value) { tmp = document.createElement("SCRIPT"); tmp.src = "/get_spohdrs.php?dc=" + x + "&cntr=" + el.value; document.body.appendChild(tmp); return; } else { tmp = document.getElementById("dis_cd"); if (tmp) tmp.style.display = "none"; el.disabled = false; el.form.elements["tn"].disabled = false; } } function spoDates(val) { var dtfrom = ""; var dtto = ""; if (dts) { if (dts[val]) { dtfrom = dts[val][0]; dtto = dts[val][dts[val].length - 1]; } else { dtfrom = dts[0][0]; dtto = dts[0][1]; } if (dtfrom) { dtfrom = dtfrom.split("-"); document.forms["qs"].elements["dt_from"].value = dtfrom[2] + "." + dtfrom[1] + "." + dtfrom[0]; } if (dtto) { dtto = dtto.split("-"); document.forms["qs"].elements["dt_to"].value = dtto[2] + "." + dtto[1] + "." + dtto[0]; } } } function rollMB(x,i,to) { var els = $("#mb_over" + x + " > div"); if (els.length > i) { $(els.get(i > 0 ? i - 1 : els.length - 1)).fadeOut(1100); $(els.get(i)).fadeIn(1100); i++; window.setTimeout("rollMB(" + x + "," + (i >= els.length ? 0 : i) + "," + to + ")",to); /* // увеличиваем счетчик просмотров показанного баннера $("").appendTo("#body"); }*/ } } function openSearch() { var tmp = document.forms["qs"].elements; for (var x = tmp["city_dep"].length - 1; x >= 0; x--) if (tmp["city_dep"][x].checked) { x = tmp["city_dep"][x].value; break; } if (x >= 0 && tmp["cntr"].value) { x = "?country=" + tmp["cntr"].value + "&departFrom=" + (x == "2412" ? "" : x) + (tmp["tn"].value > 0 ? "&tour=" + tmp["tn"].value : "") + "&dateFrom=" + (tmp["dt_from"].value ? tmp["dt_from"].value.substr(6,4) + "-" + tmp["dt_from"].value.substr(3,2) + "-" + tmp["dt_from"].value.substr(0,2) : "") + "&dateTo=" + (tmp["dt_to"].value ? tmp["dt_to"].value.substr(6,4) + "-" + tmp["dt_to"].value.substr(3,2) + "-" + tmp["dt_to"].value.substr(0,2) : "") + "&target=_top"; location.href = document.forms["qs"].action + x; } } function ResizeAllBan() { var www = 0; var els = $("#mb_over1 > div"); if (els.length) { for (var x = 0; x < els.length; x++) { if (!www) { els.get(x).firstChild.rows[0].cells[0].firstChild.style.width = "50px"; els.get(x).firstChild.rows[0].cells[0].style.width = ""; els.get(x).firstChild.rows[0].cells[1].style.width = ""; els.get(x).firstChild.style.width = ""; els.get(x).style.width = ($("#mb_over1").width() - (M$ ? 15 : 0)) + "px"; www = els.get(x).offsetWidth; } } if (www) for (x = 0; x < els.length; x++) { els.get(x).style.width = www + "px"; els.get(x).firstChild.style.width = www + "px"; els.get(x).firstChild.rows[0].cells[0].style.width = Math.floor(www * .45) + "px"; els.get(x).firstChild.rows[0].cells[0].firstChild.style.width = Math.floor(www * .45) + "px"; els.get(x).firstChild.rows[0].cells[1].style.width = (www - Math.floor(www * .45)) + "px"; } } www = 0; els = $("#mb_over2 > div"); if (els.length) { for (var x = 0; x < els.length; x++) { if (!www) { els.get(x).firstChild.rows[0].cells[0].firstChild.style.width = "50px"; els.get(x).firstChild.rows[0].cells[0].style.width = ""; els.get(x).firstChild.rows[0].cells[1].style.width = ""; els.get(x).firstChild.style.width = ""; els.get(x).style.width = ($("#mb_over2").width() - (M$ ? 20 : 0)) + "px"; www = els.get(x).offsetWidth; } } if (www) for (x = 0; x < els.length; x++) { els.get(x).style.width = www + "px"; els.get(x).firstChild.style.width = www + "px"; els.get(x).firstChild.rows[0].cells[0].style.width = Math.floor(www * .45) + "px"; els.get(x).firstChild.rows[0].cells[0].firstChild.style.width = Math.floor(www * .45) + "px"; els.get(x).firstChild.rows[0].cells[1].style.width = (www - Math.floor(www * .45)) + "px"; } } www = 0; els = $("#mb_over3 > div"); if (els.length) { for (var x = 0; x < els.length; x++) { if (!www) { els.get(x).firstChild.rows[0].cells[0].firstChild.style.width = "50px"; els.get(x).firstChild.rows[0].cells[0].style.width = ""; els.get(x).firstChild.rows[0].cells[1].style.width = ""; els.get(x).firstChild.style.width = ""; els.get(x).style.width = ($("#mb_over3").width() - (M$ ? 20 : 0)) + "px"; www = els.get(x).offsetWidth; } } if (www) for (x = 0; x < els.length; x++) { els.get(x).style.width = www + "px"; els.get(x).firstChild.style.width = www + "px"; els.get(x).firstChild.rows[0].cells[0].style.width = Math.floor(www * .45) + "px"; els.get(x).firstChild.rows[0].cells[0].firstChild.style.width = Math.floor(www * .45) + "px"; els.get(x).firstChild.rows[0].cells[1].style.width = (www - Math.floor(www * .45)) + "px"; } } } function open_video(el,v,i,w,h,t) { var tmp = document.getElementById("_vid"); if (tmp) close_video(); var so = getPageSize(); tmp = document.createElement("DIV"); tmp.style.position = "absolute"; tmp.style.zIndex = 99999; tmp.style.top = 0; tmp.style.left = 0; tmp.style.width = (so[0]) + "px"; tmp.style.height = (so[1]) + "px"; tmp.style.background = "#AAA"; tmp.style.opacity = ".5"; tmp.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)"; document.body.appendChild(tmp); tmp = document.createElement("DIV"); tmp.style.position = "absolute"; tmp.style.zIndex = 999999; tmp.style.top = so[5] + Math.floor((so[3] - h) / 2) - 36; tmp.style.left = so[4] + Math.floor((so[2] - w - 1) / 2) - 10; tmp.style.width = (w + 51) + "px"; tmp.style.height = (h + 102) + "px"; tmp.innerHTML = "
закрыть" + t + "
"; tmp.innerHTML += "
"; document.body.appendChild(tmp); so = new SWFObject("/workdir/files/Flash/video_megapolus.swf?file=" + v + "&img=" + i, "banner", w + 4, h + 72, "8.0.0.0", "#ffffff"); so.addParam("allowScriptAccess", "always"); so.addParam("movie", "/workdir/files/Flash/video_megapolus.swf?file=" + v + "&img=" + i); so.addParam("menu", "false"); so.addParam("quality", "high"); so.addParam("scale", "noscale"); so.addParam("salign", "lt"); so.addParam("wmode", "transparent"); so.addParam("bgcolor", "#ffffff"); so.write("_vid"); return false; } function close_video() { var tmp = document.getElementById("_vid"); if (tmp) { tmp.parentNode.parentNode.removeChild(tmp.parentNode.previousSibling); tmp.parentNode.parentNode.removeChild(tmp.parentNode); } return false; } function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; myTop = window.pageYOffset; myLeft = window.pageXOffset; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; myTop = document.body.scrollTop; myLeft = document.body.scrollLeft; } else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){ // Explorer 6 strict mode xScroll = document.documentElement.scrollWidth; yScroll = document.documentElement.scrollHeight; myTop = document.documentElement.scrollTop; myLeft = document.documentElement.scrollLeft; } else { // Explorer Mac...would also work in Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; myTop = document.body.scrollTop; myLeft = document.body.scrollLeft; } /* var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else*/ if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } return [pageWidth,pageHeight,windowWidth,windowHeight,myLeft,myTop]; } function resFrm() { window.setTimeout(function(){ top.frames[top.frames.length - 1].window.setAgences(); },200); } var wbo = { objectType: 'iframe', width: '990', height: '750' }; var gal_current = false; function prepare_wherebuy() { document.body.style.overflowX = 'hidden'; wbo = { objectType: 'iframe', width: '990', height: '750' }; } function no_new_pg(el) { var tmp = document.getElementById('new-pga-big-img'); if (tmp && typeof(gal_loaded) == 'boolean' && gal_loaded) { // Новая фотогалерея, вывод карты туда if (gal_current) { // Показана карта, надо ее убрать, вывести фото tmp.removeChild(tmp.lastChild,true); gal_current.style.display = ''; gal_current = ''; $('div.corners').get(0).style.display = 'block'; el.innerHTML = 'Отель на карте'; } else { // Показано фото, надо вывести карту for (var x = 0; x < tmp.childNodes.length; x++) if (tmp.childNodes[x] && tmp.childNodes[x].tagName && tmp.childNodes[x].tagName == 'LI' && tmp.childNodes[x].className == 'active') { tmp.childNodes[x].style.display = 'none'; gal_current = tmp.childNodes[x]; } x = document.createElement('IFRAME'); x.width = tmp.offsetWidth; x.height = tmp.offsetHeight; x.border = 0; x.style.position = "relative"; x.style.zIndex = "999"; x.frameBorder = 0; x.setAttribute('scrolling',false); x.src = el.href + "&w=" + tmp.offsetWidth + "&h=" + tmp.offsetHeight; tmp.appendChild(x); $('div.corners').get(0).style.display = 'none'; el.innerHTML = 'Показать фото'; } return false; } else { hs.skin.contentWrapper = '
'+ '

' + document.getElementsByTagName('H1')[0].innerHTML + '

'+ ''+ 'закрыть'+ '
'+ '
'; window.setTimeout(hs_init,100); return true; } } function setCurrency(curr) { var el = document.getElementsByTagName("SPAN"); for (var x = 0; x < el.length; x++) { if (el[x].getAttribute("curr")) el[x].style.display = el[x].getAttribute("curr") == curr ? "" : "none"; if (el[x].getAttribute("curr_ctrl")) el[x].className = el[x].getAttribute("curr_ctrl") == curr ? "" : "href"; } }