﻿
function MM_goToURL(){var i,args=MM_goToURL.arguments;document.MM_returnValue=false;for(i=0;i<(args.length-1);i+=2)eval(args[i]+".location='"+args[i+1]+"'");}
var map;var icon0;var newpoints=new Array();function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func}else{window.onload=function(){oldonload();func();}}}
addLoadEvent(loadMap);addLoadEvent(addPoints);function loadMap(){map=new GMap2(document.getElementById("map"));map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.setCenter(new GLatLng(45.80594820360159,15.878849029541016),14);map.setMapType(G_NORMAL_MAP);icon0=new GIcon();icon0.image="img/bonusotp.png";icon0.iconSize=new GSize(215,78);icon0.iconAnchor=new GPoint(9,34);icon0.infoWindowAnchor=new GPoint(9,2);}
function addPoints(){newpoints[0]=new Array(45.80026389524113,15.877819061279297,icon0);for(var i=0;i<newpoints.length;i++){var point=new GPoint(newpoints[i][1],newpoints[i][0]);var popuphtml=newpoints[i][4];var marker=createMarker(point,newpoints[i][2],popuphtml);map.addOverlay(marker);}}
function createMarker(point,icon,popuphtml){var popuphtml="<div id=\"popup\">"+popuphtml+"<\/div>";var marker=new GMarker(point,icon);GEvent.addListener(marker,function(){marker.openInfoWindowHtml(popuphtml);});return marker;}
$(document).ready(function(){$("#submit").click(function(){$(".error").hide();var hasError=false;var emailReg=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;var imeVal=$("#ime").val();if(imeVal==''+'Vaše ime [naziv tvrtke]...'){$("#ime").after('<span class="error">* Molimo upišite Vaše ime ili naziv tvrtke.</span>');hasError=true;}
var telefonVal=$("#telefon").val();if(telefonVal==''+'Vaš kontakt telefon...'){var telefonVal=('');}
else{var telefonVal=$("#telefon").val();}
var emailFromVal=$("#emailFrom").val();if(emailFromVal==''+'Vaš email...'){$("#emailFrom").after('<span class="error">* Molimo upišite Vašu email adresu.</span>');hasError=true;}else if(!emailReg.test(emailFromVal)){$("#emailFrom").after('<span class="error">* Niste upisali ispravnu email adresu.</span>');hasError=true;}
var messageVal=$("#message").val();if(messageVal==''+'Vaša poruka...'){$("#message").after('<span class="error">* Molimo upišite Vašu poruku.</span>');hasError=true;}
if(hasError==false){$(this).hide();$("#sendEmail email").append('<img src="img/loading.gif" alt="Loading" id="loading" />');$.post("script/sendemail.php",{emailFrom:emailFromVal,message:messageVal,ime:imeVal,telefon:telefonVal},function(data){$("#sendEmail").slideUp("normal",function(){$("#sendEmail").before('<h2>Hvala!!</h2><h1>Vaša poruka je poslana.</h1>');window.setTimeout('window.open("index.html","_self")',3000);});});}
return false;});});function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3)
with(document)if(getElementById&&((obj=getElementById(args[i]))!=null)){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}}
var offsetxpoint=0
var offsetypoint=21
var ie=document.all
var ns6=document.getElementById&&!document.all
var enabletip=false
if(ie||ns6)
var tipobj=document.all?document.all["tooltip"]:document.getElementById?document.getElementById("tooltip"):""
function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function ddrivetip(thetext,thecolor,thewidth){if(ns6||ie){if(typeof thewidth!="undefined")tipobj.style.width=thewidth+"px"
if(typeof thecolor!="undefined"&&thecolor!="")tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false}}
function positiontip(e){if(enabletip){var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var rightedge=ie&&!window.opera?ietruebody().clientWidth-event.clientX-offsetxpoint:window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera?ietruebody().clientHeight-event.clientY-offsetypoint:window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)?offsetxpoint*(-1):-1000
if(rightedge<tipobj.offsetWidth)
tipobj.style.left=ie?ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px":window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if(curX<leftedge)
tipobj.style.left="5px"
else
tipobj.style.left=curX+offsetxpoint+"px"
if(bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie?ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px":window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"}}
function hideddrivetip(){if(ns6||ie){enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''}}
document.onmousemove=positiontip
