function loadURL(){
		var url = document.forms[0].quicklinks.options[document.forms[0].quicklinks.selectedIndex].value
		//confirm(location.pathname)
		var temploc = location.pathname
		var loc = temploc.indexOf("iw-mount")
		var loc2 = url.indexOf("http://")
		if ((loc == -1) || (loc2 != -1)){ // production
			location = url
		}else{ // teamsite
			location = "/iw-mount/default/main/FirstAm/WORKAREA/Corporate" + url
		}
	}
	
	function addLink(){
		location = location.pathname + "?add=" + location.pathname
	}
	
	function signUp(i){
	if(i == "signup"){
		var produrlstr = "/faf/myfaf/signup.cfm?signup=yes" 
	}else if(i == "login"){
		var produrlstr = "/faf/myfaf/login.cfm?login=yes"
	}else{
		var produrlstr = "/faf/myfaf/edit.cfm?edit=yes"
	}
	if(cookieChk()){
		var temploc = location.pathname
		//document.cookie="returnURL=yes"
		
		loc = temploc.indexOf("iw-mount")
		if (loc == -1){  // production
			location.href=produrlstr + "&returnURL=" + temploc
		}else{ // teamsite
			//since we don't know what workarea we are in, we have to extract it from the incoming URL
			offtest = temploc.substring(40,temploc.length)
			teamarea = offtest.substring(0,offtest.indexOf("/"))
			location.href="/iw-mount/default/main/FirstAm/WORKAREA/" + teamarea + produrlstr + "&returnURL=" + temploc
		}
	}		
}

function loginChk(logform){
	if(isBlank(logform.username.value)){
		alert("Please enter a username.")
		logform.username.focus()
		return false;
	}
	if(isBlank(logform.password.value)){
		alert("Please enter a password.")
		logform.password.focus()
		return false;
		
	}
	if(!cookieChk())
		return false;
	
	logform.submit()
	return true;	
}
			
function isBlank(testStr){
		if (testStr.length==0)  // nothing entered
			return true
		for (var i = 0; i <= testStr.length-1; i++)  // all spaces?
			if (testStr.charAt(i) != " ")
				return false
		return true
	}

function cookieChk(){
	document.cookie = "cookieChk=yes"
	offset = document.cookie.indexOf("cookieChk")
	if (offset == -1) { // if cookie does not exist
		alert("In order to utilize 'My FirstAm.com', your browser must be able to accept cookies!\nTo fix this, change your browser settings to accept cookies and try again.")					
		return false;
	}
	return true
}
