// JavaScript Document

	 //  var arrTemp=self.location.href.split('?'); 
	 //  var picUrl = (arrTemp.length > 0)?arrTemp[1]:''; 
	   var NS = (navigator.appName=="Netscape")?true:false; 


/* 
	Descirption: Resajzanje otovrenog prozora na dimenzije slike
	File: *.asp
*/
     function FitPic() { 
       iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
       iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
       iWidth = document.images[0].width - iWidth; 
       iHeight = document.images[0].height - iHeight; 
       window.resizeBy(iWidth, iHeight); 
       self.focus(); 
     }

/* 
	Descirption: Otvaranje novog prozora
	File: *.asp
*/
	function PopupPic(sPicURL) { 
    	openWin(sPicURL,'previewImg','800','600','yes'); 
   } 

	function openWin(file,name,w,h,resizable,otherFeat){
		l=screen.width/2-w/2;
		t=screen.height/2-h/2;
		if(otherFeat) otherFeat= ',' + otherFeat
		return window.open(file,name,'width='+w+',height='+h+',scrollbars=no,resizable='+resizable+',top='+t+',left='+l+otherFeat);
	}
	
	function validateForm(objForm) {
		var name = (objForm.name.value)?1:0;
		var email = checkEmail(objForm.email.value)?1:0;
		
		var msg = 'Molimo ispravite slijedece greške;\n\n';
		
		if (!name || !email) {
			if (!name) msg += ('- unesite ime!\n');
			if (!email) msg += ('- unesite ispravan e-mail!\n');
			alert(msg);
			return false;
		  }
		  
		openWin('','upit','350','350','yes','scrollbars=yes');
	}	
	
	/* 
		Descirption: validacija e-maila
		File: internal usage
	*/
	function checkEmail(email) {
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(email)) {
			return true;
			}
		return false;
	}	
	
	
	