﻿var poisponsorobjects=[];var poisponsorloadedAreas=[];function execSponsorPOIObjects(){}function displaySponsorPOIObjects(objectsXML,zo,x,y){try{var objectIDs="";var xmlDoc=XMLParser(objectsXML);if(xmlDoc){var aObjects1=xmlDoc.documentElement.getElementsByTagName("o");if(aObjects1){for(var i=0;i<aObjects1.length;i++){var red=new yObject();var tR=aObjects1[i];red.RB=tR.getAttribute("RB");red.R1=tR.getElementsByTagName("in")[0].childNodes[0].nodeValue;red.R2=tR.getElementsByTagName("ia")[0].childNodes[0].nodeValue;red.R3=tR.getAttribute("G");red.x=tR.getAttribute("X");red.y=tR.getAttribute("Y");red.id=tR.getAttribute("ID");red.iconWidth=tR.getAttribute("iW");red.iconHeight=tR.getAttribute("iH");red.Telefon=tR.getAttribute("T");red.Fax=tR.getAttribute("F");red.Mail=tR.getAttribute("M");red.Web=tR.getAttribute("W");red.Sponzor=tR.getAttribute("S");red.iconName=tR.getAttribute("iN");red.PrikazujeSe=tR.getAttribute("PS");red.TipPrezentacije=tR.getAttribute("Tp");red.ImaSliku=tR.getAttribute("hI");red.TipObjekta='object';objectIDs+=red.id+",";var found=false;for(var j=0;j<poisponsorobjects.length;j++){var obj=poisponsorobjects[j];if(obj.id==red.id)found=true;}if(!found)poisponsorobjects[poisponsorobjects.length]=red;}paintSponsorPOIObjects(zo,x,y);if(objectIDs!="")logMultiAction(objectIDs,"poisponsoronmapshow");}}}catch(ex){}}function paintSponsorPOIObjects(zo,x,y){try{var leftMet=getLeftInMeter();var topMet=getTopInMeter();var rightMet=getLeftInMeter()+getWidthInMeter();var bottomMet=getTopInMeter()+getHeightInMeter();var leftCellMet=x*250*z.mPerPX;var rightCellMet=(x+1)*250*z.mPerPX;var topCellMet=y*250*z.mPerPX;var bottomCellMet=(y+1)*250*z.mPerPX;for(var i=0;i<poisponsorobjects.length;i++){var object=poisponsorobjects[i];if(z.zoom==zo&&object.x>leftMet&&object.x<rightMet&&object.y>topMet&&object.y<bottomMet&&object.x>=leftCellMet&&object.x<rightCellMet&&object.y>=topCellMet&&object.y<bottomCellMet){var newObject=document.createElement("img");newObject.className="object";newObject.setAttribute("index",i+1);newObject.setAttribute("k",object.id);newObject.setAttribute("oid",object.id);var x=parseInt(object.x/z.mPerPX)-(z.deltaX-centerPomX)*z.cellWidth;var y=parseInt(object.y/z.mPerPX)-(z.deltaY-centerPomY)*z.cellHeight;newObject.setAttribute("x",object.x);newObject.setAttribute("y",object.y);newObject.setAttribute("s","poisponsor");newObject.setAttribute("src","Services/getIcon.aspx?file="+object.iconName+".png");setStyleLeft(newObject,x-8);setStyleTop(newObject,y-8);setStyleWidth(newObject,16);setStyleHeight(newObject,16);newObject.onmouseover=function(e){clearTimeout(infoDiv.toid);var ind=this.getAttribute("index")-1;var objectFound=poisponsorobjects[ind];ShowPopupDescription(e,objectFound);};newObject.onclick=function(e){hideInfo();clearTimeout(contextMenu2.toid);displaySrcObjInfo(e);};newObject.onmouseout=function(e){infoDiv.toid=setTimeout('hideInfo()',100);};newObject.oncontextmenu=showMenu;objectsdiv.appendChild(newObject);}}setStyleLeft(objectsdiv,getStyleLeft(mainContainer));setStyleTop(objectsdiv,getStyleTop(mainContainer));}catch(ex){}}