	// JavaScript Document
	function getDivByID(layerID) {
		if (document.getElementById) {
			// this is the way the standards work
			return document.getElementById(layerID);
		} else if (document.all) {
			// this is the way old msie versions work
			return document.all[layerID];
		} else if (document.layers){
			// this is the way nn4 works
			return document.layers[layerID];
		}
		return null;
	}
	//Trim Functions
	function ltrim(str) { 
		for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
		return str.substring(k, str.length);
	}
	function rtrim(str) {
		for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
		return str.substring(0,j+1);
	}
	function trim(str) {
		return ltrim(rtrim(str));
	}
	function isAlphaNumeric(val){
		if (val.match(/^[a-zA-Z0-9]+$/))
		{
		return true;
		}
		else
		{
		return false;
		} 
	}
	function isValidUserName(val){
		if (val.match(/^[a-zA-Z0-9_]+$/)){
			if(val.match(/^[_]+$/)){
				return false;
			}else{
				return true;
			}
		}else{
			return false;
		}
	}
	function isWhitespace(charToCheck) {
		var whitespaceChars = " \t\n\r\f";
		return (whitespaceChars.indexOf(charToCheck) != -1);
	}
	//End Trim Functions
	//Email Validation
		function isValidEmail(email){
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			if (filter.test(email)){
				return true;
			}else{
				return false;
			}
			
		}
	//Get Count Selected Values In Multi Select Combo 
	function countOfMultiSelect(comboName,count){
		var objCombo=comboName;
		var selCount=0;
		for (var i=0; i<objCombo.options.length; i++)
			selCount += (objCombo.options[i].selected)?1:0;
		if (selCount > count){
			return false;
		}else{
			return true;
		}
	}
	//Function To Count Characters Dynamically
	function countChar(field,length,divName){
		//alert(field);
		var len,val,msg;
		if (field.value == '') return;
		msg = field.value;
		len = msg.length;
		if(len > length){
			len = length;
			val = field.value;
			val = val.replace(/\r\n/g,"\n");
					field.value = val.substring(0,length);
			val = val.replace(/\n/g,"\r\n");
		}
		//var leng = length-len;
		divName.innerHTML = "Count : "+len;
		return true;
	}
	//Html Editor
	function __fncOpenHtmlEditor(strOwner, strValue){
		var newWin = window.open("./../htmlEditor.php?owner="+strOwner+"&value="+strValue, "", "ststusbar=1,menubar=0,height=600,width=1000,scrollbars=1");
		newWin.focus();
	}
	function __fncgenarateDay(sel){
		var month = thisForm.hbyMonth.value; 
		var year = thisForm.hbyYear.value; 
		if(month==0 || year==0){
			return;
		}
		var leap = (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
		if (month==4 || month==6 || month==9 || month==11) {
			var days = 30;
		}else if (month==2) {
			var days = leap;
		}else{
			var days = 31;
		}
		thisForm.hbyDay.options.length = days;
		for (var i = 1; i <= days; i++) {
			thisForm.hbyDay.options[i]=new Option(i,i);
			if(i==sel){
				document.getElementById('hbyDay').options[i].selected=true;
			}
		}
	}
	function numbersonly(myfield, e, dec){ 
		var key;
		var keychar;
		
		if (window.event)
			 key = window.event.keyCode;
		else if (e)
			 key = e.which;
		else
			 return true;
		keychar = String.fromCharCode(key);
		
		var val = myfield.value;
		if(val && keychar == '.'){
			if(val.split(".").length > 1){
				return false;
			}
		}
		
		// control keys
		if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
			 return true;
		
		// numbers
		else if ((("0123456789").indexOf(keychar) > -1))
			 return true;
		
		// decimal point jump
		else if ((dec) && (keychar == "."))
			 {
			 //myfield.form.elements[dec].focus();
			 return true;
			 }
		else
			 return false;
	}
	// Calcel Js function
	function __fncCancel(){
		thisForm.txtWhat2Do.value = '';
		thisForm.submit();
	}

	function makePOSTRequestCommon(url, parameters, id) {
		var id = id;
		//var	http_request = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/html');
			}
		} else if (window.ActiveXObject) { // IE
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
		if (!http_request) {
			alert('Cannot create XMLHTTP instance');
			return false;
		}
		http_request.onreadystatechange = function alertContents_01(){
			if (http_request.readyState == 4) {
				if (http_request.status == 200) {
					result = http_request.responseText;
					document.getElementById(id).innerHTML = result;  
				} else {
					document.getElementById(id).innerHTML = 'There was a problem with the request.';  
				}
			}
			};
		http_request.open('POST', url, true);
		http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		http_request.setRequestHeader("Content-length", parameters.length);
		http_request.setRequestHeader("Connection", "close");
		http_request.send(parameters);
	}
	
	function __fncTabMouseOut(obj){
		if(obj.className != 'tab_active'){
			obj.className = 'top_menu';
		}
	}
	function __fncTabMouseOver(obj){
		if(obj.className != 'tab_active'){
			obj.className = 'tab_hover';
		}
	}
	
	function __fncShowPopUp(page){
		URL = page;
		day = new Date();
		id1 = day.getTime();
		eval("page" + id1 + " = window.open(URL, '" + id1 + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=800,height=550,left = 300,top = 200');");
	}
	
	function __fncShowPopUpSmall(page){
		URL = page;
		day = new Date();
		id1 = day.getTime();
		eval("page" + id1 + " = window.open(URL, '" + id1 + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=800,height=200,left = 300,top = 200');");
	}
	function popup() {
	  //var contentHTML = document.getElementById('PrintContent').innerHTML;
	  //var winPopup = writeConsole();
	  
	 var con = '<div id=\"placeHolder\" align=\"center\" >'+ contentHTML +'</div>';
	 top.consoleRef=window.open('','placeHolder',
	  'width=960,height=800'
	   +',left=500'
	   +',top=300'
	   +',menubar=0'
	   +',toolbar=0'
	   +',status=0'
	   +',scrollbars=0'
	   +',resizable=1')
	 top.consoleRef.document.writeln(
	  '<html><head><style type="text/css"> td{ font-family:Arial, Helvetica, sans-serif; font-size:11px;} th{ font-family:Arial, Helvetica, sans-serif; font-size:11px;}</style><title>Content Pop-Up</title><script type=\"text/javascript\" language=\"JavaScript\">var timerDelay; function showIt(){document.getElementById(\'placeHolder\').innerHTML = window.opener.contentHTML; timerDelay = window.setTimeout(\"window.print()\",1000);}<\/script></head>'
	   +'<body onLoad="showIt()">'
	   +con
	   +'</body></html>'
	 )
	 top.consoleRef.document.close()
	}
	function printpopup() {
	  //var contentHTML = document.getElementById('PrintContent').innerHTML;
	  //var winPopup = writeConsole();
	  
	 var con = '<div id=\"placeHolder\" align=\"center\" >'+ contentHTML +'</div>';
	 top.consoleRef=window.open('','placeHolder',
	  'width=960,height=800'
	   +',left=500'
	   +',top=300'
	   +',menubar=0'
	   +',toolbar=0'
	   +',status=0'
	   +',scrollbars=0'
	   +',resizable=1')
	 top.consoleRef.document.writeln(
	  '<html><head><style type="text/css"> td{ font-family:Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold} th{ font-family:Arial, Helvetica, sans-serif; font-size:11px;}</style><title>Content Pop-Up</title><script type=\"text/javascript\" language=\"JavaScript\">var timerDelay; function showIt(){document.getElementById(\'placeHolder\').innerHTML = window.opener.contentHTML; timerDelay = window.setTimeout(\"window.print()\",1000);}<\/script></head>'
	   +'<body onLoad="showIt()">'
	   +con
	   +'</body></html>'
	 )
	 top.consoleRef.document.close()
	}