
	function browserIE(){  
		return (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent));
		
	}

	function presetSelect(select, value)	{
	
		for(var i=0; i<select.options.length; i++)	{
		
			if(select.options[i].value==value)	{
			
				select.selectedIndex = i; 
				return;
			}
		}
	}
	
	
	function addCurves(radius,class_name)	{
	
		if(navigator.userAgent.indexOf("MSIE 6")!=-1)	return;
  
	
		  var btn_settings = {
	          tl: { radius: radius },
	          tr: { radius: radius },
	          bl: { radius: radius },
	          br: { radius: radius },
	          antiAlias: true,
	          autoPad: true,
	          validTags: ["div"]
	      }
	
	      var curvey = new curvyCorners(btn_settings, class_name);
	      curvey.applyCornersToAll();
	}



	
	
	
	function rollIn(img)	{
	
		if(img.src.indexOf("_roll")!=-1)	return;
	
		img.src = replace(img.src, ".gif", "_roll.gif");
	}


	function rollOut(img)	{

		if(img.src.indexOf("_roll")==-1)	return;
	
		img.src = replace(img.src, "_roll.gif", ".gif");
	}
	
					
	function ignoreReturn(field, event) {
	
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) { return false; } 
	}


	function findPos(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
	}
	

			
	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 + '.' + cents);
	}

		
	
	var fade_timeout = 0;

	function startFade(divID)	{
	
		blue = 0;
	
		if(fade_timeout!=0)	clearTimeout(fade_timeout);
	
		fadeHighlight(divID, 100);
	}
	
	function fadeHighlight(divID, blue)	{
	
		fade_timeout = 0;
	
		var color = "#FFFF" + intToHex(Math.round(blue/16)) + intToHex(blue%16);
	
		findObj(divID).style.backgroundColor = color;
	
		if(blue<255)	{
		
			blue+= blue>180?2:5;
	
			if(blue>255)	blue = 255;
	
			fade_timeout = setTimeout("fadeHighlight('" + divID + "', " + blue + ");", 30);
		
		} else	{
		
			findObj(divID).style.backgroundColor = "";
		}
	}

	function intToHex(c){
	
		if(c < 10) 	return(c);
		
		if(c==10)	return('A');
		if(c==11)	return('B');
		if(c==12)	return('C');
		if(c==13)	return('D');
		if(c==14)	return('E');
					return('F');
	}
	
	

	var bgcolor = "FFFFFF"
	
	function setOpacity(obj, opacity) {
	
	  opacity = (opacity == 100)?99.999:opacity;
	
	  // IE/Win
	  obj.style.filter = "alpha(opacity:"+opacity+")";
	  obj.style.background = bgcolor; 
	
	  // Safari<1.2, Konqueror
	  obj.style.KHTMLOpacity = opacity/100;
	  
	  // Older Mozilla and Firefox
	  obj.style.MozOpacity = opacity/100;
	  
	  // Safari 1.2, newer Firefox and Mozilla, CSS3
	  obj.style.opacity = opacity/100;
	}
	
	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 trim(str)
	{
	   return str.replace(/^\s*|\s*$/g,"");
	}

	function isdefined( variable)
	{
	    return (typeof(variable) == "undefined")?  false: true;
	}

   function isInteger (s)
   {
      var i;

      if (isEmpty(s)) return(false)

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return false;
      }

      return true;
   }

   function isFloat (s)
   {
      var i;

      if (isEmpty(s)) return(false)

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c) && c!='.'  && c!=',' && c!='-') return false;
      }

      return true;
   }
   
   function isEmpty(s)
   {
      return ((s == null) || (s.length == 0))
   }

   function isDigit (c)
   {
      return ((c >= "0") && (c <= "9"))
   }




	function formatCurrency(strValue)
	{
		strValue = strValue.toString().replace(/\$|\,/g,'');
		dblValue = parseFloat(strValue);
	
		blnSign = (dblValue == (dblValue = Math.abs(dblValue)));
		dblValue = Math.floor(dblValue*100+0.50000000001);
		intCents = dblValue%100;
		strCents = intCents.toString();
		dblValue = Math.floor(dblValue/100).toString();
		if(intCents<10)
			strCents = "0" + strCents;
		for (var i = 0; i < Math.floor((dblValue.length-(1+i))/3); i++)
			dblValue = dblValue.substring(0,dblValue.length-(4*i+3))+','+
			dblValue.substring(dblValue.length-(4*i+3));
		return (((blnSign)?'':'-') + '$' + dblValue + '.' + strCents);
	}
	
	
	
	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 displayTBody(srcElement,display)	{
	
		if(srcElement==null)	return;

		if (navigator.appName.indexOf("Microsoft") > -1) {
			if(!display) {
			   srcElement.style.display= 'none';
			} else {
			   srcElement.style.display='block';
			}
		
		} else {
			if(!display) {
			   srcElement.style.display= 'none';
			} else {
			   srcElement.style.display='table-row-group';
			}
		}
	}
	
			
			
			
			
	function uncheckAll(params)
	{
		
		if(!isArray(params))	{
		
			params.checked = false;
			return;
		}
		
		
		for (i = 0; i < params.length; i++)	{
		
			var param = params[i];
			
			param.checked = false;
		}
		
	}
	
	
	
	function checkOther(select, textID)	{
	
		var value = select.options[select.selectedIndex].value;

		var div = findObj(textID + "_otherdiv");

		div.style.display = (value=='Other')?"block":"none";		
	}

	
	
function isArray(obj){return(typeof(obj.length)=="undefined")?false:true;}


 
 
