function gE(el) { return document.getElementById(el); } var minsize = 8; var maxsize = 20; function changeFontSize(size, el) { var defaultSize = 12; //gE('articleBodyID').style.fontSize = size + 'px'; if(!el) { if($('articleBodyID')) oChild = $('articleBodyID'); else oChild = null; } else { oChild = el; } if(oChild && oChild.style && !oChild.hasClassName('noFontResize')) { 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=620,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=450,height=400,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)); } var globalTimeout = ""; function showToolTipFader(texty,obj,doNotCloseAfter) { if($('tooltipX')) { document.body.removeChild($('tooltipX')); window.clearTimeout(globalTimeout); } var newdiv = document.createElement('div'); newdiv.id="tooltipX"; newdiv.style.display = "none"; //generating table inside div if(document.all) { var tbl = document.createElement('
| ');
else
var cell = document.createElement('td');
cell.setAttribute('colspan','3');
//create img
var nimg = document.createElement('img');
if(document.all)
nimg.src="images/pop-up/sageata_sus.gif";
else
nimg.src="images/pop-up/sageata_sus.png";
nimg.className="tooltipUpArrow";
nimg.id = "toolArrowU";
cell.appendChild(nimg);
row.appendChild(cell);
tbb.appendChild(row);
//end create up arrow td
//create top tooltip
var row = document.createElement('tr');
var cell = document.createElement('td');
cell.className="tooltipCorner_ul";
row.appendChild(cell);
var cell = document.createElement('td');
cell.className="tooltipBar_u";
row.appendChild(cell);
var cell = document.createElement('td');
cell.className="tooltipCorner_ur";
row.appendChild(cell);
tbb.appendChild(row);
//end create top tooltip
if(doNotCloseAfter) {
var imgClose = " | '); else var cell = document.createElement('td'); cell.setAttribute('colspan','3'); //create img var nimg = document.createElement('img'); if(document.all) nimg.src="images/pop-up/sageata_jos.gif"; else nimg.src="images/pop-up/sageata_jos.png"; nimg.className="tooltipDownArrow"; nimg.id = "toolArrowD"; cell.appendChild(nimg); row.appendChild(cell); tbb.appendChild(row); //end create down arrow td tbl.appendChild(tbb); newdiv.appendChild(tbl); newdiv.className ="tooltipDiv"; //add tooltip to document document.body.appendChild(newdiv); //position tooltip setPopupPosition(obj,newdiv); Effect.Appear(newdiv.id,{duration:.2}); //set fade out if(!doNotCloseAfter) globalTimeout = window.setTimeout('Effect.Fade(\'tooltipX\', {duration:.3,from:1.0, to:0.0})',2500); //======================================== } function setPopupPosition(el, x) { var direction = "up"; var position = Position.cumulativeOffset(el); var scrollY = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop; var viewHeight = (navigator.userAgent.toLowerCase().indexOf("safari") != -1 && window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight; x.style.left = position[0]-40 + "px"; var popupTop = position[1] + Element.getHeight(el); if((popupTop + x.offsetHeight > scrollY + viewHeight) && (position[1] - x.offsetHeight > scrollY)) { popupTop = position[1] - x.offsetHeight ; } if(popupTop > (scrollY + Element.getHeight(x) + 40 + Element.getHeight(el))) { direction="down"; $('toolArrowD').style.visibility = "visible"; } else { $('toolArrowU').style.visibility = "visible"; } if(direction == "up") x.style.top = (popupTop+30) + "px"; else x.style.top = (popupTop - Element.getHeight(x) - (document.all ? 15 : 25) - Element.getHeight(el)) + "px"; } function hidePopup() { if($('tooltipX')) { document.body.removeChild($('tooltipX')); window.clearTimeout(globalTimeout); } } function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false } if (str.indexOf(at,(lat+1))!=-1){ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false } if (str.indexOf(dot,(lat+2))==-1){ return false } if (str.indexOf(" ")!=-1){ return false } return true } function registerNewsletter(msg) { var emailField = $('nlEmail'); var email = emailField.value; if(!email.length || !(echeck(email))) { showToolTipFader(msg, emailField); } else { new Ajax.Request(document.getElementsByTagName('base')[0].href + 'index.html/ajaxgate|nlRegister', { 'method':'post', 'parameters':{'nlEmail':email}, 'onSuccess':function(transport) { showToolTipFader(transport.responseText, emailField); } } ); } } function setPopupPosition2(el, x) { var direction = "up"; var position = Position.cumulativeOffset(el); var scrollY = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop; var viewHeight = (navigator.userAgent.toLowerCase().indexOf("safari") != -1 && window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight; x.style.left = position[0]-40 + "px"; var popupTop = position[1] + Element.getHeight(el); if((popupTop + x.offsetHeight > scrollY + viewHeight) && (position[1] - x.offsetHeight > scrollY)) { popupTop = position[1] - x.offsetHeight ; } if(popupTop > (scrollY + Element.getHeight(x) + 40 + Element.getHeight(el))) { direction="down"; } if(direction == "up") x.style.top = (popupTop+30) + "px"; else x.style.top = (popupTop - Element.getHeight(x) - (document.all ? 15 : 25) - Element.getHeight(el)) + "px"; } function showFeedback(el) { el = $(el); if(!$('divFeedBack')) { var position = Position.cumulativeOffset(el); var fDiv = new Element('div', {'id':'divFeedBack', 'style':'display:none; top:'+(position[1]*1 + 15*1)+'px; left:'+(position[0] - 266)+'px;'}); var fTbl = new Element('table'); var fTbb = new Element('thead'); var fTr = new Element('tr'); var fTh = new Element('th', {'class':'fbTitle', 'colspan':'2'}).update('Feedback'); fTr.insert(fTh); fTbb.insert(fTr); fTbl.insert(fTbb); fTbb = new Element('tbody'); fTr = new Element('tr'); fTh = new Element('td').update('Email'); fTr.insert(fTh); fTh = new Element('td'); var fEmail = new Element('input', {'name':'feedbackEmail', 'class':'formular01'}); fTh.insert(fEmail) fTr.insert(fTh); fTbb.insert(fTr); fTr = new Element('tr'); fTh = new Element('td').update('Message'); fTr.insert(fTh); fTh = new Element('td'); var fMessage = new Element('textarea', {'name':'feedbackMessage', 'class':'formular01', 'style':'width:230px;'}); fTh.insert(fMessage) fTr.insert(fTh); fTbb.insert(fTr); fTr = new Element('tr'); fTh = new Element('td'); fTr.insert(fTh); fTh = new Element('td'); var sendButton = new Element('a', {'class':'butonMare01', 'href':'#', 'onclick':'sendFeedback(\'' + el.id + '\');'}).update('Send'); fTh.insert(sendButton) fTr.insert(fTh); fTbb.insert(fTr); fTbl.insert(fTbb); fDiv.insert(fTbl); $('header').insert(fDiv); } else { var fDiv = $('divFeedBack'); var position = Position.cumulativeOffset(el); fDiv.setStyle({top:(position[1]*1 + 15*1)+'px', left:(position[0] - 266)+'px'}); } Effect.toggle(fDiv, 'appear'); } function sendFeedback(el) { el = $(el); var ok = true; var parameters = new Object(); var fElements = $('divFeedBack').select('[name]'); fElements.each(function (fEl) { if(!fEl.value) { showToolTipFader('Please compleate this field', fEl); ok = false; throw $break; } else { parameters[fEl.name] = fEl.value; } }); if(ok) { new Ajax.Request(document.getElementsByTagName('base')[0].href + 'index.html/ajaxgate|feedback', { 'method':'post', 'parameters':parameters, 'onSuccess':function(transport) { $('divFeedBack').fade(); showToolTipFader(transport.responseText, el); } } ); } } function displayGuestLanguades() { new Effect.toggle('guestLang'); // $('guestLang').toggle(); } |