$("#pop_month").click( function() { $("#pop_alltime_box").hide(); $("#pop_month_box").show("slow"); }); $("#pop_alltime").click( function() { $("#pop_month_box").hide(); $("#pop_alltime_box").show("slow"); }); $("#tab1").click( function() { event.returnValue = false; if(event.preventDefault) event.preventDefault(); $("#map").hide(); $("#categories").hide(); $("#search").show("slow"); }); $("#tab2").click( function() { event.returnValue = false; if(event.preventDefault) event.preventDefault(); $("#map").hide(); $("#categories").hide(); $("#search").show("slow"); }); $("#tab3").click( function() { event.returnValue = false; if(event.preventDefault) event.preventDefault(); $("#map").show("slow"); $("#categories").hide(); $("#search").hide(); }); $("#tab4").click( function() { event.returnValue = false; if(event.preventDefault) event.preventDefault(); $("#map").hide(); $("#categories").show("slow"); $("#search").hide(); }); $("#bShout").click( function() { $("#frm_shout").attr("action", "send_shout.php"); $("#frm_shout:first").submit(); $("#message").val(""); }); $("#bComment").click( function() { $("#frm_comment").attr("action", "send_comment.php"); $("#frm_comment:first").submit(); }); $("#bGalleryForm").click( function() { $("#galleryForm").toggle("slow"); }); $("#bGoogleEarth").click( function() { $("#gEarth").toggle("slow"); }); $("#bEurope").click( function() { $("#europe").toggle("slow"); }); $('#pdgfoto').hover(function () { this.src = 'http://www.worldcam.pl/images/hover.png'; }, function () { this.src = 'http://www.worldcam.pl/images/hover-out.gif'; }); $("#jqbookmark").click(function(e){ e.preventDefault(); var bookmarkUrl = this.href; var bookmarkTitle = this.title; if (window.sidebar) { // For Mozilla Firefox Bookmark window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,""); } else if( window.external || document.all) { // For IE Favorite window.external.AddFavorite( bookmarkUrl, bookmarkTitle); } else if(window.opera) { // For Opera Browsers alert('Naciśnij klawisze Ctrl+D aby dodać stronę do zakładek.'); return false; } else { alert('Proszę użyć funkcji dodawania do zakładek dostępnej w przeglądarce internetowej.'); return false; } }); this.screenshotPreview = function(){ /* CONFIG */ xOffset = 0; yOffset = 15; /* END CONFIG */ $("a.preview").hover(function(e){ this.t = this.title; this.title = ""; if (e.pageX - (screen.width - 960)/2 > 700) xOffset = -250; else xOffset = 0; var c = (this.t != "") ? "
" + this.t : ""; $("body").append("

url preview"+ c +"

"); $("#preview") .css("top",(e.pageY + yOffset) + "px") .css("left",(e.pageX + xOffset) + "px") .fadeIn("fast"); }, function(){ this.title = this.t; $("#preview").remove(); }); $("a.preview").mousemove(function(e){ if (e.pageX - (screen.width - 960)/2 > 700) xOffset = -250; else xOffset = 0; $("#preview") .css("top",(e.pageY + yOffset) + "px") .css("left",(e.pageX + xOffset) + "px"); }); }; function submit_enter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { send_shout(); return false; } else return true; } // LIVE SEARCH var xmlHttp; function showResult(str, stype, lang) { if (str.length<3) { var div = document.getElementById("livesearch"); div.innerHTML=""; div.style.borderWidth ="0px"; div.style.marginBottom="0px"; return } xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) return var url="js/livesearch.php?q=" + str + "&type="+ stype + "&l="+ lang + "&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",encodeURI(url),true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("livesearch"). innerHTML=xmlHttp.responseText; document.getElementById("livesearch"). style.border="1px solid #A5ACB2"; document.getElementById("livesearch"). style.marginBottom="20px"; } } function setParent(id, user) { document.getElementById("replyto").value=id; document.getElementById("replyuser").innerHTML= "Odpowiadasz użytkownikowi: " + user + ""; } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }