function verific(obj){
	objYears = document.form1.years;
	for(i=0;i<objYears.length;i++){
		if(objYears.options[i].text == obj.value){
			alert(_msg_exist);
			return false;
		}
	}
	obj.value=obj.value.replace(/^\s*|\s*$/g,'');
	if(obj.value=='' || obj.value==0){
		obj.focus();
		alert(_msg_yearInvalid);
		return false;
	}
	return true;
}

function openWindow(scriptfile,width,height,objClick,keepData){
	if(!keepData) wout=false;
	if(objClick.decide=="upload"){
		objNewClick=document.getElementById("upload"+objClick.id.substring(3,objClick.id.length));
		objNewClick.onclick();
		return false;
	}
	if(window.openwindow) openwindow.close();
	if(keepData=="keepData") calendarOpen(scriptfile,'unica',width,height,'scrollbars=yes,status=yes');
	else if(keepData=="enlarge") calendarOpen(scriptfile,'unica',width,height,'scrollbars=yes,resizable=yes');
	else if(keepData=="schita") calendarOpen(scriptfile,'unica',width,height,'scrollbars=yes,resizable=yes','center');
	else calendarOpen(scriptfile,'unica',width,height,'scrollbars=no,resizable=no','center');
}

function checkTitle(objTitle){
	if(objTitle.decide=="upload") objTitle.title=_msg_uploadImg;
	else if(objTitle.decide=="enlarge") objTitle.title=_msg_enlargeImg;
	else objTitle.title="";
}

function confirm_del(){
	test = confirm(_msg_test);
	if(test) return true;
	else return false;
}

function schimbat(value){
	if(value){
		document.form1.img.width=0;
		document.form1.img.height=0;
		objTabel = document.getElementById('tableUploading');
		objTabel.style.display="";
		document.form1.hiddendone.value=1;
		document.form1.submit();
	}
}

function cancelDelete(){
	var divArray = document.getElementsByTagName("img");
	for (var i = 0; i < divArray.length; i++){
		if(divArray[i].id.search("del") != -1){
			pozaObj = document.getElementById("img"+divArray[i].id.substring(3,divArray[i].id.length));
			if(pozaObj.decide=="upload"){
				divArray[i].style.display="none";
			}
		}
	}
}

function nullCheck(obj){
	if(obj.value>0) return true;
	else{
		alert(_msg_invalid);
		return false;
	}
}

function closeQuickViewWindow(){
		if(window.openwindowqw && !window.openwindowqw.closed){
			openwindowqw.close();
		}
		if(window.openwindow && !window.openwindow.closed){
			openwindow.close();
		}
}