var floatingMenuId='';var floatingMenu={targetX:'center',targetY:'center',AddtargetX:0,AddtargetY:0,SizeX:0,SizeY:0,Timer:true,hasInner:typeof(window.innerWidth)=='number',hasElement:typeof(document.documentElement)=='object'&&typeof(document.documentElement.clientWidth)=='number',menu:''};floatingMenu.searchmenu=function(){floatingMenu.menu=document.getElementById?document.getElementById(floatingMenuId):document.all?document.all[floatingMenuId]:document.layers[floatingMenuId];};floatingMenu.move=function(){floatingMenu.menu.style.left=floatingMenu.nextX+'px';floatingMenu.menu.style.top=floatingMenu.nextY+'px';};floatingMenu.computeShifts=function(){var de=document.documentElement;floatingMenu.shiftX=floatingMenu.hasInner?pageXOffset:floatingMenu.hasElement?de.scrollLeft:document.body.scrollLeft;if(floatingMenu.targetX<0){floatingMenu.shiftX+=floatingMenu.hasElement?de.clientWidth:document.body.clientWidth;}floatingMenu.shiftY=floatingMenu.hasInner?pageYOffset:floatingMenu.hasElement?de.scrollTop:document.body.scrollTop;if(floatingMenu.targetY<0){if(floatingMenu.hasElement&&floatingMenu.hasInner){floatingMenu.shiftY+=de.clientHeight>window.innerHeight?window.innerHeight:de.clientHeight}else{floatingMenu.shiftY+=floatingMenu.hasElement?de.clientHeight:document.body.clientHeight;}}};floatingMenu.calculateCornerX=function(){if(floatingMenu.targetX!='center')return floatingMenu.shiftX+parseInt(floatingMenu.targetX)+parseInt(floatingMenu.AddtargetX);var width=parseInt(floatingMenu.SizeX);var cornerX=floatingMenu.hasElement?(floatingMenu.hasInner?pageXOffset:document.documentElement.scrollLeft)+(document.documentElement.clientWidth-width)/2:document.body.scrollLeft+(document.body.clientWidth-width)/2;return cornerX+parseInt(floatingMenu.AddtargetX);};floatingMenu.calculateCornerY=function(){if(floatingMenu.targetY!='center')return floatingMenu.shiftY+parseInt(floatingMenu.targetY)+parseInt(floatingMenu.AddtargetY);var height=parseInt(floatingMenu.SizeY);var clientHeight=floatingMenu.hasElement&&floatingMenu.hasInner&&document.documentElement.clientHeight>window.innerHeight?window.innerHeight:document.documentElement.clientHeight;var cornerY=floatingMenu.hasElement?(floatingMenu.hasInner?pageYOffset:document.documentElement.scrollTop)+(clientHeight-height)/2:document.body.scrollTop+(document.body.clientHeight-height)/2;return cornerY+parseInt(floatingMenu.AddtargetY);};floatingMenu.doFloat=function(){var stepX,stepY;floatingMenu.computeShifts();var cornerX=floatingMenu.calculateCornerX();var stepX=(cornerX-floatingMenu.nextX)*1;if(Math.abs(stepX)<.5)stepX=cornerX-floatingMenu.nextX;var cornerY=floatingMenu.calculateCornerY();var stepY=(cornerY-floatingMenu.nextY)*1;if(Math.abs(stepY)<.5)stepY=cornerY-floatingMenu.nextY;if(Math.abs(stepX)>0 || Math.abs(stepY)>0){floatingMenu.nextX+=stepX;floatingMenu.nextY+=stepY;floatingMenu.move();}if(floatingMenu.Timer)setTimeout('floatingMenu.doFloat()',20);};floatingMenu.init=function(){floatingMenu.searchmenu();floatingMenu.initSecondary();floatingMenu.doFloat();};floatingMenu.initSecondary=function(){floatingMenu.searchmenu();floatingMenu.computeShifts();floatingMenu.nextX=floatingMenu.calculateCornerX();floatingMenu.nextY=floatingMenu.calculateCornerY();floatingMenu.move();};function webspot(kampany){if (document.layers){MM_findObj('webspot_gomb'+kampany).display = 'none';}else{MM_findObj('webspot_gomb'+kampany).style.display = 'none';}var xmlHttp=null;if (kampany==0){return;}try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){return;}}var url="/webspot/webspot_adatok.php?k=" + kampany;var sid="&sid="+Math.random();url=url+sid;xmlHttp.open("GET",url,false);xmlHttp.send(null);meret = xmlHttp.responseText.split('|');floatingMenu.targetX = meret[3];floatingMenu.targetY = meret[4];floatingMenu.AddtargetX = meret[5];floatingMenu.AddtargetY = meret[6];floatingMenu.SizeX = meret[0];floatingMenu.SizeY = meret[1];floatingMenuId = 'webspotdiv'+kampany;var newiframe = '<iframe id="webspot_frame'+kampany+'" name="webspot_frame'+kampany+'" marginwidth="0" marginheight="0" frameborder="0" style="width:'+meret[0]+'px; height:'+meret[1]+'px" scrolling="no" allowtransparency="true" src=""></iframe>';var newdiv = document.createElement('div');newdiv.setAttribute('id', floatingMenuId);newdiv.setAttribute('name', floatingMenuId);if (document.layers){newdiv.left = '0px';newdiv.top = '0px';newdiv.zIndex = '999';newdiv.width = meret[0]+'px';newdiv.height = meret[1]+'px';newdiv.position = meret[2];newdiv.visibility = 'visible';}else{newdiv.style.left = '0px';newdiv.style.top = '0px';newdiv.style.zIndex = '999';newdiv.style.width = meret[0]+'px';newdiv.style.height = meret[1]+'px';newdiv.style.position = meret[2];newdiv.style.visibility = 'visible';}newdiv.innerHTML = newiframe;document.body.appendChild(newdiv);MM_goToURL('parent.frames[\'webspot_frame'+kampany+'\']','/webspot/webspot_betolt.php?k='+kampany+sid);if (document.layers){floatingMenu.init();}else{floatingMenu.init();floatingMenu.initSecondary();}}
