function setFaceSize(myID,local_fontSize) {
		//lineHeight = local_fontSize+Math.round(.3*local_fontSize);
		obj = document.getElementById(myID);
		obj.style.fontSize = local_fontSize+"px";
		//obj.style.lineHeight = lineHeight+"px"
}

function FontLarger(myID) {
	if (myID == "") {
		myID = "txt";
	}
	obj = document.getElementById(myID);
	var local_fontSize = obj.style.fontSize;
	if (local_fontSize == "") {
		local_fontSize = 11;
	} else {
		local_fontSize = local_fontSize.replace("px","")
	}
	local_fontSize = Math.floor(local_fontSize);
	if (local_fontSize < 15) {
		local_fontSize += 2;
		setFaceSize(myID,local_fontSize);
	}
}
	
function FontSmaler(myID) {
	if (myID == "") {
		myID = "txt";
	}
	obj = document.getElementById(myID);
	var local_fontSize = obj.style.fontSize;
	if (local_fontSize == "") {
		local_fontSize = 11;
	} else {
		local_fontSize = local_fontSize.replace("px","")
	}
	local_fontSize = Math.floor(local_fontSize);
	if (local_fontSize > 9) {
		local_fontSize -= 2
		setFaceSize(myID,local_fontSize);
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var PagingPopUpWin = 0;
function PagingPopUpWindow(URLStr, left, top, width, height) {
	if (left == 'mid') {
		left = (screen.width-width)/2
	}
	if (top == 'mid') {
		top = (screen.height-height)/2
	}
	if(PagingPopUpWin) {
		if(!PagingPopUpWin.closed) PagingPopUpWin.close();
	}
	PagingPopUpWin = open(URLStr, 'PagingPopUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
function PrintMe(id,langue) {
	if (id == "")
		id = "printid_"
	if (langue == "")
		langue = "1"
	PagingPopUpWindow("/common/print.asp?langue=" + langue + "&a=htmlgrab&id=" + id, 'mid', 'mid', 700, 550)
}

//####################################
//#####		   FORM FOCUS		 #####
//####################################
	var elem = 0;
	function formFocus() {
		try {
			if (document.forms[0].elements[elem].type == "button" || document.forms[0].elements[elem].type == "checkbox" || document.forms[0].elements[elem].type == "hidden" || (document.forms[0].elements[elem].type == "select-one" && document.forms[0].elements[elem].id == "inpList") ) {
				elem += 1;
				formFocus();
			} else {
				document.forms[0].elements[elem].focus();
			}
		} catch (e) {
			//alert(e.description)
		}
	}

	function OMconfirm(msg,url) {
		if ( confirm( msg ) ) {
			location = url;
		}
	}

	function countRest(obj,id) {
		try {
			if (obj.value.length > 255) {
				obj.value = Left(obj.value,255);
			}
			TheDiv = document.getElementById(id);
			TheDiv.innerHTML = 255 - obj.value.length;
		} catch (e) {
			alert(e.description)
		}
	}
	function Left(str, n){
		if (n <= 0)
			return "";
		else if (n > String(str).length)
			return str;
		else
			return String(str).substring(0,n);
	}
	function Right(str, n){
		if (n <= 0)
		   return "";
		else if (n > String(str).length)
		   return str;
		else {
		   var iLen = String(str).length;
		   return String(str).substring(iLen, iLen - n);
		}
	}
	function ShowMe(msg) {
		var eventslayer = document.getElementById("eventslayer");
		eventslayer.innerHTML = msg;
		if (IE) {
			eventslayer.style.display = "block";
			popUp(event,'eventslayer')
		} else {
			ShowLayerXY('eventslayer',10,0)
		}
		return true
	}
/*
###################################################################################
############################## AUTO-GENERATED SCRIPT ##############################
###################################################################################
*/
	function FP_openNewWindow(w,h,nav,loc,sts,menu,scroll,resize,name,url) {//v1.0
		var windowProperties=''; if(nav==false) windowProperties+='toolbar=no,'; else
		windowProperties+='toolbar=yes,'; if(loc==false) windowProperties+='location=no,'; 
		else windowProperties+='location=yes,'; if(sts==false) windowProperties+='status=no,';
		else windowProperties+='status=yes,'; if(menu==false) windowProperties+='menubar=no,';
		else windowProperties+='menubar=yes,'; if(scroll==false) windowProperties+='scrollbars=no,';
		else windowProperties+='scrollbars=yes,'; if(resize==false) windowProperties+='resizable=no,';
		else windowProperties+='resizable=yes,'; if(w!="") windowProperties+='width='+w+',';
		if(h!="") windowProperties+='height='+h; if(windowProperties!="") { 
		if( windowProperties.charAt(windowProperties.length-1)==',') 
		windowProperties=windowProperties.substring(0,windowProperties.length-1); } 
		window.open(url,name,windowProperties);
	}
