
	
	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);
		}
	}

	function trim(str)
	{
	   return str.replace(/^\s*|\s*$/g,"");
	}

	function isdefined( variable)
	{
	    return (typeof(variable) == "undefined")?  false: true;
	}


	function checkPostFields(form, check_title)	{

		if(check_title)	{
	
			if(trim(form.title.value)=='')	{
			
				alert("Please enter a title...");
				return(false);
			}
		}

	
		if(trim(form.message.value)=='')	{
		
			alert("Please enter some comments...");
			return(false);
		}
	
		return(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;
	}
	
	
	
		
	/**
	 * Sets a Cookie with the given name and value.
	 *
	 * name       Name of the cookie
	 * value      Value of the cookie
	 * [expires]  Expiration date of the cookie (default: end of current session)
	 * [path]     Path where the cookie is valid (default: path of calling document)
	 * [domain]   Domain where the cookie is valid
	 *              (default: domain of calling document)
	 * [secure]   Boolean value indicating if the cookie transmission requires a
	 *              secure transmission
	 */
	function setCookie(name, value, expires, path, domain, secure)
	{
	    document.cookie= name + "=" + escape(value) +
	        ((expires) ? "; expires=" + expires.toGMTString() : "") +
	        ((path) ? "; path=" + path : "") +
	        ((domain) ? "; domain=" + domain : "") +
	        ((secure) ? "; secure" : "");
	}
	
	/**
	 * Gets the value of the specified cookie.
	 *
	 * name  Name of the desired cookie.
	 *
	 * Returns a string containing value of specified cookie,
	 *   or null if cookie does not exist.
	 */
	function getCookie(name)
	{
	    var dc = document.cookie;
	    var prefix = name + "=";
	    var begin = dc.indexOf("; " + prefix);
	    if (begin == -1)
	    {
	        begin = dc.indexOf(prefix);
	        if (begin != 0) return null;
	    }
	    else
	    {
	        begin += 2;
	    }
	    var end = document.cookie.indexOf(";", begin);
	    if (end == -1)
	    {
	        end = dc.length;
	    }
	    return unescape(dc.substring(begin + prefix.length, end));
	}
	
	/**
	 * Deletes the specified cookie.
	 *
	 * name      name of the cookie
	 * [path]    path of the cookie (must be same as path used to create cookie)
	 * [domain]  domain of the cookie (must be same as domain used to create cookie)
	 */
	function deleteCookie(name, path, domain)
	{
	    if (getCookie(name))
	    {
	        document.cookie = name + "=" + 
	            ((path) ? "; path=" + path : "") +
	            ((domain) ? "; domain=" + domain : "") +
	            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	    }
	}


