
function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}



function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}


function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "inline";
}



function HideContentx(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}


function ShowContentx(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}


function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}






function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}







function ajaxRequset(url, div)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  document.getElementById(div).innerHTML=xmlhttp.responseText;
  }
}
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}






function GetValue(obj){
return document.getElementById(obj).value;
}

function SetValue(text, obj){
document.getElementById(obj).value = text;
}



function GetHtml(obj){
return document.getElementById(obj).innerHTML;
}

function SetHtml(text, obj){
document.getElementById(obj).innerHTML = text;
}



var nn4 = (navigator.appName.indexOf("Netscape") > -1 && navigator.appVersion.indexOf("4") > -1) ? true : false
 

//function for forcing form submission
function checkEnter(e, path, txt){
	
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
	 //var srch = document.getElementById(searchvalue).value;
	 var srch = document.getElementById(txt).value;
	 window.location = path + srch;
	
 	
	
 	
	 }

	
}



//function for forcing form submission
function DoSearch(path, txt){
	
	 var srch = document.getElementById(txt).value;
	 window.location = path + srch;
		
}



function switch_div(t, div){
	 
	 
		for (i = 0; i<4; i++){
		
		
		 
			if(t == i){
			ShowContentx(div + i);
			
			
			}
			else
			{
			 HideContentx(div + i);
		

			 
			}
		
		}
	
	}






function switch_div8(t, div){
	 
	 
		for (i = 0; i<8; i++){
		
		
		 
			if(t == i){
			ShowContentx(div + i);
			
			
			}
			else
			{
			 HideContentx(div + i);
		

			 
			}
		
		}
	
	}


