﻿var selMenu=0;var fading=false;var sliding=false;var resMoveX,resMoveY;var resMoveX1,resMoveY1;var toMoveX=0,toMoveY=0;var moveMap=true;var minWidth=950;var minHeight=400;function InfoList(x,y){open("Services/GetInfoList.aspx?l="+x+"&t="+y+"&lang="+lang,"_blank",'scrollbars=yes,height=250,width=350,status=no,toolbar=no,menubar=no,location=no,left='+((screen.width-350)/2)+',top='+((screen.height-250)/2));}function ClosePr(){hideSrcObjectLayer(true);showFoundObjects=false;resetSearch();hideAll();CenterXCross();centriranjeMape=false;setTimeout("centerMap2(-167,0)",50);}function ClosePut(){resetPath();hideAll();CenterXCross();centriranjeMape=false;setTimeout("centerMap2(-167,0)",50);}function hideAll(){HideReview();HideLogin();sv(put,0);sv(pretraga,0);sv(pretragaOpis,0);sv(searchputr,0);sv(searchnav,0);sv(strukupno,0);try{sv(prognoza,0);sv(prognozafooter,0);showForecastOnMap=false;}catch(ex){}try{sv(poidiv,0);sv(poidivfooter,0);showPOIOnMap=false;}catch(ex){}try{sv(promodiv,0);sv(promodivfooter,0);showPromoOnMap=false;}catch(ex){}try{sv(gsdiv,0);sv(gsdivfooter,0);showGsOnMap=false;}catch(ex){}}function LeftPanel(i,scroll){var x=0;var y=0;if(IsFullMap()){x=167;}hideAll();if(i==2){hideSrcObjectLayer(true);showFoundObjects=true;sv(pretraga,1);if(arrSrc.length>0){sv(searchnav,1);sv(strukupno,1);}else{sv(pretragaOpis,1);}RefreshLayers();}else if(i==3){hideSrcObjectLayer(true);showFoundObjects=false;sv(put,1);sv(searchputr,1);RefreshLayers();}else if(i==4){if(!prognozaEnabled){loadjsfile("scripts/mapForecast.js");}else{hideSrcObjectLayer(true);showFoundObjects=false;hideAll();CenterXCross();showForecastOnMap=true;RefreshLayers();sv(prognoza,1);sv(prognozafooter,1);}ChangeBaner();}else if(i==5){if(!poiEnabled){loadjsfile("scripts/mapPOI.js");}else{hideSrcObjectLayer(true);showFoundObjects=false;hideAll();CenterXCross();showPOIOnMap=true;RefreshLayers();sv(poidiv,1);sv(poidivfooter,1);}ChangeBaner();}else if(i==6){if(!promoEnabled){loadjsfile("scripts/mapPromotions.js");}else{hideSrcObjectLayer(true);showFoundObjects=false;hideAll();CenterXCross();showPromoOnMap=true;RefreshLayers();sv(promodiv,1);sv(promodivfooter,1);}ChangeBaner();}else if(i==7){if(!gsEnabled){loadjsfile("scripts/mapGS.js");}else{hideSrcObjectLayer(true);showFoundObjects=false;hideAll();CenterXCross();showGsOnMap=true;RefreshLayers();sv(gsdiv,1);sv(gsdivfooter,1);}ChangeBaner();}CenterXCross();if(scroll){centriranjeMape=false;setTimeout("centerMap2("+x+","+y+")",50);}ResizeMap();}function Layers(i){if(i==0){showObjects=!showObjects;hideObjectLayer(true);showObjectLayer();}if(i==1){showFoundObjects=!showFoundObjects;hideSrcObjectLayer(true);showSrcObjectLayerOnMap();}if(i==2){showFoundPath=!showFoundPath;clearPath();paintPath();}if(i==3){showCompanies=!showCompanies;hideSrcObjectLayer(true);showSrcObjectLayerOnMap();}}var centriranjeMape=false;function centerMap(){var stepX=0,stepY=0;var bigStepX=8;var bigStepY=8;var sStepX=1;var sStepY=1;var koef=1;if(toMoveX!=0&&toMoveY!=0){if(Math.abs(toMoveX)>Math.abs(toMoveY)){koef=Math.abs(toMoveX)/Math.abs(toMoveY);bigStepX=parseInt(bigStepY*koef);sStepX=parseInt(sStepY*koef);}else{koef=Math.abs(toMoveY)/Math.abs(toMoveX);bigStepY=parseInt(bigStepX*koef);sStepY=parseInt(sStepX*koef);}}var lastSlide=20;if(toMoveX>0)if(Math.abs(toMoveX)>lastSlide)stepX=bigStepX;else stepX=sStepX;else if(toMoveX<0)if(Math.abs(toMoveX)>lastSlide)stepX=-bigStepX;else stepX=-sStepX;else stepX=0;if(toMoveY>0)if(Math.abs(toMoveY)>lastSlide)stepY=bigStepY;else stepY=sStepY;else if(toMoveY<0)if(Math.abs(toMoveY)>lastSlide)stepY=-bigStepY;else stepY=-sStepY;else stepY=0;toMoveX-=stepX;toMoveY-=stepY;moveBigMapByStep(stepX,stepY);if(toMoveX!=0||toMoveY!=0){hideObjectLayer(true);hideSrcObjectLayer(true);clearPath();if(centriranjeMape)setTimeout("centerMap()",20);}else{centriranjeMape=false;showSrcObjectLayerOnMap();showObjectLayer();clearPath();paintPath();resMoveX=getWindowWidth();resMoveY=getWindowHeight();}}function centerMapTimer(w,h){var cw=getWindowWidth();var ch=getWindowHeight();if(cw==w&&ch==h){toMoveX=parseInt((w-resMoveX)/2);toMoveY=parseInt((h-resMoveY)/2);if(!centriranjeMape){centriranjeMape=true;centerMap3(toMoveX,toMoveY);}}}function centerMap2(x,y){toMoveX=x;toMoveY=y;if(!centriranjeMape){centriranjeMape=true;centerMap3(x,y);}}function centerMap3(x,y){moveBigMapByStep(x,y);hideObjectLayer(true);hideSrcObjectLayer(true);clearPath();showSrcObjectLayerOnMap();showObjectLayer();paintPath();}function ResizeMap(first,dontST){if(!first){resMoveX1=getWindowWidth();resMoveY1=getWindowHeight();hideObjectLayer(true);hideSrcObjectLayer(true);clearPath();}try{FindCurrentCenterOnMiniMap();}catch(ex){}try{var ch=document.body.clientHeight;var cw=document.body.clientWidth;setStyleLeft(put,10);setStyleLeft(pretraga,10);setStyleTop(put,topOff);setStyleTop(pretraga,topOff);setStyleLeft(newsDiv,(cw-650)/2);setStyleLeft(newsDivShadow,(cw-650)/2+5);setStyleLeft(mfCon,(cw-530)/2);setStyleLeft(mfConS,(cw-530)/2+5);setStyleLeft(seCon,(cw-530)/2);setStyleLeft(loginDiv,(cw-530)/2);setStyleLeft(reviewsDiv,(cw-530)/2);setStyleTop(newsDiv,(ch-350)/2);setStyleTop(newsDivShadow,(ch-350)/2+5);setStyleTop(mfCon,(ch-400)/2);setStyleTop(mfConS,(ch-400)/2+5);setStyleTop(seCon,(ch-400)/2);setStyleTop(loginDiv,(ch-250)/2);setStyleTop(reviewsDiv,(ch-400)/2);if(cw<minWidth){cw=minWidth;}if(isIe)mapContainer.style.width=cw-rightOff1-5;else mapContainer.style.width=cw-rightOff1-7;hm.style.width=cw-rightOff-5;fm.style.width=cw-rightOff-5;fmc.style.width=cw-rightOff-7-48;h1.style.width=cw-24;h2ci.style.width=cw-24;setStyleLeft(h1ri,cw-12);setStyleLeft(h2ri,cw-12);setStyleLeft(hmri,cw-12);setStyleLeft(fmri,cw-12);setStyleLeft(fmcb,0);setStyleLeft(h1m,(cw-350)/2);setStyleLeft(h1r,cw-374);setStyleLeft(hmm,(cw-rightOff-352)/2);setStyleLeft(hmr,cw-rightOff-7-450);setStyleLeft(fmr,cw-rightOff-7-19);setStyleLeft(copy,cw-124-rightOff1-1);setStyleLeft(imgPrognoza,cw-124-rightOff1-1-50);setStyleLeft(raz,cw-205-rightOff1-1);setStyleLeft(bannerRight,cw-165);setStyleLeft(mMap,cw-15-29-151);setStyleLeft(tb_Zoom,cw-rightOff1-5-29);setStyleLeft(ZoomLevel,cw-rightOff1-5-29);setStyleLeft(zopis,cw-rightOff1-5-29-77);CenterXCross();var t=0;if(ch<minHeight){ch=minHeight;}if(isIe)mapContainer.style.height=ch-164-t;else mapContainer.style.height=ch-164-t-2;pretraga.style.height=ch-128-80;put.style.height=ch-128-80;searchnav.style.top=getStyleHeight(pretraga)-41;if(arrSrc.length>0){if(arrSrc[0].TipObjekta=="object"){searchr.style.height=getStyleHeight(pretraga)-40-28-3-10-10-25;setStyleTop(searchr,25);}else{searchr.style.height=getStyleHeight(pretraga)-40-28-3-10-10;setStyleTop(searchr,0);}}else{searchr.style.height=getStyleHeight(pretraga)-40-28-3-10-10;setStyleTop(searchr,0);}pretragaOpis.style.height=getStyleHeight(pretraga)-40-28-3-10-10;srcWrap.style.height=getStyleHeight(pretraga)-40-28-3-10;putWrap.style.height=getStyleHeight(put)-40-28-3-10;searchputr.style.height=getStyleHeight(put)-28-82-5-10-33;setStyleTop(copy,ch-79-14+30);setStyleTop(raz,ch-79-14+16);setStyleTop(imgPrognoza,ch-79-14+29);setStyleTop(fm,ch-79+30);setStyleTop(fmli,ch-79+30);setStyleTop(fmri,ch-79+30);setStyleLeft(banerdesnomali,cw-125-15);setStyleTop(banerdesnomali,ch-90-125);if(prognozaEnabled){prognoza.style.height=ch-128-80;prognozafooter.style.top=getStyleHeight(prognoza)-41;prognozacontent.style.height=getStyleHeight(prognoza)-40-28-3-10-10;prognozawrap.style.height=getStyleHeight(prognoza)-40-28-3-10;}if(poiEnabled){poidiv.style.height=ch-128-80;poidivfooter.style.top=getStyleHeight(poidiv)-41;poicontent.style.height=getStyleHeight(poidiv)-40-28-3-10-10;poiwrap.style.height=getStyleHeight(poidiv)-40-28-3-10;}if(promoEnabled){promodiv.style.height=ch-128-80;promodivfooter.style.top=getStyleHeight(promodiv)-41;promocontent.style.height=getStyleHeight(promodiv)-40-28-3-10-10-20;promowrap.style.height=getStyleHeight(promodiv)-40-28-3-10;}if(gsEnabled){gsdiv.style.height=ch-128-80;gsdivfooter.style.top=getStyleHeight(gsdiv)-41;gscontent.style.height=getStyleHeight(gsdiv)-40-28-3-10-10;gswrap.style.height=getStyleHeight(gsdiv)-40-28-3-10;}ReinitialiseOnResize();if(dontST!=12)setTimeout(ResizeMap(false,12),300);if(isIe){srcWrap.style.width=330;putWrap.style.width=330;}else{srcWrap.style.width=328;putWrap.style.width=328;}}catch(ex){}}function CenterXCross(){setStyleTop(xcross,getStyleHeight(mapContainer)/2+-7);if(IsFullMap())setStyleLeft(xcross,getStyleWidth(mapContainer)/2-7);else setStyleLeft(xcross,getStyleWidth(mapContainer)/2-7+170);}function Print(){ChangeBaner();var mPP;var w=getStyleWidth(mapContainer);var h=getStyleHeight(mapContainer);var wadd=0;if(!IsFullMap()){w-=340;wadd=340*z.mPerPX;}var left=getLeftInMeter()+wadd;var right=getLeftInMeter()+wadd+w*z.mPerPX;var top=getTopInMeter();var bottom=getTopInMeter()+h*z.mPerPX;var mPP1=(right-left)/w;var mPP2=(bottom-top)/h;if(mPP1>mPP2){mPP=mPP1}else{mPP=mPP2}if(z.zoom!=2){i=11;if(mPP<1024){while(mPP<aZoom[i][9]&&i>1){i--;}i=i+1;}}else i=2;var X=Math.round(right-(right-left)/2)*3;var Y=Math.round(bottom-(bottom-top)/2)*3;open("Print.aspx?e="+i+"&a="+X+"&b="+Y,"_blank","scrollbars=yes,height=700,width=800,status=no,toolbar=no,menubar=no,location=no");}function Kontakt(){open("Kontakt.aspx?lang="+lang,"_self","");}function Order(){open("Narucivanje.aspx?lang="+lang,"_self","");}function Marketing(){open("Marketing.aspx?lang="+lang,"_self","");}function Dodaci(){open("ie8accelerator.aspx?lang="+lang,"_self","");}function ShowHelp(){open("help.aspx?lang="+lang,"_self","");}function ShowMFHelp(){open("help.aspx?lang="+lang+"&id=2","_blank","");}function ShowMiniMap(){if(mMap.style.visibility=="visible"){sv(mMap,0);gi("mmaparr").src="Design/nav.gif";}else{sv(mMap,1);gi("mmaparr").src="Design/nav1.gif";}}function ClearSearchText(){if(tbsrc.value=="adresa, mesto"||tbsrc.value=="address, location"||tbsrc.value=="objekat, mesto"||tbsrc.value=="point of interest, location"||tbsrc.value=="naziv mesta"||tbsrc.value=="location"){tbsrc.value="";tbsrc.style.color="#555555";}else{tbsrc.select();}}function SetSearchText(){if(tbsrc.value==""||tbsrc.value=="adresa, mesto"||tbsrc.value=="address, location"||tbsrc.value=="objekat, mesto"||tbsrc.value=="point of interest, location"||tbsrc.value=="naziv mesta"||tbsrc.value=="location"){tbsrc.style.color="#bbbbbb";if(lang=="en-us"){if(srcType==1)tbsrc.value="address, location";else if(srcType==2)tbsrc.value="point of interest, location";else if(srcType==3)tbsrc.value="location";}else{if(srcType==1)tbsrc.value="adresa, mesto";else if(srcType==2)tbsrc.value="objekat, mesto";else if(srcType==3)tbsrc.value="naziv mesta";}eval("srcta"+srcType+".focus();");}}function ShowZopis(b){sv(zopis,b);}function ClearRouteSearchText(element){if(element.value=="adresa ili mesto"||element.value=="address or location"){element.value="";element.style.color="#555555";}}function SetRouteSearchText(element){if(element.value==""||element.value=="adresa ili mesto"||element.value=="address or location"){element.style.color="#bbbbbb";if(lang=="en-us"){element.value="address or location";}else{element.value="adresa ili mesto";}}}function ShowMyPlanPlusMenu(){if(!gi("MyPlanPlusMenu")){var mnu=document.createElement("div");mnu.id="MyPlanPlusMenu";mnu.className="MyPlanPlusMenu";var mnu1=document.createElement("div");mnu1.className="MyPlanPlusMenuItem";if(lang=="en-us")mnu1.innerHTML="Weather forecast";else mnu1.innerHTML="Vremenska prognoza";mnu1.onclick=function(){HideMyPlanPlusMenu();LeftPanel(4,0);logWF();};mnu1.onmouseover=function(){clearTimeout(MyPlanPlusMenu.toid);this.style.textDecoration='underline';};mnu1.onmouseout=function(){this.style.textDecoration='none';};setStyleLeft(mnu1,10);setStyleTop(mnu1,10);mnu.appendChild(mnu1);var mnu3=document.createElement("div");mnu3.className="MyPlanPlusMenuItem";if(lang=="en-us")mnu3.innerHTML="Promotions";else mnu3.innerHTML="Akcije i popusti";mnu3.onclick=function(){HideMyPlanPlusMenu();LeftPanel(6,0);logPromo();};mnu3.onmouseover=function(){clearTimeout(MyPlanPlusMenu.toid);this.style.textDecoration='underline';};mnu3.onmouseout=function(){this.style.textDecoration='none';};setStyleLeft(mnu3,10);setStyleTop(mnu3,30);mnu.appendChild(mnu3);mnu.onmouseover=function(){clearTimeout(MyPlanPlusMenu.toid);};mnu.onmouseout=function(){MyPlanPlusMenu.toid=setTimeout('HideMyPlanPlusMenu()',500);};document.body.appendChild(mnu);}}function HideMyPlanPlusMenu(){if(gi("MyPlanPlusMenu")){document.body.removeChild(gi("MyPlanPlusMenu"));}}function ShowCDMenu(){if(!gi("CDMenu")){var mnu=document.createElement("div");mnu.id="CDMenu";mnu.className="CDMenu";var mnu1=document.createElement("div");mnu1.className="CDMenuItem";if(lang=="en-us")mnu1.innerHTML="Learn more";else mnu1.innerHTML="O programu";mnu1.onclick=function(){HideCDMenu();open('oprogramu.aspx','_self');};mnu1.onmouseover=function(){clearTimeout(CDMenu.toid);this.style.textDecoration='underline';};mnu1.onmouseout=function(){this.style.textDecoration='none';};setStyleLeft(mnu1,10);setStyleTop(mnu1,10);mnu.appendChild(mnu1);var mnu2=document.createElement("div");mnu2.className="MyPlanPlusMenuItem";if(lang=="en-us")mnu2.innerHTML="Order a copy";else mnu2.innerHTML="Naručite vaš primerak";mnu2.onclick=function(){HideCDMenu();open('narucivanje.aspx','_self');};mnu2.onmouseover=function(){clearTimeout(CDMenu.toid);this.style.textDecoration='underline';};mnu2.onmouseout=function(){this.style.textDecoration='none';};setStyleLeft(mnu2,10);setStyleTop(mnu2,30);mnu.appendChild(mnu2);var mnu3=document.createElement("div");mnu3.className="MyPlanPlusMenuItem";if(lang=="en-us")mnu3.innerHTML="Free updates";else mnu3.innerHTML="Besplatne dopune";mnu3.onclick=function(){HideCDMenu();open('dopune.aspx','_self');};mnu3.onmouseover=function(){clearTimeout(CDMenu.toid);this.style.textDecoration='underline';};mnu3.onmouseout=function(){this.style.textDecoration='none';};setStyleLeft(mnu3,10);setStyleTop(mnu3,50);mnu.appendChild(mnu3);var mnu4=document.createElement("div");mnu4.className="MyPlanPlusMenuItem";if(lang=="en-us")mnu4.innerHTML="Support";else mnu4.innerHTML="Tehnička podrška";mnu4.onclick=function(){HideCDMenu();open('podrska.aspx','_self');};mnu4.onmouseover=function(){clearTimeout(CDMenu.toid);this.style.textDecoration='underline';};mnu4.onmouseout=function(){this.style.textDecoration='none';};setStyleLeft(mnu4,10);setStyleTop(mnu4,70);mnu.appendChild(mnu4);mnu.onmouseover=function(){clearTimeout(CDMenu.toid);};mnu.onmouseout=function(){CDMenu.toid=setTimeout('HideCDMenu()',500);};document.body.appendChild(mnu);}}function HideCDMenu(){if(gi("CDMenu")){document.body.removeChild(gi("CDMenu"));}}