
// ========= Inicijaliziraj element =========================
// ==========================================================
function getEl(sId) {
  return (document.all? document.all(sId): (document.getElementById? document.getElementById(sId): null));
};


// ========= Zoom prozor za fotke ===========================
// ==========================================================
   function zoom( sPic, nWidth, nHeight )
   {
     var winURL 			= 'pic.asp?id=' + sPic
     var winIme 			= 'zoom'
     var winAtributi 	=
       'width='+ ( nWidth + 50 ) +''       +
       ',height='+ ( nHeight + 50 ) +''     +
       ',toolbar=no'     +
       ',location=no'    +
       ',directories=no' +
       ',status=no'      +
       ',menubar=no'     +
       ',scrollbars=no' +
       ',resizable=no'  ;

     var win = eval("window.open(winURL, winIme, winAtributi)");
		 win.focus();
   }
	 

// ========= Refresh prozor za fotke ========================
// ==========================================================
   function refresh()
   {
     var picWidth 		= getEl( 'bigPic' ).width;
     var picHeight 		= getEl( 'bigPic' ).height;
		 if ( navigator.appName == 'Netscape' ) {
	   	 self.resizeTo( picWidth+56, picHeight+98 );
	   }
	   else {
	    	self.resizeTo( picWidth+56, picHeight+80 );
	   }
   }	 
	 
	 
// Provjera upisa u kontakt obrascu
function FormCheck()
{
   fali = "";
   faliEN = "";
   if (document.obrazac.fIme.value == "") {
     fali = fali + "\n- ime i prezime"
     faliEN = faliEN + "\n- name"
   }
   if (document.obrazac.fTvrtka.value == "") {
     fali = fali + "\n- naziv tvrtke";
     faliEN = faliEN + "\n- company name";
   }
   if (document.obrazac.fAdresa.value == "") {
     fali = fali + "\n- adresu";
     faliEN = faliEN + "\n- address";
   }
   if (document.obrazac.fMjesto.value == "") {
     fali = fali + "\n- po\u0161tanski broj i mjesto";
     faliEN = faliEN + "\n- ZIP, city and country";
   }
   if (document.obrazac.fTelefon.value == "") {
     fali = fali + "\n- telefon";
     faliEN = faliEN + "\n- telephone number";
   }
   if (document.obrazac.fPoruka.value == "") {
     fali = fali + "\n- poruku";
     faliEN = faliEN + "\n- your message";
   }

   if (fali != "")
      alert ("Niste upisali sve potrebne podatke!" + "\n" + "Molimo upi\u0161ite:" + fali + "\n\n" +
             "Fields marked with asterisk * are required!" + "\n" + "Please fill in the following:" + faliEN)
   else
	   document.obrazac.submit();
}	 


// =============== Default functions ========================
// ==========================================================

function top() {
  window.scrollTo(0, 0);
}


function back() {
  history.back();
} 
