//*********************************************************************************
// Scripts coded and deleoped by artMedias. All rights reserved
//*********************************************************************************
function loadIframe(id,href){ if (bw.ie||bw.op) document.all[id].src=href; else document.getElementById(id).src=href }
function getObj(id){ if (bw.ie4) return document.all[id]; else return document.getElementById(id) }
function showLayer(id){	getObj(id).style.visibility = "visible" }
function hideLayer(id){	getObj(id).style.visibility = "hidden" }
function displayOn(id){	getObj(id).style.display = "block" }
function displayOff(id){ getObj(id).style.display = "none" }
function overRow(id,cls){ getObj(id).className = cls }
function outRow(id,cls){ getObj(id).className = cls }

function getHeight(id) { if (bw.ie) return document.all[id].clientHeight; else return document.getElementById(id).offsetHeight }
function getWidth(id) {	if (bw.ie) return document.all[id].clientWidth; else return document.getElementById(id).offsetWidth }
function setHeight(id,h) { id.style.height = h }
function getVisib(id){ return getObj(id).style.visibility }
function isVisible(id) { if (id.style.visibility=="visible") return true; return false }
function isDisplay(id) { if (getObj(id).style.display=="block") return true; return false }
function getBodyW(){ return (bw.ie) ? document.body.clientWidth : window.innerWidth }
function getBodyH(){ return (bw.ie) ? document.body.clientHeight : window.innerHeight }
function writeLayer(id,text) { if(bw.op) writeLayerText(id,text); getObj(id).innerHTML = text }
function writeLayerText(id,text) { getObj(id).innerText = text }
function getInnHtml(id){ return getObj(id).innerHTML }

function add2WishList(id,subObjName){
	loadHref = "shopping-cart-box.asp?itemId=" + id + "&subObjName=" + subObjName
	loadIframe("wishCart",loadHref)
}

function add2Fav(loc,nam){ if (bw.ie) window.external.AddFavorite(loc,nam);
	else if (bw.ns6 && (typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function"))  window.sidebar.addPanel (nam,loc,'');}

function fadeIn(){ see += 11; if (document.all) obj.style.filter = 'alpha(opacity='+ see +')'; else obj.style.MozOpacity = see+'%'; if(see<maxGo) setTimeout('fadeIn()', 100);}
function fadeOut(cont){ if(cont){obj=cont;} see -= 18; if (document.all) obj.style.filter = 'alpha(opacity='+ see +')'; else obj.style.MozOpacity = see+'%'; if(see>0) setTimeout('fadeOut()', 100); else obj.style.visibility="hidden"}

function fill(value){ if (value.toString().length<2) value='0'+value; return value }
function printPage(pageLang){
	document.printThis.docTitle.value=document.title;
	document.printThis.docCont.value=getObj('content-main').innerHTML;
	document.printThis.docLang.value=pageLang;
	MM_openBrWindow('','printPg','menubar=yes,scrollbars=yes,resizable=yes','743','590','false');
	document.printThis.submit();
}

function accImgPrev(imgName,accId,objType,imgW,imgH,pageLang){
		imgW = imgW + 60
		imgH = imgH + 60
		var theURL='../Includes/accImgPreview.asp?objId='+accId+'&mainId='+accId+'&objType='+objType+'&imgName='+imgName+'&pageLang='+pageLang
		MM_openBrWindow(theURL,'imgBox','status=yes,resizable=yes',imgW,imgH,'false',33,33);
}
function accMapPrev(mainObjCode,pageLang){
		winW = 900
		winH = 630
		var theURL='../Includes/accMapPreview.asp?objCode='+mainObjCode+'&pageLang='+pageLang
		MM_openBrWindow(theURL,'mapBox','menubar=yes,scrollbars=no,resizable=no,status=yes',winW,winH,'false',33,33);
}
function accMapTownPrev(subObjTownCode,pageLang){
		winW = 550
		winH = 450
		var theURL='../Includes/accMap-island.asp?subObjTownCode='+subObjTownCode+'&pageLang='+pageLang+'&noResize=True'
		MM_openBrWindow(theURL,'mapTwnBox','status=yes,resizable=yes',winW,winH,'false',33,33);
}
function wallImgPrev(imgID,imgW,imgH,pageLang){
		var theURL='../Includes/wallpaperImgPreview.asp?imgID='+imgID+'&imgW='+imgW+'&imgH='+imgH+'&pageLang='+pageLang
		MM_openBrWindow(theURL,'wallBox','status=no,resizable=yes,scrollbars=yes',imgW-133,imgH-133,'false',18,18);
}

//*********************************************************************************
// Modified Macromedia Functions v3.0
//*********************************************************************************
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_validateForm() {
  var item=''; var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) {
  	test=args[i+2]; val=getObj(args[i]); item=getObj(args[i]);
    if (val) { nm=val.id; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+=' * '+nm+' is not a valid e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+=' * '+nm+' mora sadržavati odgovarajući poštanski broj  \n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+=' * '+nm+' mora sadržavati odgovarajući poštanski broj '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') {
    		errors += ' * '+nm+ '\n';
    		item.className="textinputError" }
    	}
  } if (errors) alert('The required information is incomplete or contains errors:\n'+errors);
  document.MM_returnValue = (errors == '')}

function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter, inLeft, inTop) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  } else {
  	features+=(features!='')?',':'';
    features+=',left='+inLeft+',top='+inTop;
  	}
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


