var opacity = 100 var opacity2 = 0 var pageUnLoad = 0 var iframeSessions = '' var backCheck = '' var num = '' var drugWindow = 'message' var drag = 0 var mouseX =0 var mouseY =0 var myX = 150 var myY = 60 var stop_scroll_down=1 var stop_scroll=1 ajaxCheckLog=getXmlHttpRequestObject() // Detect if the browser is IE or not. // If it is not IE, we assume that the browser is NS. var IE = document.all?true:false var elementY = 0; var elementX = 0; // If NS -- that is, !IE -- then set up for mouse capture if (!IE) document.captureEvents(Event.MOUSEMOVE) // Set-up to use getMouseXY function onMouseMove document.onmousemove = getMouseXY; // Temporary variables to hold mouse x-y pos.s var tempX = 0 var tempY = 0 function GEBC(value) { var x = document.getElementsByTagName("*").length, found, to_run; for(i=0;i<=x;i++) { if(document.getElementsByTagName("*")[i]) { if(document.getElementsByTagName("*")[i].className == value ) { return document.getElementsByTagName("*")[i] } } } } // Main function to retrieve mouse x-y pos.s function getMouseXY(e) { if (IE) { // grab the x-y pos.s if browser is IE tempX = event.clientX + document.body.scrollLeft tempY = event.clientY + document.body.scrollTop } else { // grab the x-y pos.s if browser is NS tempX = e.pageX tempY = e.pageY } // catch possible negative values in NS4 if (tempX < 0){tempX = 0} if (tempY < 0){tempY = 0} return true } var count=0; function closeElem(id){ if(opacity > 2){ opacity = opacity - 8 GEBI(id).style.opacity = opacity/100; GEBI(id).style.MozOpacity = opacity/100; GEBI(id).style.KhtmlOpacity = - opacity/100; GEBI(id).style.filter = "alpha(opacity="+opacity+")"; setTimeout("closeElem('"+id+"')", 25) } else { GEBI(id).style.display ='none' opacity = 100 GEBI(id).style.opacity = opacity/100; GEBI(id).style.MozOpacity = opacity/100; GEBI(id).style.KhtmlOpacity = - opacity/100; GEBI(id).style.filter = "alpha(opacity="+opacity+")"; } } function openElem3(id){ GEBI(id).style.display='' } function closeElem3(id) { GEBI(id).style.display='none' } function openElem(id){ if(document.getElementById(id).style.display=='none'){ openElem2(id) } else { closeElem(id) } } function openElem2(id){ document.getElementById(id).style.display='' if(opacity2 < 96){ GEBI(id).style.display ='' opacity2 = opacity2 + 8 GEBI(id).style.opacity = opacity2/100; GEBI(id).style.MozOpacity = opacity2/100; GEBI(id).style.KhtmlOpacity = - opacity2/100; GEBI(id).style.filter = "alpha(opacity="+opacity2+")"; setTimeout("openElem2('"+id+"')", 25) } else { opacity2 = 100 GEBI(id).style.opacity = opacity2/100; GEBI(id).style.MozOpacity = opacity2/100; GEBI(id).style.KhtmlOpacity = - opacity2/100; GEBI(id).style.filter = "alpha(opacity="+opacity2+")"; opacity2 = 0 } } function setPost(form) { var myElement = '', postData = '', mySelectElement = '' var to_run = 'myElement = document.'+form+'.getElementsByTagName("input")' eval(to_run) var len = myElement.length for(x=0;x<=len;x++){ if(myElement[x]) { var type = myElement[x].type if(type == 'text' || type == 'hidden') { postData += myElement[x].name != ''? myElement[x].name : myElement[x].id postData += '='+myElement[x].value+'&' } } } var to_run = 'mySelectElement = document.'+form+'.getElementsByTagName("select")' eval(to_run) var len = mySelectElement.length for(x=0;x<=len;x++){ if(mySelectElement[x]) { postData += mySelectElement[x].name != ''? mySelectElement[x].name : mySelectElement[x].id postData += '='+mySelectElement[x].value+'&' } } var to_run = 'myTextElement = document.'+form+'.getElementsByTagName("textarea")' eval(to_run) var len = myTextElement.length for(x=0;x<=len;x++){ if(myTextElement[x]) { postData += myTextElement[x].name != ''? myTextElement[x].name : myTextElement[x].id postData += '='+myTextElement[x].value+'&' } } return postData } function GEBI(id){ return document.getElementById(id) } var Audio = new Object(); Audio.elm = null; Audio.play = function Audio_play(src,loop) { if (!src) return false; if (this.isElm()) this.stop(); var doc = document; var elm; if (doc.all) elm = doc.createElement("bgsound"); if (elm && typeof elm.src == "string") { if (loop) elm.loop = "infinite" elm.src = src; } else { elm = doc.createElement("object"); elm.setAttribute("width","0"); elm.setAttribute("height","0"); elm.setAttribute("autostart",true); elm.style.visibility = "hidden"; elm.setAttribute("type","audio/x-wav"); if (loop) elm.setAttribute("loop","true"); elm.setAttribute("data",src); } doc.body.appendChild(elm); elm.focus(); this.elm = elm; return true; }; Audio.stop = function Audio_stop() { if (this.isElm()) { this.elm.parentNode.removeChild(this.elm); this.elm = null; } }; Audio.isElm = function () { return (this.elm && this.elm.parentNode); }; function setCookie(c_name,value,expiredays) { var exdate=new Date() exdate.setDate(exdate.getDate()+expiredays) document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { document.getElementById('p_status').innerHTML = 'Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.'; } } function ajax(page, postVars, getVars, element, indicator){ if(ajaxCheckLog.readyState==4 || ajaxCheckLog.readyState==0 ){ setCookie('element', element) setCookie('page', page) setCookie('indicator', indicator) if(indicator !=''){ document.getElementById(indicator).style.display='' } ajaxCheckLog.open("POST", page+'?'+getVars, true); ajaxCheckLog.onreadystatechange = handelCheckLog; ajaxCheckLog.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); var param = postVars; ajaxCheckLog.send(param); } } function handelCheckLog(){ if(ajaxCheckLog.readyState==4){ if(unescape(readCookie('indicator'))!=''){ document.getElementById(unescape(readCookie('indicator'))).style.display='none'; } if(unescape(readCookie('element'))!==''){ document.getElementById(unescape(readCookie('element'))).innerHTML=ajaxCheckLog.responseText; } if(readCookie('page')=="suggest"){ if(ajaxCheckLog.responseText.length < 2){ document.getElementById(unescape(readCookie('element'))).style.display='none' } } } } function validate() { var alertMessage='' var submitOK=true for(x=1;x<=20;x++){ if(GEBI('val'+x)){ if(document.getElementById('val'+x).value==''){ var title=GEBI('val'+x).title alertMessage+='* '+title+' דרוש להמשך ההרשמה '; submitOK=false } } } if(submitOK==false){ alert("ההרשמה נכשלה מהסיבות הבאו: "+alertMessage) } return submitOK } function setSuggestFrame(id, parent, frame){ var cordY= 20; var cordX= -11; document.getElementById(parent).style.position="relative"; document.getElementById(parent).innerHTML+="
" } function suggestValues(id, parent, frame, event){ if(!GEBI(frame)){ setSuggestFrame(id, parent, frame) count=-1; } else { if(GEBI(frame).style.display=="none"){ GEBI(frame).style.display="" count=-1; } } if(count < -1)count =-1 if(event.keyCode == 40){ if(GEBI(frame+"suggest_"+count)){ GEBI(frame+"suggest_"+count).style.background='' } count++ if(GEBI(frame+"suggest_"+count)){ GEBI(frame+"suggest_"+count).style.background='#5470de' } else { count-- GEBI(frame+"suggest_"+count).style.background='#5470de' } } if(event.keyCode == 38){ if(GEBI(frame+"suggest_"+count)){ GEBI(frame+"suggest_"+count).style.background='' } count-- if(GEBI(frame+"suggest_"+count)){ GEBI(frame+"suggest_"+count).style.background='#5470de' } } if(event.keyCode==13){ GEBI(id).value= GEBI(frame+"suggest_"+count).innerHTML GEBI(frame).style.display='none' if(id=="val4")var type=1 else var type=2 ajax('company_details', 'value='+GEBI(id).value+'&type='+type, '', '', 'loading') } value=GEBI(id).value if(event.keyCode !=40 && event.keyCode!=38){ ajax('suggest', 'value='+value+'&id='+id+'&frame='+frame, '', frame, 'loading') setTimeout("closeElem('"+frame+"')", 5000) } } function suggestCloseElem(id){ if(readCookie(id)!=1)closeElem(id) } function getElementPosition(oElement){ elementY = document.getElementById(oElement).offsetTop; elementX = document.getElementById(oElement).offsetLeft; alert(oElement.offsetParent) } function disableEnterKey(e){ var disable=0 if(GEBI("suggestFrame")){ if(GEBI("suggestFrame").style.display==''){ var disable=1 } } for(i=1;i<=4;i++){ if(GEBI("suggestFrame"+i)){ if(GEBI("suggestFrame"+i).style.display==''){ var disable=1 } } if(disable==1) { var key; if(window.event) key = window.event.keyCode; //IE else key = e.which; //firefox if(key == 13) return false; else return true; } } } function fillElem(id, text, title){ GEBI(id).innerHTML="

