
	
	function uniPop(href,winname,width,height,x,y,toolbar,scrollbars,resizable,status)  {
		if (href == "") href = '/support';
		if (winname == 'spellChecker') href+=escape(document.eventForm.notes.value);
		if ((width < 100) || (width == null)) var width = '515';
		if ((height < 100) || (height == null)) var height = '475';
		if (toolbar == null) var toolbar = 'yes';
		if (scrollbars == null) var scrollbars = 'yes';
		if (resizable == null) var resizable = 'yes';
		if (status == null) var status = 'yes';
		var theParam = "width=" +width+ 
						",height=" +height+  
						",toolbar=" +toolbar+ 
						",scrollbars=" +scrollbars+ 
						",resizable=" +resizable+ 
						",status=" +status+
						",screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x;
		var thePopup = window.open(href,winname,theParam);
	}


		
	function confirmURL(text, url) {
		if(confirm(text)) {
			location.href=(url);
		}
	}


	function textareaLimit(field, maxlimit) {

		if (field.value.length > maxlimit)  {// if too long...trim it!
			
			field.value = field.value.substring(0, maxlimit);
			
			alert("Sorry, this field is limited to " + maxlimit + " characters");
		}
	}


	function trim(str)
	{
	   return str.replace(/^\s*|\s*$/g,"");
	}

	function isdefined( variable)
	{
	    return (typeof(window[variable]) == "undefined")?  false: true;
	}
	
	
	
	function replace(s, t, u) {
  /*
  **  Replace a token in a string
  **    s  string to be processed
  **    t  token to be found and removed
  **    u  token to be inserted
  **  returns new String
  */
  i = s.indexOf(t);
  r = "";
  if (i == -1) return s;
  r += s.substring(0,i) + u;
  if ( i + t.length < s.length)
    r += replace(s.substring(i + t.length, s.length), t, u);
  return r;
  }




	function checkAll(field)
	{
	for (i = 0; i < field.length; i++)
		field[i].checked = true ;
	}
	
	
	
	function uncheckAll(field)
	{
	for (i = 0; i < field.length; i++)
		field[i].checked = false ;
	}
	

	function findObj(n, d) {
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.ls&&i<d.ls.length;i++) x=findObj(n,d.ls[i].document);
	  if(!x && document.getElementById) x=document.getElementById(n); return x;
	}
	
	

	function preloadimages(preloads) {
	
		for (i=0;i<preloads.length;i++){
			new Image().src=preloads[i];
		}
	}


	function mouseOver(image)	{
				
		var src = image.src;
		
		if(src.indexOf("_sel")!=-1)	return;
		
		src = replace(src, ".gif", "_over.gif");
		image.src = src;
	}
	
	function mouseOut(image)	{

		var src = image.src;
		src = replace(src, "_over.gif", ".gif");
		image.src = src;
	}



