function displayHF(link, el) { var myLightWindow = null; myLightWindow = new lightwindow({ dimensions : { image : {height : 250, width : 250}, page : {height : 585, width : 490}, inline : {height : 250, width : 250}, media : {height : 250, width : 250}, external : {height : 585, width : 490}, titleHeight : 25 }, hideFlash: true, overlay : { opacity : 0.7, image : 'images/lightwindow/black.png', presetImage : 'images/lightwindow/black-70.png' } }); if(link) { myLightWindow.activateWindow({ href: link, title: el.title }); } //alert($('lightwindow_content_scroll_div').getWidth()); } function gE(el) { return document.getElementById(el); } var minsize = 8; var maxsize = 20; function changeFontSize(size, el) { var defaultSize = 16; //gE('articleBodyID').style.fontSize = size + 'px'; if(!el) { if(gE('articleBodyID')) oChild = gE('articleBodyID'); else oChild = null; } else { oChild = el; } if(oChild && oChild.style) { oChild.style.fontSize = ((oChild.style.fontSize) ? ( (minsize < (parseInt(oChild.style.fontSize)*1 + size*1) && (parseInt(oChild.style.fontSize)*1 + size*1) < maxsize) ? parseInt(oChild.style.fontSize)*1 + size*1 : parseInt(oChild.style.fontSize) ) : defaultSize*1 + size*1) + 'px'; } if(oChild && oChild.hasChildNodes()) { var children = oChild.childNodes; for (var i = 0; i < children.length; i++) { changeFontSize(size, children[i]); } } else { return; } } function printerFriendly(urlToOpen) { var x = (screen.width-600)/2, y = (screen.height-400)/2; OpenWin = this.open(urlToOpen, "CtrlWindow", "width=600,height=400,toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=no, screenX="+x+", screenY="+y+", left="+x+", top="+y); } function recommend(urlRecommandForThisArticle) { var x = (screen.width-380)/2, y = (screen.height-340)/2; OpenWin = this.open(urlRecommandForThisArticle, "CtrlWindow", "width=500,height=500,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=0,status=0, screenX="+x+", screenY="+y+", left="+x+", top="+y); } /** * Sets a Cookie with the given name and value. * * name Name of the cookie * value Value of the cookie * [expires] Expiration date of the cookie (default: end of current session) * [path] Path where the cookie is valid (default: path of calling document) * [domain] Domain where the cookie is valid * (default: domain of calling document) * [secure] Boolean value indicating if the cookie transmission requires a * secure transmission */ function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } /** * Gets the value of the specified cookie. * * name Name of the desired cookie. * * Returns a string containing value of specified cookie, * or null if cookie does not exist. */ function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } /** * Deletes the specified cookie. * * name name of the cookie * [path] path of the cookie (must be same as path used to create cookie) * [domain] domain of the cookie (must be same as domain used to create cookie) */ function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } function delayedHidePromo() { var exdate=new Date(); exdate.setDate(exdate.getDate()+365); setCookie('OBsCultuRalPromo', $('promoID').value, exdate); Effect.BlindUp('divPromo', {duration:1}); } function showPromo() { if($("divPromo") && getCookie('OBsCultuRalPromo') != $('promoID').value) JSFX_FloatDiv("divPromo", -(screen.width/2 + 305), 250).flt(); } var ns = (navigator.appName.indexOf("Netscape") != -1); var d = document; var px = document.layers ? "" : "px"; function JSFX_FloatDiv(id, sx, sy) { $(id).style.display = 'block'; var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; window[id + "_obj"] = el; if(d.layers)el.style=el; el.cx = el.sx = sx;el.cy = el.sy = sy; el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;}; el.flt=function() { var pX, pY; pX = (this.sx >= 0) ? 0 : ns ? innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth; pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; if(this.sy<0) pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight; this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8; this.sP(this.cx, this.cy); t1 = setTimeout(this.id + "_obj.flt()", 1); //this.id + "_obj.flt()"; //el.innerHTML='Aveti la dispozitie' + counter + ' minute'; } return el; } function setupShareLinks(linksCSSclass) { var baseHref = document.getElementsByTagName('base')[0].href; var ajaxTo = baseHref + 'index.html' + '/mainpage|getShortUrl'; $$('.' + linksCSSclass).each(function(el) { Event.observe(el, 'click', function(event) { var icon = el.down('img'); icon.setAttribute('data-orig-src', icon.getAttribute('src')); icon.setAttribute('src', 'images/butoane/r0.gif'); new Ajax.Request(ajaxTo, { method:'post', parameters: {'url': escape(window.location.href) }, onSuccess: function(transport){ $$('.' + linksCSSclass).each(function(shareLink) { shareLink.setAttribute('href', shareLink.href + transport.responseText); shareLink.stopObserving('click'); }); icon.setAttribute('src', icon.getAttribute('data-orig-src')); //icon.writeAttribute('data-orig-src', '') }, onFailure: function(){ } }); event.stop(); return false; }); }); } // // fire all js here on page load // function pageInit() { // promo page showPromo(); // share links setupShareLinks('shareLink'); } Event.observe(window, 'load', pageInit, false);