var kontrola = 0;

var pictureWin = null;


function prenos(mypage, myname, w, h, scroll, vrijednost) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;

splitani = vrijednost.split(".")
for (i=0;splitani[i];i++) {
}

splitani[i-2] += "v"
spojeni = ""
for(j=0;j<i;j++) {
	if (j!=i-1) spojeni += splitani[j] + "."
else spojeni += splitani[j]
}

myname = myname.replace("_","  ")

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize'
win = window.open(mypage, 'a', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
win.document.writeln("<title>" +myname+ "</title>");
win.document.writeln("<style type=\"text/css\"><!-- .body { font-family:  Arial, Helvetica, sans-serif; font-size: 11px; font-style: normal; font-weight: normal; text-decoration: none }--></style>")
win.document.write("<body bgcolor=\"#FFFFFF\"   text=\"#000000\" leftmargin=\"0\" topmargin=\"0\">");
win.document.writeln("<img name=fotog src=\"" +spojeni+ "\">");
win.document.write("<span class=body>Please wait...</span>");
while (!win.fotog.complete) {
}
win.resizeTo(win.fotog.width+7,win.fotog.height+29);
win.document.writeln("</body>");
}


function init(){
    linkovi = document.getElementsByTagName ("a");
    for (x=0; x < linkovi.length; x++){
      linkovi[x].onfocus = new Function ('if (this.blur) this.blur()');
    }
  }

function clearfield(){
if (document.findform.sear.value == "Unesite pojam")
	document.findform.sear.value = "";
}

function KW_autoClear(obj,def){
	if (obj.value==def) obj.value=""
}
function AutoRestore(obj,def){
	if (obj.value == "" ) obj.value = def
}
// ispisuje  "bookmark / add to favorites" ovisno o browseru 
function writeBookFav(){
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		document.write("add to favorites")
	}
	else
	{
		document.write("bookmark page")	
	}
}
// Print Page
function Printaj(x,sirina) {
w = sirina + 50
h = 400
var win2 = (screen.width - w) / 2;
var win3 = (screen.height - h) / 2;

winprops = 'height='+h+',width='+w+',top='+win3+',left='+win2+',scrollbars=yes,noresize,status=yes'
printWin = window.open('/print.asp','Kornatturist',winprops)

if (parseInt(navigator.appVersion) >= 4) { printWin.window.focus(); }
printWin.x = x
printWin.sirina = sirina
}
function preporuci( lang, stranica ) {
		
		

		var theURL 		= "/preporuci.asp?lang=" + lang +"&stranica=" + stranica
//		alert(theURL)
		var winName		= ","
		var features	= "width=426,height=200"
		
		var winl = (screen.width  -220) / 2;
		var wint = (screen.height -200 ) / 2;
		features += ' top='+wint+',left='+winl+',noresize'
		
		window.open(theURL,'',features);
}
function bookmark(title,url) {
			if (window.sidebar) {
			    window.sidebar.addPanel(title, url,"");
			} else if( document.all ) {
			    window.external.AddFavorite( url, title);
			} else if( window.opera && window.print ) {
			    return true;
			}
}

function openDestinacija(id,rivijera){
	location.href="destinacije.asp?id="+id+"&sifra_rivijera="+rivijera;
}									  
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
