this.focus(); function goHome(){ window.location = document.getElementsByTagName('base')[0].href; } function getElementPosition(elemID) { var offsetTrail = document.getElementById(elemID); var offsetLeft = 0; var offsetTop = 0; while (offsetTrail) { offsetLeft += offsetTrail.offsetLeft; offsetTop += offsetTrail.offsetTop; offsetTrail = offsetTrail.offsetParent; } if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") { offsetLeft += document.body.leftMargin; offsetTop += document.body.topMargin; } return {left:offsetLeft, top:offsetTop}; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 0) { //// alert('here'); // fillSelect('catID3', arrValues, document.forms[formName].elements(selectName), formName); // } // // if (selectName.indexOf('3') > 0) { //// alert('here'); // fillSelect('catID4', arrValues, document.forms[formName].elements(selectName), formName); // } } else { s.parentElement.style.display = 'none'; } } function _fillSelect(selectName, arrValues, indexEl, formName) { if (formName == "") formName = "catEditFrm" d = document.forms[formName]; s = d.elements(selectName); // alert(indexEl); if (indexEl.options && indexEl.options.length) { var index = indexEl.options[indexEl.selectedIndex].value; // alert(selectName + " - " + index) s.options.length = 0; var k = 0; for (var i in arrValues[index]) { s.options[k++] = new Option(arrValues[index][i], i); } if (index == 0 || !k) { s.parentElement.style.display = 'none'; } else s.parentElement.style.display = 'inline'; if (selectName.indexOf('2') > 0) { fillSelect('catID3', arrValues, document.forms[formName].elements(selectName), formName); } } else s.parentElement.style.display = 'none'; } function popUp(urlToOpen) { // alert(urlToOpen); var x = (screen.width-400)/2; y = (screen.height-400)/2; OpenWin = this.open(urlToOpen, "CtrlWindow", "width=407,height=407, toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no, screenX="+x+", screenY="+y+", left="+x+", top="+y); } function displayShopsInCounty(SelElem){ var countyID = SelElem.options[SelElem.selectedIndex].value; for (var i in arrCounties) { document.getElementById('countyID_'+arrCounties[i]).style.display = 'none'; } document.getElementById('countyID_'+countyID).style.display = 'inline'; } function hideRefines(){ // alert('hidding..'); if(document.getElementById('RefineSection')) document.getElementById('RefineSection').style.visibility = 'hidden'; } function showRefines(){ // alert('showing..'); if(document.getElementById('RefineSection')) document.getElementById('RefineSection').style.visibility = 'visible'; } function showCategoryPicture(pathPhotoSubCategory, basePathPhoto){ if(pathPhotoSubCategory) imgSubCategory = ''; else imgSubCategory = ''; // alert(imgSubCategory); document.getElementById('categoryImageReceiver').innerHTML = imgSubCategory; } function showHideNewsletter(elem){ // alert('loginInsideFrm'); if( elem.value == 1) document.getElementById('newsletterDetailedInfo').style.display = 'inline'; else document.getElementById('newsletterDetailedInfo').style.display = 'none'; } function gE(elName) { // alert(document.getElementById(elName)); return document.getElementById(elName); } function ToggleMandatoryOrderDetails(el){ if(el.value == 1){ gE('judicialPersonInfo').style.display = 'none'; gE('physicalPersonInfo').style.display = ''; } else{ gE('judicialPersonInfo').style.display = ''; gE('physicalPersonInfo').style.display = 'none'; } // alert(gE('judicialPersonInfo').style.display); } function printProduct(articleID, strMenu) { var x = (screen.width-600)/2, y = (screen.height-500)/2; OpenWin = this.open(document.getElementsByTagName('base')[0].href+"categories|displayDetails?productID="+articleID+"&menu="+strMenu+"&printProduct=1", "CtrlWindow", "width=600,height=500,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no, screenX="+x+", screenY="+y+", left="+x+", top="+y); } function buildProductRank(rankRating, whereToAppend) { // var rank = $(document.createElement('div')); var rank = new Element('div'); var backgroundPosition = 80 - rankRating * 16; rank.setStyle({ 'backgroundImage':'url(images/backgrounds/rating.png)', 'backgroundPosition':'-' + backgroundPosition + 'px 0px', 'backgroundRepeat':'no-repeat', 'border':'none', 'height':'16px', 'width':'80px' }); whereToAppend.appendChild(rank); // console.log(rank, rankRating, backgroundPosition); } document.observe('dom:loaded', function(){ Dialogs.load(); Dialogs.quickCallDialog = new Dialog({ handle:'#dialogQuickCall', title:'Mesagerie rapida', ajax:{ url: document.getElementsByTagName('base')[0].href + 'ajaxgate|showQuickCall/', } }); }); function doQuickCall(){ // Dialogs.quickCallDialog var oForm = $(document.quickCallFrm).serialize({'hash': true}); // qoEmail = document.quickCallFrm.qcEmail; qoName = document.quickCallFrm.qcName; qoPhone = document.quickCallFrm.qcPhone; // if(Validation.get('validate-email').test(qoEmail.value) && qoEmail.value) { // } else { // showToolTipFader('Completati corect campul Email', qoEmail); // qoEmail.focus(); // return false; // } if(Validation.get('required').test(qoName.value)) { } else { showToolTipFader('Completati campul Nume', qoName); qoName.focus(); return false; } if(Validation.get('required').test(qoPhone.value)) { } else { showToolTipFader('Completati campul Telefon', qoPhone); qoName.focus(); return false; } new Ajax.Request(document.getElementsByTagName('base')[0].href + 'ajaxgate|showQuickCall', { method:'post', parameters: oForm, onSuccess: function(transport) { Dialogs.close(); Dialogs.alert('Cererea a fost trimisa cu succes. Veti fi contactat de un operator onSite.ro pentru a prelua detalii comenzii. Va multumim!'); }, onFailure: function(){} }); } 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(''); var tbb = document.createElement("tbody"); } else { var tbl = document.createElement('table'); var tbb = document.createElement("tbody"); tbl.setAttribute('cellpadding','0'); tbl.setAttribute('cellspacing','0'); tbl.setAttribute('border','0'); } // create up arrow td var row = document.createElement('tr'); if(document.all) var cell = 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 = "Detaliu utilizator"; //create close tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=imgClose; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end close tooltip } //create middle tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=texty; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end middle tooltip //create bottom tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipCorner_bl"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_b"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipCorner_br"; row.appendChild(cell); tbb.appendChild(row); //end create bottom tooltip // create down arrow td var row = document.createElement('tr'); if(document.all) var cell = 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_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); } } String.prototype.trim = function() { var _ret = this.replace(/^\s+|\s+$/g, ''); return _ret.replace(/^(\ \;)+|(\ \;)+$/g, ''); }