function textCounter(field, countfield, maxlimit) 
{
                if (field.value.length > maxlimit)
                    field.value = field.value.substring(0, maxlimit);
                else
                    countfield.value = maxlimit - field.value.length;
                }

 function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
    }
      function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


        function HideContent(d) {
        document.getElementById(d).style.display = "none";
        }
        function ShowContent(d) {
        document.getElementById(d).style.display = "block";
        }
        function ReverseDisplay(d) {
        if(document.getElementById(d).style.display == "none") 
        { 
            document.getElementById(d).style.display = "block"; 
            document.getElementById('imgpane').src='/images/pane-splitter-coll-v-e-new.gif';
            createCookie('splitterpane',"block",null);
        }
        else 
        { 
            document.getElementById(d).style.display = "none"; 
            document.getElementById('imgpane').src='/images/pane-splitter-coll-v-e-new.png';
            createCookie('splitterpane','none',null);
        }
      
        }
        	
			function ConfirmDeletion() 
			{
				return confirm('Are you sure you wish to delete this record?');
			}
			
		function OpenWindow(sUrl,W,H)
		{
        var L = (screen.width) ? (screen.width-W)/2 : 0;
        var T = (screen.height) ? (screen.height-H)/2 : 0;
        var winComp = window.open(sUrl,'winComp','width='+W+',height='+H+',left='+L+',top='+T+',toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no');
        winComp.focus();
		}
		
function hourglass()
{
    document.body.style.cursor = "wait";
}
function CheckKeywordLength(txtboxname,iMinLength)
		{		
		
			var strTemp  = document.getElementById(txtboxname).value;
			if (strTemp.length < iMinLength)
			{
				alert('Keyword can not be less than ' + iMinLength + ' characters');
				return false;
			}
			return true;
	 }
