// browser detection:
var ua = navigator.userAgent;
var ie = (navigator.appName.toLowerCase().indexOf("internet explorer")!=-1)?1:0;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns4 = (document.layers)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (ua.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;
var macie = (mac && !ns)?1:0;
var opera = (ua.toLowerCase().indexOf("opera")!=-1)?1:0;

// Trim leading and trailing spaces
function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}

// Validate email address
function emailAddressIsValid(str){
	var emailAddressFormat = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,3}$/;
	if (!(emailAddressFormat.test(str))){
		return false;
	}
	return true;
}
function OpenImage(imgFile){
	if (new String(newWinImg)!="undefined" && newWinImg!=null) if (!newWinImg.closed) newWinImg.close();
	var newWinImg=window.open("","ReservedItemsPicture","width=100,height=100,top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=no,menubar=no,status=no,toolbar=no,scrollbars=no,z-lock=yes");
	newWinImg.document.write('<HTML><HEAD><TITLE>Productie Geam Termoizolant</TITLE></HEAD><BODY marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 alink="#0033CC bgcolor="#E5F2FF" onload="window.resizeTo(parseInt(document.images[\'img\'].width)+10,parseInt(document.images[\'img\'].height)+29)"><IMG src="' + imgFile + '" name=img></BODY></HTML>')
	newWinImg.document.close()
	newWinImg.focus();
}
