	
	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 isInteger(s)
	{   var i;
	
		if(s.length==0)	return(false);
	
	    for (i = 0; i < s.length; i++)
	    {   
	        // Check that current character is number.
	        var c = s.charAt(i);
	        if (((c < "0") || (c > "9"))) return false;
	    }
	    // All characters are numbers.
	    return true;
	}




	function textareaLimit(field, maxlimit) {

		if (field.value.length > maxlimit)  {// if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
		}
	}

	function trim(str)
	{
	   return str.replace(/^\s*|\s*$/g,"");
	}

	function isdefined( variable)
	{
	    return (typeof(variable) == "undefined")?  false: true;
	}


	
	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 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 preloadimages(preloads) {
	
		for (i=0;i<preloads.length;i++){
			new Image().src=preloads[i];
		}
	}


	function mouseOver(image)	{
				
		var src = image.src;
		
		src = replace(src, "_off", "_on");

		image.src = src;
	}
	
	function mouseOut(image)	{

		var src = image.src;

		src = replace(src, "_on", "_off");

		image.src = src;
	}


	function formatCurrency(num) {
	
		num = num.toString().replace(/\$|\,/g,'');
	
		if(isNaN(num))	num = "0";
		
		sign = (num == (num = Math.abs(num)));
		
		num = Math.floor(num*100+0.50000000001);
		
		cents = num%100;
		
		num = Math.floor(num/100).toString();
	
		if(cents<10) cents = "0" + cents;
		
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			num = num.substring(0,num.length-(4*i+3))+','+
		
		num.substring(num.length-(4*i+3));
		
		return (((sign)?'':'-') + '$' + num);
	}
