	//*************************************************************************
	//***	DOM LIBRARY
	//*************************************************************************

	//*** GLOBAL VARIABEL
	var blnDOM = false;
	
	//*** FUNCTIONS	
	//Advanced dthml check
	if (document.getElementById && document.createElement){
		blnDOM = true;
	}		
	
	//default image switch
	function fjsImgSwitch(id, imgsrc){
		if (blnDOM == true){		
			if (document.getElementById(item)){		
				//Switch image	
				document.getElementById(item).src = imgsrc;			
			}
		}
	}
	
	//Tool, strips away all path info
	function fjsGetFileName(varName) {
		var re = /^.*\/(\S*\.\S*)$/;
		var tmp = new String(varName);
		tmp = tmp.match(re)[1];
			
		return tmp;
	}
	
	//Swap classes for any item
	function fjsSwapClass(strId, class1, class2){
		if (blnDOM == true){			
			//Check if element exists
			if (document.getElementById(strId)){
				//Switch class
				if (document.getElementById(strId).className == class1){
					document.getElementById(strId).className = class2;
				}
				else if(document.getElementById(strId).className == class2){
					document.getElementById(strId).className = class1;
				}
			}
		}
	}
		
	//Change class for any item
	function fjsChangeClass(strId, class1){
		if (blnDOM == true){
			//Check if element exists
			if (document.getElementById(strId)){
				//Change class
				document.getElementById(strId).className = class1;
			}
		}
	}
	
	//Clear input boxes for default data 
	function fjsClearBox(e){			
		e.value = "";
		e.focus();			
	}	

	
	function fjsGoToURl(value){
			if (value != 0){
				window.open(value,'_self');
				document.frmApplication.reset();
			}
		}
		function fjsSubmitSearch(type)
		{
			var objSearchText;
			var objForm;
			var strValue;	
			
			if (type==1)//normal search
			{
				objSearchText = document.frmDashboardSearch.strSearchDashboardTxt;
				objForm = document.frmDashboardSearch;					
					
				strValue = objSearchText.value;
				if (strValue.length > 0){
					objForm.submit();
				}
			}
			else
			{
				objSearchText = document.frmEmployeeSearch.strEmployeeSearch;
				objForm = document.frmEmployeeSearch;					
					
				strValue = objSearchText.value;
				if (strValue.length > 0){
					objForm.submit();
				}
			}
		}
		function fsjSearchBtnChange(type,id)
		{
			var btnLeftId = "btnSearchLeft" + id;
			var btnRightId = "btnSearchRight" + id;
			if (type==1) //on mouse out
			{
				document.getElementById(btnLeftId).src = strAppRoot + "images/btn_left.gif";
				document.getElementById(btnRightId).src = strAppRoot + "images/btn_right.gif";
			}
			if (type==2) //on mouse over
			{
				document.getElementById(btnLeftId).src = strAppRoot + "images/btnLeft_over.gif";
				document.getElementById(btnRightId).src = strAppRoot + "images/btnRight_over.gif";
			}		
		}

		var expires = 180000;
    	function fjsChangeFontSize(theme)
		{
		
			// function for changing stylesheets using document.styleSheets
			for ( i = 0; i < document.styleSheets.length; i++ ) {
				if ( document.styleSheets[i].title ) {
					if (( document.styleSheets[i].title == 'Largest' ) ||( document.styleSheets[i].title == 'Larger' ) || (document.styleSheets[i].title == 'Normal'))
					{
					
						document.styleSheets[i].disabled = true;
						if ( document.styleSheets[i].title == theme )
						{
							document.styleSheets[i].disabled = false;
						
						if (document.styleSheets[i].title == 'Largest')
						{
							document.getElementById("Largest").style.fontWeight="bold";
							document.getElementById("Normal").style.fontWeight="normal";
							document.getElementById("Larger").style.fontWeight="normal";
						}
						if (document.styleSheets[i].title == 'Normal')
						{
							document.getElementById("Largest").style.fontWeight="normal";
							document.getElementById("Normal").style.fontWeight="bold";
							document.getElementById("Larger").style.fontWeight="normal";
						}
						if (document.styleSheets[i].title == 'Larger')
						{
							document.getElementById("Largest").style.fontWeight="normal";
							document.getElementById("Normal").style.fontWeight="normal";
							document.getElementById("Larger").style.fontWeight="bold";
						}
						}
						Set_Cookie("stylesheet",theme,expires);
					}
				}
			}
			
     	}
     	function Get_Cookie(name) {
     		//alert("Get_Cookie: " + name);
			var start = document.cookie.indexOf(name+"=");
			var len = start+name.length+1;
			if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
			if (start == -1) return null;
			var end = document.cookie.indexOf(";",len);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(len,end));
		}

		function Set_Cookie(name,value,expires,path,domain,secure) {
			//alert("Set_Cookie: " + value);
			document.cookie = name + "=" +escape(value) +
				( (expires) ? ";expires=" + expires.toGMTString() : "") +
				( (path) ? ";path=" + path : "") + 
				( (domain) ? ";domain=" + domain : "") +
				( (secure) ? ";secure" : "");
		}
		 
		

