 function clearCheckField(objId,newText) {
   with (document){ if (getElementById){
     var obj = getElementById(objId);}

         if (obj.value == newText){
			obj.value = '';
			var already = '1';
		}
         if (obj.value == '' && !already){
			obj.value = newText;
		}
   }
 }
 
 function getcount(t, c) {
  var el = document.getElementById(t);
  var count = el.value.length;
  var max = el.getAttribute("maxlength") * 1;
  if(count > max) {
    el.value = el.value.substring(0, max);
    } else {
    document.getElementById(c).innerHTML = (max - count);
    }
  }


function set_cookie( name, value, path, exp_y, exp_m, exp_d, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
		var myDate = "; expires=" + expires.toGMTString();
    cookie_string += myDate;
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}


function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}
