//------------------------------------------------------------------------------------------------------------------------
function button_onmouseoverLeft(id){	eval("Link_" + id).className = "button_left_over";
}
function button_onmouseoutLeft(id){
	eval("Link_"+id).className = "button_left_normal";
}
function DisplayTitle(locTitle){
	MainTitle.innerText="    " + locTitle
}	
//------------------------------------------------------------------------------------------------------------------------
function checkpozitiveintegerfield(fieldname)
{
	if ((ispozitiveinteger(fieldname.value)) && (! isempty(fieldname.value))){return true}
	alert("Please enter pozitive integer value.");
	fieldname.focus();
	return false;	
}
//------------------------------------------------------------------------------------------------------------------------
function isreal(varstr) {
	var eroare = 0;
	for (var i = 0; i < varstr.length ; i++)
	{
	var sir = varstr.substring(i,i+1)
	if ((sir < "0" || sir > "9") && sir != ".")
		{
 		if (sir == "-" && i==0)
			{
		    //nothing
			};
			else {return false}	
		}
	}
	return true
}
//------------------------------------------------------------------------------------------------------------------------
function isinteger(varstr) {
	var eroare = 0;
	for (var i = 0; i < varstr.length ; i++)
	{
	var sir = varstr.substring(i,i+1)
	if ((sir < "0" || sir > "9"))
		{
 		if (sir == "-" && i==0)
			{
		    //nothing
			};
			else {return false}	
		}
	}
	return true
}
//------------------------------------------------------------------------------------------------------------------------
function ispozitiveinteger(varstr) {
	var eroare = 0;
	for (var i = 0; i < varstr.length ; i++)
	{
	var sir = varstr.substring(i,i+1)
	if ((sir < "0" || sir > "9"))
		{
			return false
		}
	}
	return true
}


//------------------------------------------------------------------------------------------------------------------------
function ParseToFloat(fieldname) {
	//if ((isreal(fieldname.value)) && (! isempty(fieldname.value))){return true}
	fieldname.value = parseFloat("0" + fieldname.value)
	//return false;	
}
//------------------------------------------------------------------------------------------------------------------------
function ParseToInt(fieldname) {
	//if ((isreal(fieldname.value)) && (! isempty(fieldname.value))){return true}
	fieldname.value = parseInt("0" + fieldname.value)
	//return false;	
}

//------------------------------------------------------------------------------------------------------------------------
function settoday(formname,fieldname) {
	DateObject = new Date()
	//alert (formname + " + " + fieldname);
	document.forms[formname].elements[fieldname+"Year"].value = DateObject.getYear();
	document.forms[formname].elements[fieldname+"Month"].value = DateObject.getMonth()+1;
	document.forms[formname].elements[fieldname+"Day"].value = DateObject.getDate();
	
}
function goLink(theLink) {
  document.location.href = "outlink.asp?" + theLink
}


function MyDeleteV2(link){
	if (window.confirm('Are you sure you want to delete this?')) {
		document.location = link
	}
}

function MyDelete(ID,ListAspFile,IDField){
	var Linkchar
	if (ListAspFile.indexOf('?') > 0) {
		Linkchar="&" ;
	} else {
		Linkchar="?"
	};
	if (window.confirm('Are you sure you want to delete this?')) {
		s = ListAspFile + Linkchar + "OP=DEL&" + IDField + "=" + ID 
		document.location = s
	}
}
function MyEdit(ID,EditAspFile,IDField){
	var Linkchar
	var Linkchar
	if (EditAspFile.indexOf('?') > 0) {
		Linkchar="&" ;
	} else {
		Linkchar="?"
	};
	s = EditAspFile + Linkchar + IDField + "=" + ID 
	document.location = s
}

function MyEditImage(ID,EditAspFile,IDField){
	var Linkchar
	var Linkchar
	if (EditAspFile.indexOf('?') > 0) {
		Linkchar="&" ;
	} else {
		Linkchar="?"
	};
	s = EditAspFile + Linkchar + IDField + "=" + ID 
	document.location = s
}



function ShowPictureLoader(IMGID,defaultTMPID,controlname) {
	var url
	newurl="/administration/PictureLoader.asp?IMGID=" + IMGID + "&defaultTMPID=" + defaultTMPID + "&controlname=" + controlname
	newwin=window.open(newurl,"PictureLoaderWindow","toolbar=no,status=yes,resizable=yes,width=400,height=400,scrollbars=yes")
	newwin.focus();
}
function ReturnFromImageEditor(result) {
	datapicture.src=result + "?t=" + Math.random() 
}

function ShowBigPicture(GALID,CATID,IMGID){
	var d = new Date()
	var url
	newurl="/DetailPage.asp?GALID=" + GALID + "&CATID=" + CATID + "&IMGID=" + IMGID + "&t=" + d.getSeconds()
	var newwin
	newwin=window.open(newurl,"BigPicture","toolbar=no,resizable=yes,width=100,height=100,scrollbars=no")
	newwin.focus();
}