//***** Tool-tip
var tipStart = 0
var offsetfromcursorX=12
var offsetfromcursorY=10
var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
var tipobj
var pointerobj

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(thetext, thewidth, thecolor){
	if (tipStart==0) return;
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 (tipStart==0) return;

if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
		if (tipStart==0) return;
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

//*********************************************************************************
// www.projectseven.com - P7AniMagic
//*********************************************************************************

function P7AniMagic(el,x,y,a,b,c,s) { //v2.9 PVII-Project Seven Development
 var xx,yy,i,g,elo=el,f="",m=false,d="",pa='px';if(document.layers||window.opera){pa='';}
 x=parseInt(x);y=parseInt(y);var t='g.p7Magic=setTimeout("P7AniMagic(\''+elo+'\','; 
 if((g=getObj(el))!=null){d=(document.layers)?g:g.style;}else{return;}
 if(parseInt(s)>0){eval(t+x+','+y+','+a+','+b+','+c+',0)",' + s+')');return;}
 xx=parseInt(d.left);if(isNaN(xx)){if(g.currentStyle){xx=parseInt(g.currentStyle.left);
 }else if(document.defaultView&&document.defaultView.getComputedStyle){
 xx=parseInt(document.defaultView.getComputedStyle(g,"").getPropertyValue("left"));}
 if(isNaN(xx)){xx=0;}}yy=parseInt(d.top);if(isNaN(yy)){if(g.currentStyle){yy=parseInt(g.currentStyle.top);
 }else if(document.defaultView&&document.defaultView.getComputedStyle){
 yy=parseInt(document.defaultView.getComputedStyle(g,"").getPropertyValue("top"));}
 if(isNaN(yy)){yy=0;}}if(c==1){x+=xx;y+=yy;m=true;c=0;}else if(c==2){m=false;
 if(g.p7Magic){clearTimeout(g.p7Magic);}}else{i=parseInt(a);if(g.p7Magic){clearTimeout(g.p7Magic);}
 if(xx<x){xx+=i;m=true;if(xx>x){xx=x;}}if(xx>x){xx-=i;m=true;if(xx<x){xx=x;}}
 if(yy<y){yy+=i;m=true;if(yy>y){yy=y;}}if(yy>y){yy-=i;m=true;if(yy<y){yy=y;}}}
 if(m){d.left=xx+pa;d.top=yy+pa;eval(t+x+','+y+','+a+','+b+','+c+',0)",'+b+')');}
}

function initPage(){
	MM_preloadImages('../images/design/flagsround/en-on.gif','../images/design/flagsround/hr-on.gif','../images/design/flagsround/it-on.gif','../images/design/flagsround/de-on.gif','../images/design/flagsround/pl-on.gif')
	tipStart = 1
	if (ie||ns6)
	tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
	pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

	document.onmousemove=positiontip
}
window.onload = initPage