function submitRequest()
{
	if(document.form.NAME.value.trim().length==0 || 
	   document.form.EMAIL.value.trim().length==0)
	{
		alert("Name and Email are required!");
		document.form.EMAIL.focus();
		return false;
	}
	else
	{
		alert("Thank you! You will be contacted soon!");
		document.form.action = "scripts/request.php";
		return true;
	}
}

function displayKISSU(path) 
{
	window.open(path+'KISS-U.html', '', 'status=no,height=550,width=600,scrollbars=yes,menubar=0,toolbar=0,top=0,left=0,resizable=1,location=0');
}

function getEmblem(cgiPath)
{
	if (document.referrer.length > 0 && document.referrer.search("ardanet") == -1)
	{
		document.write("<img src=\""+cgiPath+"fhw1.exe?referrer=");
		document.write(document.referrer);
		document.write("\" width=\"100\" height=\"3\"><br>");
	}
	document.write("<img src=\""+cgiPath+"fhw1.exe?page=");
	document.write(escape(document.URL));
	document.write("\" width=\"100\" height=\"3\">");
}

function setCookie( name, value, expires, path, domain, secure ) 
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
		if the expires variable is set, make the correct 
		expires time, the current script below will set 
		it for x number of days, to make it for hours, 
		delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}

	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function getCookieField(name) 
{
	var search = name + "=";
	
	if (document.cookie.length > 0) 
	{ // if there are any cookies
      	offset = document.cookie.indexOf(search);
      	
		if (offset != -1) 
		{// if cookie field exists 
         		offset += search.length;
         		end = document.cookie.indexOf(";", offset);
         		if (end == -1)
            		end = document.cookie.length;
         			
			return unescape(document.cookie.substring(offset, end));
      	} 
   	}
   	return null;
}



var qsParm = new Array();
function qs() 
{
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) 
	{
		var pos = parms[i].indexOf('=');
		if (pos > 0) 
		{
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			qsParm[key] = val;
		}
	}
}
qs();


function strltrim() {
	return this.replace(/^\s+/,'');
}

function strrtrim() {
	return this.replace(/\s+$/,'');
}

function strtrim() {
	return this.replace(/^\s+/,'').replace(/\s+$/,'');
}

String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim = strtrim;
