var dimensions = {}; var openedSection = -1; // none opened so far var sliderState = -1; // None set, so feed on slider.getAttribute("state"); var heightFix = 0; reloadDimensions(); function reloadDimensions() { if(window.screenLeft) { //IE dimensions.getWindowX = window.screenLeft; dimensions.getWindowY = window.screenTop; heightFix = 0; } else if(window.screenX) { //Firefox dimensions.getWindowX = window.screenX; dimensions.getWindowY = window.screenY; heightFix = 4; } if(window.innerWidth) { //!IE dimensions.getViewportWidth = window.innerWidth; dimensions.getViewportHeight = window.innerHeight; dimensions.getHorizontalScroll = window.pageXOffset; dimensions.getVerticalScroll = window.pageYOffset; } else if (document.documentElement && document.documentElement.clientWidth) { //IE 6 with DOCTYPE dimensions.getViewportWidth = document.documentElement.clientWidth; dimensions.getViewportHeight = document.documentElement.clientHeight; dimensions.getHorizontalScroll = document.documentElement.scrollLeft; dimensions.getVerticalScroll = document.documentElement.scrollTop; } else if (document.documentElement && document.documentElement.clientWidth) { //IE 6 sans DOCTYPE dimensions.getViewportWidth = document.body.clientWidth; dimensions.getViewportHeight = document.body.clientHeight; dimensions.getHorizontalScroll = document.body.scrollLeft; dimensions.getVerticalScroll = document.body.scrollTop; } if(document.documentElement && document.documentElement.scrollWidth) { dimensions.getDocumentWidth = document.documentElement.scrollWidth; dimensions.getDocumentHeight = document.documentElement.scrollHeight; } else if (document.body.scrollWidth) { dimensions.getDocumentWidth = document.body.scrollWidth; dimensions.getDocumentHeight = document.body.scrollHeight; } } function openFull(p,n) { var r = null; r = window.open(p,n,'width='+screen.width+',height='+screen.height+',top='+0+',left='+0+','+'scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'); if(r!=null && window.focus) r.window.focus(); } function openSlider(forceSection, keepOpen) { var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); var opening = false; if (forceSection != undefined && forceSection != openedSection) keepOpen= true; if (orientation == "left") { if (slider.style.width == '21px' || slider.style.width == '' || keepOpen != undefined) { slider.style.width = slider.getAttribute('maxwidth') + 'px'; opening = true; } else { slider.style.width = '21px'; } } else if (orientation == "right") { if (slider.style.width == '21px' || slider.style.width == '' || keepOpen != undefined) { slider.style.width = slider.getAttribute('maxwidth') + 'px'; slider.style.left = (dimensions.getDocumentWidth - parseInt(slider.getAttribute('maxwidth'))) + "px"; opening = true; } else { slider.style.width = '21px'; slider.style.left = (dimensions.getDocumentWidth - 21) + "px"; } } else if (orientation == "bottom") { if (slider.style.height == '21px' || slider.style.height == '' || keepOpen != undefined) { slider.style.height = slider.getAttribute('maxwidth') + 'px'; slider.style.top = (dimensions.getDocumentHeight - parseInt(slider.getAttribute('maxwidth'))) + "px"; opening = true; } else { slider.style.height = '21px'; slider.style.top = (dimensions.getDocumentHeight - 21) + "px"; } } if (opening) {// lets show one section; sliderState = "open"; showSliderSection(forceSection); } else { // It's closing sliderState = "close"; showSliderSection(openedSection, true); } if (document.getElementById('close_slider')) document.getElementById('close_slider').style.visibility = sliderState == 'close' ? 'hidden' : 'visible'; } function showSliderSection(forceSection, hideAll) { var index = 0; if (forceSection == undefined) { if (openedSection == -1) openedSection = 0; } else openedSection = forceSection; var slider = document.getElementById('slider_' + index); document.getElementById('extra_window').setAttribute("state", sliderState); while (slider != undefined) { if (hideAll == true) slider.style.display = "none"; else slider.style.display = index == openedSection ? '' : 'none'; index++; var slider = document.getElementById('slider_' + index); } } function resizeContainer() { reloadDimensions(); var height = dimensions.getViewportHeight; var width = dimensions.getViewportWidth; var container = document.getElementById("core"); var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); if (top != undefined) { top.style.height= top.getAttribute("maxwidth") + "px"; height = height - parseInt(top.getAttribute("maxwidth")); } if (bottom != undefined) { bottom.style.height= bottom.getAttribute("maxwidth") + "px"; height = height - parseInt(bottom.getAttribute("maxwidth")); } if (left != undefined) { left.style.width= left.getAttribute("maxwidth") + "px"; width = width - parseInt(left.getAttribute("maxwidth")); } if (right != undefined) { right.style.width= right.getAttribute("maxwidth") + "px"; width = width - parseInt(right.getAttribute("maxwidth")); } container.style.width= width + 'px'; container.style.height= height + 'px'; } function resizePanel() { reloadDimensions(); hideScrollbar(); var height = dimensions.getViewportHeight; var width = dimensions.getViewportWidth; var content = document.getElementById("content_td"); var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); var reste = 0; var internal = (document.getElementById("internal").value == "1"); if (internal) { if (bottom != undefined) height = height - parseInt(bottom.getAttribute("maxwidth")); } if (left != undefined && right != undefined) { right.style.height = height + "px"; left.style.height = height + "px"; content.style.width = (width - parseInt(right.getAttribute("maxwidth")) - parseInt(left.getAttribute("maxwidth"))) + "px"; right.style.left = (width - parseInt(right.getAttribute("maxwidth")) - parseInt(left.getAttribute("maxwidth"))) + "px"; content.style.height = height + "px"; } if (left != undefined) { left.style.height = height + "px"; content.style.width = (width - parseInt(left.getAttribute("maxwidth"))) + "px"; content.style.height = height + "px"; if(navigator.appName != "Microsoft Internet Explorer") { left.style.top = "0"; left.style.position = "absolute"; left.style.width = document.getElementById("left_td").style.width; left.style.overflow = "hidden"; } } if (right != undefined) { right.style.height = height + "px"; content.style.width = (width - parseInt(right.getAttribute("maxwidth"))) + "px"; content.style.height = height + "px"; if(navigator.appName != "Microsoft Internet Explorer") { right.style.top = "0"; right.style.position = "absolute"; right.style.width = document.getElementById("right_td").style.width; right.style.overflow = "hidden"; } } if(document.getElementById("shopping") != undefined) document.getElementById("shopping").scrolling = "no"; } function resizeSlider() { reloadDimensions(); hideScrollbar(); var height = dimensions.getViewportHeight - 40; var width = dimensions.getViewportWidth; var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); slider.style.display = "none"; if (orientation == "left" || orientation == "right") { slider.style.height = height + 'px'; } else { slider.style.height = "21px"; slider.style.width = width + "px"; } if (orientation == "right") { //alert(dimensions.getViewportWidth); slider.style.left = (dimensions.getDocumentWidth - 21) + "px"; } else if (orientation== "bottom") { slider.style.top = (dimensions.getDocumentHeight - 21) + "px"; } if (slider.getAttribute("state") == "open") openSlider(undefined, true); slider.style.display = ""; } function update(myPage) { var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); var reference = "", lang = ""; if (left != undefined && (left.innerHTML == "" || left.getAttribute("static") == "0")) { reference += "left|" + left.getAttribute("reference") + "@@@"; lang = left.getAttribute("lang"); } if (right != undefined && (right.innerHTML == "" || right.getAttribute("static") == "0")) { reference += "right|" + right.getAttribute("reference") + "@@@"; lang = right.getAttribute("lang"); } if (bottom != undefined && (bottom.innerHTML == "" || bottom.getAttribute("static") == "0")) { reference += "bottom|" + bottom.getAttribute("reference") + "@@@"; lang = bottom.getAttribute("lang"); } if (top != undefined && (top.innerHTML == "" || top.getAttribute("static") == "0")) { reference += "top|" + top.getAttribute("reference") + "@@@"; lang = top.getAttribute("lang"); } var leftDone = false; var rightDone = false; var bottomDone = false; var topDone = false; if (reference != "") { var xmlHttp = getAjaxObj(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { if(xmlHttp.responseText) { ajaxText = xmlHttp.responseText.replace(/\r|\n/g, ""); // prompt("", ajaxText); var divs = ajaxText.split("@@@"); for(var i = 0; i < divs.length; i++) { var info = divs[i].split("|"); if (info.length == 2) { document.getElementById(info[0] + "_panel").innerHTML = info[1]; if (info[0] == "top") topDone = true; if (info[0] == "bottom") bottomDone = true; if (info[0] == "left") leftDone = true; if (info[0] == "right") rightDone = true; } } if (!topDone && top != undefined) top.innerHTML = ""; if (!bottomDone && bottom != undefined) bottom.innerHTML = ""; if (!leftDone && left != undefined) left.innerHTML = ""; if (!rightDone && right != undefined) right.innerHTML = ""; } } } xmlHttp.open("POST","/script/hybrid/hybrid.loader.php"); xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlHttp.send("reference=" + reference + "&mypage=" + myPage + "&lang=" + lang); } //if (top.hybrid) //top.hybrid.switchPage(myPage); } if(!window.Node) { var Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_FRAGMENT_NODE: 11 }; } function registerOnLoadFunction(f) { var currentOnLoad = window.onload; if (typeof window.onload != "function") { window.onload = f; } else { window.onload = function() { currentOnLoad(); f(); } } } function getElementsByClassName(classname, node, tagname){ if(!node) node = document; else if (typeof node == "string") node = document.getElementById(node); if(!tagname) tagname = "*"; var loopNodes = node.getElementsByTagName(tagname); var foundNodes = []; for(var i = 0; i < loopNodes.length; i++) { var currentNodeClassesString = loopNodes[i].className; if(!currentNodeClassesString) continue; if(currentNodeClassesString == classname) { foundNodes.push(loopNodes[i]); continue; } var whiteSpaceRegex = /\s+/; if(!whiteSpaceRegex.test(currentNodeClassesString)) continue; var currentNodeClassesArray = currentNodeClassesString.split(whiteSpaceRegex); for(var i = 0; i < currentNodeClassesArray.length; i++) { if(currentNodeClassesArray[i] == classname) foundNodes.push(loopNodes[i]); } } return foundNodes; } function openPopup(url, popupWidth, popupHeight, popupAlign, popupVAlign, popupScrollbars, popupResizable) { var r = null; var width, height, scrollbars, resizable, top, left; popupWidth= String(popupWidth); popupHeight= String(popupHeight); width = (popupWidth.substr(popupWidth.length-1, 1) == "%") ? parseInt(popupWidth.substr(0, popupWidth.length - 1)) * screen.width / 100 : parseInt(popupWidth); height = (popupHeight.substr(popupHeight.length-1, 1) == "%") ? parseInt(popupHeight.substr(0, popupHeight.length - 1)) * screen.height / 100 : parseInt(popupHeight); switch(popupAlign) { case "left": left = 0; break; case "center": left = (screen.width - width) / 2 break; case "right": left = screen.width - width; break; default: left = 0; } switch(popupVAlign) { case "top": top = 0; break; case "middle": top = (screen.height - height) / 2 break; case "bottom": top = screen.height - height; break; default: top = 0; } scrollbars = (popupScrollbars == "yes") ? 1 : 0; resizable = (popupResizable == "yes") ? 1 : 0; r = window.open(url, "virtualpaper", "width="+width+",height="+height+",top="+top+",left="+left+","+"scrollbars="+scrollbars+",toolbar=no,location=no,status=no,menubar=no,resizable="+resizable+",dependent=no"); if(r!=null && window.focus) r.window.focus(); } function gotoPage(page) { document.getElementById('core').flashGotoPage(page); } //Bookmark function urlReWrite(nbPage){ window.location = "#" + nbPage; } function utf8_encode (argString) { // http://kevin.vanzonneveld.net // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: sowberry // + tweaked by: Jack // + bugfixed by: Onno Marsman // + improved by: Yves Sucaet // + bugfixed by: Onno Marsman // + bugfixed by: Ulrich // + bugfixed by: Rafal Kukawski // * example 1: utf8_encode('Kevin van Zonneveld'); // * returns 1: 'Kevin van Zonneveld' if (argString === null || typeof argString === "undefined") { return ""; } var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n"); var utftext = "", start, end, stringl = 0; start = end = 0; stringl = string.length; for (var n = 0; n < stringl; n++) { var c1 = string.charCodeAt(n); var enc = null; if (c1 < 128) { end++; } else if (c1 > 127 && c1 < 2048) { enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128); } else { enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128); } if (enc !== null) { if (end > start) { utftext += string.slice(start, end); } utftext += enc; start = end = n + 1; } } if (end > start) { utftext += string.slice(start, stringl); } return utftext; } function base64_encode (data) { var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } data = this.utf8_encode(data + ''); do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); switch (data.length % 3) { case 1: enc = enc.slice(0, -2) + '=='; break; case 2: enc = enc.slice(0, -1) + '='; break; } return enc; } //Subscription function openSubscription(url,clientID){ var r = null; var width, height, top, left, cIDEncode; width = 300; height = 200; left = (screen.width - width) / 2 top = (screen.height - height) / 2 cIDEncode = base64_encode(clientID); //alert(cIDEncode); r = window.open(url+"?c="+encodeURIComponent(cIDEncode), "Subscription", "width="+width+",height="+height+",top="+top+",left="+left+",scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no"); if(r!=null && window.focus) r.window.focus(); } //SHARING function getPubURL() { var u, h = location.hash; if(h) { h = h.substring(1); if(!isNaN(h) && parseInt(h) > 0) { var pathname = location.pathname; var lastChars = pathname.substring(location.pathname.length - 5); if(lastChars.toLowerCase() != ".html") { var lastChar = pathname.substring(pathname.length - 1); var addSlash = (lastChar == "/") ? false : true; u = location.protocol + location.host + pathname + ((addSlash) ? "/" : "") + h + ".html" + location.search; } else { pathname = pathname.substring(0, pathname.lastIndexOf("/")); u = location.protocol + location.host + pathname + "/" + h + ".html" + location.search; } } } if(u == null) u = location.href; return u; } function delicious(){ var u = getPubURL(); window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=700,height=400'); } function stumble(){ var u = getPubURL(); window.open('http://www.stumbleupon.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)); } function newsvine(){ var u = getPubURL(); //window.open('http://www.newsvine.com/_tools/seed?popoff=0&u=http://vlatko.users.sbb.co.yu/aka/javascript.html'); window.open('http://www.newsvine.com/_wine/save?popoff=0&u='+encodeURIComponent(u)); } function digg(text){ var u = getPubURL(); //http://digg.com/submit?url=http://flashden.net/item/digg-button-for-flash/20446&title=Digg%20button%20for%20flash%20websites&bodytext=Let%20visitors%20dig%20your%20flash%20websites!%20Can%20you%20digg%20it?&media=news&topic=design var bodytext=text; window.open('http://digg.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)+'&bodytext='+bodytext); } function furl(){ var u = getPubURL(); window.open('http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(document.title)); } function netscape(){ var u = getPubURL(); window.open('http://www.netscape.com/submit/?U='+encodeURIComponent(u)+'&T='+encodeURIComponent(document.title)); } ///////////////////////////////// function technorati(){ var u = getPubURL(); window.open('http://technorati.com/faves?add='+encodeURIComponent(u)); } function google(){ var u = getPubURL(); window.open('http://www.google.com/bookmarks/mark?op=add&hl=en&bkmk='+encodeURIComponent(u)+'&annotation=&labels=&title='+encodeURIComponent(document.title)); } function yahoo(comment){ var u = getPubURL(); d=comment; window.open('http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+encodeURIComponent(document.title)+'&d='+encodeURIComponent(d)+'&u='+encodeURIComponent(u)); } function reddit(){ var u = getPubURL(); window.open('http://reddit.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)); } function facebook(text) { var u = getPubURL(); t=document.title; bodytext=text; window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436') } function facebook(title, text) { var u = getPubURL(); t=title; bodytext=text; window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436') } function myspace(comment){ var u = getPubURL(); t=document.title; c=comment; window.open('http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(t) + '&c=' + encodeURIComponent(c) + '&u=' + encodeURIComponent(u)); } function slashdot(){ var u = getPubURL(); window.open('http://slashdot.org/bookmark.pl?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)); } function blinklist(){ var u = getPubURL(); window.open('http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Tag=&Url='+encodeURIComponent(u)+'&Title='+encodeURIComponent(document.title)); } function spurl(){ var u = getPubURL(); window.open('http://www.spurl.net/spurl.php?v=3&tags=&title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(u)); } function diigo(comment){ var u = getPubURL(); c=comment; window.open('http://www.diigo.com/post?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)+'&tag=&comments='+encodeURIComponent(c)); } function blogmarks(){ var u = getPubURL(); // blogmarks registration not finished window.open('http://blogmarks.net/my/new.php?mini=1&simple=1&url='+encodeURIComponent(u)+'&content=&public-tags=&title='+encodeURIComponent(document.title)); } function simpy(comment){ var u = getPubURL(); c=comment; window.open('http://www.simpy.com/simpy/LinkAdd.do?title='+encodeURIComponent(document.title)+'&tags=¬e='+encodeURIComponent(c)+'&href='+encodeURIComponent(u)); } function twitthis(){ var u = getPubURL(); window.open("http://twitthis.com/twit?url="+encodeURIComponent(u)+"&title="+((document.title) ? encodeURIComponent(document.title.replace(/^\s*|\s*$/g,'')) : ""), "TwitThisPop", "width=600, height=500, location, status, scrollbars, resizable"); } function jumptags(){ var u = getPubURL(); window.open('http://www.jumptags.com/add/?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)); } function hideScrollbar() { // alert("ici:" + document.body.style.overflow); document.body.style.overflow = "hidden"; } function prepareSession(minigw, core, divId, width, height, version, express) { vars.remote_addr = (ip == undefined) ? "" : ip; var over = ""; try { if (overRef != undefined) if (overRef != "") over = overRef; } catch(e) { } vars.http_referer = over == "" ? document.referrer : over; // vars.http_referer = document.referrer; if(strpos (vars.http_referer, "&mode=fembed")) vars.http_referer = "http://static.ak.facebook.com/common/referer_frame.php"; //alert(document.referrer); if (window.location.hash.indexOf("#") > -1) { var page = parseInt(window.location.hash.replace("#", "")); if (page != NaN) { if (page > 0) vars.gotopage = page; } } //alert(vars.http_referer + " - " + vars.remote_addr); swfobject.embedSWF(core, divId, width, height, version, express, vars, params, attributes ); } function getAjaxObj() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return(xmlHttp); } function strpos (haystack, needle, offset) { var i = (haystack + '').indexOf(needle, (offset || 0)); return i === -1 ? false : i; }