
	function jumpMenu(prv){
		if(prv){
			window.location = "/cgi-bin/asn/mreg.cgi?dealers=0=0=" + prv;
		}
	}
	
	function checkFavs(event){
		// get current favs
		curr = readFavs("ctFavs");
		
		if(curr){
			window.location = "/cgi-bin/asn/mreg.cgi?searchResults=ShortList=0=0=" + curr;
		} else {
			showTT("You do not have any saved Advertisements.<br><br>This feature requires cookies be enabled in your browser.", event, 1);
		}
	}
	
	function addtoFavs(vid, event){
		sel      = "";
		num      = 0;
		exists   = 0;
		ignored  = 0;
		xtraMess = "";
		
		// get current favs
		curr = readFavs("ctFavs");
		
		FAVS = new Array();
		if(curr){
			FAVS = curr.split(",");
		} else {
			curr = "";
		}
		
		exists = 0;
		for(b = 0; b < FAVS.length; b++){
			if(FAVS[b] == vid){
				exists++;
			}
		}
		if(exists){
			ignored++;
		} else {
			sel += vid + ",";
			num++;
		}
		
		// add selected favs
		curr += sel;
		
		if(ignored == 1){
			xtraMess = "<br><br>1 of the selected Advertisements is already in your Shortlist";
		} else if(ignored){
			xtraMess = "<br><br>" + ignored + " of the selected Advertisements are already in your Shortlist";
		}
		
		if(num == 1){
			text = "advertisement was";
		} else {
			text = "advertisements were";
		}
		
		document.cookie = "ctFavs=" + curr + "; expires=" + ged(num_days);
		
		showTT(num + " " + text + " added to your Shortlist." + xtraMess, event, 1);
	}
	
	function remfromFavs(vid, event){
		sel       = "";
		num       = 0;
		remaining = 0;
		
		// get current favs
		curr = readFavs("ctFavs");
		
		FAVS = new Array();
		FAVS = curr.split(",");
		
		// delete matching elements/ids
		for(b = 0; b < FAVS.length; b++){
			if(FAVS[b] == vid){
				FAVS[b] = "";
				num++;
			}
		}
		
		// recreate string
		for(b = 0; b < FAVS.length; b++){
			if(FAVS[b]){
				sel += FAVS[b] + ",";
				remaining++;
			}
		}
		
		if(num == 1){
			text1 = "advertisement was";
		} else {
			text1 = "advertisements were";
		}
		
		if(remaining == 1){
			text2 = "advertisement";
		} else {
			text2 = "advertisements";
		}
		
		document.cookie = "ctFavs=" + sel + "; expires=" + ged(num_days);
		
		showTT(num + " " + text1 + " removed from your Shortlist.<br><br>You currently have " + remaining + " " + text2 + " in your Shortlist.<br><br>Click the My Shortlist link to refresh the list.", event, 1);
	}
	
	function readFavs(w){
		cName = "";
		pCOOKIES = new Array();
		pCOOKIES = document.cookie.split('; ');
		for(bb = 0; bb < pCOOKIES.length; bb++){
			NmeVal  = new Array();
			NmeVal  = pCOOKIES[bb].split('=');
			if(NmeVal[0] == w){
				cName = NmeVal[1];
			}
		}
		return cName;
	}
	
	num_days = 365;
	function ged(noDays){
		var today = new Date();
		var expr = new Date(today.getTime() + noDays*24*60*60*1000);
		return  expr.toGMTString();
	}
	
	function checkContact(f){
		if(f.fname45.value.length < 1){
			alert("Please enter your First Name");
			f.fname45.style.background = "yellow";
			f.fname45.focus();
			return false;
		}
		if(!check(f.email45.value)){
			alert("Invalid email address detected");
			f.email45.style.background = "yellow";
			f.email45.focus();
			return false;
		}
		if(f.message45.value.length < 1){
			alert("Please enter a Message");
			f.message45.style.background = "yellow";
			f.message45.focus();
			return false;
		}
	}
	
	function checkRefer(f){
		if(f.fname.value.length < 1){
			alert("Please enter your First Name");
			f.fname.style.background = "yellow";
			f.fname.focus();
			return false;
		}
		if(!check(f.email.value)){
			alert("Invalid email address detected");
			f.email.style.background = "yellow";
			f.email.focus();
			return false;
		}
		if(f.fname1.value.length < 1){
			alert("Please enter your friend's First Name");
			f.fname1.style.background = "yellow";
			f.fname1.focus();
			return false;
		}
		if(!check(f.email1.value)){
			alert("Invalid email address detected");
			f.email1.style.background = "yellow";
			f.email1.focus();
			return false;
		}
		if(f.message.value.length < 1){
			alert("Please enter a Message");
			f.message.style.background = "yellow";
			f.message.focus();
			return false;
		}
	}