function jumpMax(from, max, to) {
  if ( (from.value.length == max) && (to != '') ) {
    document.getElementById(to).select();
    document.getElementById(to).focus();
  }
}

function set_page(page) {

document.getElementById('page').value = page;

document.forms['pager'].submit();
}
function textRemaining(charc,form,name){
	if ( charc - document.forms[form].elements[name].value.length < 0 ) {
		document.forms[form].elements[name].value = document.forms[form].elements[name].value.substr(0,charc);
		document.forms[form].elements['counter'].value = 0;

	} else {
		document.forms[form].elements['counter'].value = charc - document.forms[form].elements[name].value.length;
	}
}

function ConfirmQuestion(form,text) {
	if (confirm(text)) {
		return true;
	} else {
		return false;
	}
}
function SetCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
		 expire.setTime(today.getTime() + 3600000*24*nDays);
		 document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
}

function getCookieVal(offset) {
	   var endstr = document.cookie.indexOf (";", offset);
	   if (endstr == -1) endstr = document.cookie.length;
		  return unescape (document.cookie.substring(offset, endstr));
}
function GetCookie(name) {
	   var arg = name+"=";
	   var alen = arg.length;
	   var clen = document.cookie.length;
	   var i = 0;
	   while (i < clen) {
		  var j = i + alen;
		  if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
		  i = document.cookie.indexOf(" ", i) + 1;
		  if (i == 0) break;
	   }
	   return null;
}

function flashControl(SRC,WIDTH,HEIGHT,FLASHVARS,WMODE,BGCOLOR,ALIGN,STYLE,CLASS,SPACE) {

	while ( FLASHVARS.search(' ') != -1 ) {
		FLASHVARS = FLASHVARS.replace(' ', '%20');
	}
	if ( ALIGN ) {
	    var algn = 'align="' + ALIGN + '"';
	}
	if ( STYLE ) {
	    var styl = 'style="' + STYLE + '"';
	}
	if ( CLASS ) {
	    var clss = 'class="' + CLASS + '"';
	}

	document.write('<object type="application/x-shockwave-flash" data=' + SRC + ' width=' + WIDTH + ' height=' + HEIGHT + ' ' + algn + ' ' + styl + ' ' + clss + '' + SPACE + '>');
	document.write('<!--[if IE]><param name="movie" value=' + SRC + '>< ![endif]-->');

	if ( FLASHVARS ) { document.write('<param name="flashvars" value=' + FLASHVARS + '>'); }
	if ( WMODE ) { document.write('<param name="wmode" value=' + WMODE + '>'); }
	if ( BGCOLOR ) { document.write('<param name="bgcolor" value=' + BGCOLOR + '>'); }

	document.write('<\/object>');
}