"+title+"

"+text GEBI(id).style.display='' } function setPosition() { if(drag == 1) { if(GEBI(drugWindow)){ myX += mouseX - tempX myY -= mouseY - tempY GEBI(drugWindow).style.top = myY+'px' GEBI(drugWindow).style.right = myX+'px' mouseX = tempX mouseY = tempY } } } function scrollDown(id){ if(stop_scroll_down== 0){ document.getElementById(id).scrollTop+=10 setTimeout("scrollDown('"+id+"')", 100); } } function scrollUp(id){ if(stop_scroll== 0){ document.getElementById(id).scrollTop-=10 setTimeout('scrollUp("'+id+'")', 100); } } function galleryOver(src, multi) { GEBI('mainPic').innerHTML = " " if(multi == 1){ $('#multi').show(); } } function couponImage(src, num) { nextNum = num + 1 lastNum = num - 1 var myString = "
" myString +="

לחץ על התמונה להדפסה!

" myString += "" myString += "" myString += "<< הקודם " myString += "
" if(GEBI('frameLeft'))GEBI('frameLeft').innerHTML = myString } function printCupon(src){ window.open('/print/?image='+src,'mywindow','width=400,height=300, toolbar = no, location = no') } function pageLoad() { $('[@id=menu-481] a').css('border', '0') $('[@class=breadcrumbs] a:last').css('background', 'none') $('#nice-menu-4 a').attr('href', function(){ return $(this).attr('href') + '/?lang=en' }) if(GEBI('sales')){ var myString = "

לחץ על התמונה להדפסה!

" myString += "" myString += "<< הקודם " myString += "
" if(GEBI('frameLeft'))GEBI('frameLeft').innerHTML = myString } if(GEBI('slide_show')) { slide_show(1) } if(GEBI('trademarks')) { randTradHover(1) } if(location.hash) { location.href = location.hash.replace('#', '') } setInterval("ajaxBackControl()", 1000) } function ajaxBackControl() { if(location.hash) { if('#'+backCheck != location.hash) { if(location.hash.indexOf('forum') == -1) { location.href = location.hash.replace('#', '') } } } } function alertMessage(myMessage) { drugWindow = 'alertMessage' myX = GEBI(drugWindow).style.right? parseInt(GEBI(drugWindow).style.right): 200 myY = GEBI(drugWindow).style.right? parseInt(GEBI(drugWindow).style.top): 150 GEBI('alertMessage').innerHTML = myMessage GEBI('close').onclick = function() { closeElem('alertMessage') } GEBI('move').onmousedown = function() { drag = 1 } GEBI('move').onmouseup = function() { drag = 0 } openElem2('alertMessage') } function slide_show(pic) { setTimeout("lowOpacity('"+pic+"', '', 100, 'men')", 3000) setTimeout("lowOpacity('"+pic+"', '', 100, 'women')", 3000) } function lowOpacity(pic, lastPic, opacity, gender) { var object = GEBI(gender+pic).style object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; opacity -= 2 if(opacity != 2) { setTimeout("lowOpacity('"+pic+"', '"+lastPic+"', "+opacity+", '"+gender+"')", 25) }else { var picPlus = parseInt(pic)+1 if(GEBI(gender+picPlus)) { var newPic = picPlus } else { var newPic = 1 } for(x=1;x <=10;x++) { if(GEBI(gender+x)) { GEBI(gender+x).style.zIndex = parseInt(GEBI(gender+x).style.zIndex) + 1 } } object.zIndex = '1' GEBI(gender+newPic).style.zIndex = '10' object.opacity = (100); object.MozOpacity = (100); object.KhtmlOpacity = (100); object.filter = "alpha(opacity=100)"; setTimeout("lowOpacity('"+newPic+"', '"+pic+"', 100 , '"+gender+"')", 2000) } } function changeMap(area) { GEBI('north').style.background = "url(/static/opticana/images/north.gif) no-repeat" GEBI('center').style.background = "url(/static/opticana/images/center.gif) no-repeat" GEBI('south').style.background = "url(/static/opticana/images/south.gif) no-repeat" GEBI('jerusalem').style.background = "url(/static/opticana/images/jerusalem.gif) no-repeat" GEBI(area).style.background = "url(/static/opticana/images/"+area+"-hover.gif) no-repeat" GEBI('frameLeft').style.background = "url(/static/opticana/images/map-"+area+".gif) no-repeat" GEBI('frameLeft').innerHTML = "" ajax('/maps', 'map='+area, '', 'frameLeft', 'loading') } function randTradHover(num) { if(GEBI('trade'+num)) { var myBackground = GEBI('trade'+num).className; myBackground = myBackground .replace('-hover', '') GEBI('trade'+num).className = myBackground ; } var ran_unrounded = Math.random()*9; var num2 = Math.floor(ran_unrounded); if(GEBI('trade'+num2))GEBI('trade'+num2).className += "-hover"; setTimeout("randTradHover("+num2+")", 1000) } function setAjaxData(url, alias, post, title) { // location.hash = alias; // ajax(url, post, '', 'articleLeft', 'loading'); // var mySplit = title.split('*') // var bread = 'דף הבית' // bread += 'לדעת יותר' // for(x=0;x < mySplit.length;x++) { // bread += ""+mySplit[x]+"" // } // if(GEBI('breadcrumbs'))GEBI('breadcrumbs').innerHTML = bread // $('[@class=breadcrumbs] a:last').css('background', 'none') // backCheck = alias // iframeSessions += ':'+backCheck } function deleteNode(nid){ if(confirm('אתה בטוח שאתה רוצה למחוק את הכתבה הזאת?')){ location = '/deleteNode/'+nid } } function do_overlay_flash() { if (AC_FL_RunContent == 0) { alert("This page requires AC_RunActiveContent.js"); } else { $(".close-this").css("display","inline"); $(".home-overlay").fadeIn(200); $(".close-this").click( function(){ remove_overlay(); }); AC_FL_RunContent( 'codebase', 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/Swflash.cab#version=8,0,0,0', 'width', '990', 'height', '550', 'src', '/static/opticana/media/LP_2.swf', 'base', '/static/opticana/media/', 'quality', 'high', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'noscale', 'wmode', 'transparent', 'devicefont', 'false', 'id', 'optiover', 'bgcolor', '#ffffff', 'name', 'optiover', 'menu', 'false', 'allowScriptAccess','sameDomain', 'movie', '/static/opticana/media/LP_2.swf', 'salign', '' ); } } /* function optiover_DoFScommand(command, args) { alert (command); switch (command) { case 'click': $(".home-overlay").fadeOut(1000); break; } } // Hook for Internet Explorer. if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) { document.write('<' + 'script language="vbscript"' + '>' + "\n"); document.write('On Error Resume Next' + "\n"); document.write('Sub optiover_DoFScommand(ByVal command, ByVal args)' + "\n"); document.write('Call optiover_DoFScommand(command, args)' + "\n"); document.write('End Sub' + "\n"); document.write('<' + '/script' + '>' + "\n"); } */ function remove_overlay() { $(".home-overlay").fadeOut(1000); var a = readCookie("iveseentheflash"); if (a) var return_count = parseInt(a) + 1; else var return_count = 1; setCookie("iveseentheflash",return_count,365); }