function start() {
		var response = param('loc');

		if (response != "") {
			$("#message").show();
			$("#message").html("<p>The Location ID you submitted is not valid.  Please try again or <a href = '../contact.html'>contact us</a> if you need more help.</p>");
		}
	}
	
	function getImage() {
		url = "/widgets/v2/image.html?dir=" + dir
		window.open(url,"image","width=300,height=200")	
	}
	
	function reader() {
		
		loc = document.form_val.locid.value;

		//CHECK FOR LOCATION ID
		$.get("/cgi-bin/widgets/v2/api/loc.pl?locid=" + loc,
		  function(data){
			if (data == 0) {
				message = "<p>The location id of <b>" + loc + "</b> does not exist.  <a class = \"cursor\" onClick = \"loc_help()\">Click Here</a> for help.</p>";
				$("#message").show();
				$("#message").html(message);		
			}
			else {
				$("#message").hide();
			}
		  });

			
		//THIS INITIATED THE READER
		$("#customize").fadeIn("slow");
		$("#selection").fadeIn("slow");
		$("#example").fadeIn("slow");
		if (document.getElementById(ency)) {
			$("#ency").fadeIn("slow");
		}
		$("#complete").fadeIn("slow");
		
		//GET ID
		var id = "1" + "__" + document.form_val.locid.value;
		
		//GET IMAGE
		var image = document.form_val.image.value;
		
		//GET WIDGET
		var w = document.form_val.w.value;
		var h = document.form_val.h.value;
		
		//TITLE FONTS
		var t = document.form_val.t.value;
		var ts = document.form_val.ts.value;
		var tf = document.getElementById('tf').value;
		var tc = document.form_val.tc.value;
		
		var bc = document.form_val.bc.value;
		
		//SPECIAL - FOR CLICKS
		if (document.form_val.click) {
			var cl = document.form_val.click.value;
		}
		//NEW VERSIONS
		if (document.form_val.v) {
			var v = document.form_val.v.value;
		}
		
		//ENCYCLOPEDIA.COM
		if (document.getElementById(ency)) {
			if (document.form_val.ency.checked) {
				var ency = document.form_val.ency.value;
			}
		}
		
		// FOR THE WHAT DO YOU WANT.. WIDGET
		
		var name_1 = "";
		var name_2 = "";
		var name_3 = "";
		var name_4 = "";
		var name_5 = "";
		var name_6 = "";
		var name_7 = "";
		var name_8 = "";
		var name_9 = "";
		var name_10 = "";
		
		var link_1 = "";
		var link_2 = "";
		var link_3 = "";
		var link_4 = "";
		var link_5 = "";
		var link_6 = "";
		var link_7 = "";
		var link_8 = "";
		var link_9 = "";
		var link_10 = "";
		
		if (document.form_val.name_1) {
			name_1 = document.form_val.name_1.value;
			name_1 = name_1.replace(/ /g, "_");
		}
		if (document.form_val.name_2) {
			name_2 = document.form_val.name_2.value;
			name_2 = name_2.replace(/ /g, "_");
		}
		if (document.form_val.name_3) {
			name_3 = document.form_val.name_3.value;
			name_3 = name_3.replace(/ /g, "_");
		}
		if (document.form_val.name_4) {
			name_4 = document.form_val.name_4.value;
			name_4 = name_4.replace(/ /g, "_");
		}
		if (document.form_val.name_5) {
			name_5 = document.form_val.name_5.value;
			name_5 = name_5.replace(/ /g, "_");
		}
		if (document.form_val.name_6) {
			name_6 = document.form_val.name_6.value;
			name_6 = name_6.replace(/ /g, "_");
		}
		if (document.form_val.name_7) {
			name_7 = document.form_val.name_7.value;
			name_7 = name_7.replace(/ /g, "_");
		}
		if (document.form_val.name_8) {
			name_8 = document.form_val.name_8.value;
			name_8 = name_8.replace(/ /g, "_");
		}
		if (document.form_val.name_9) {
			name_9 = document.form_val.name_9.value;
			name_9 = name_9.replace(/ /g, "_");
		}
		if (document.form_val.name_10) {
			name_10 = document.form_val.name_10.value;
			name_10 = name_10.replace(/ /g, "_");
		}
		
		if (document.form_val.link_1) {
			link_1 = document.form_val.link_1.value;
			link_1 = link_1.replace(/ /g, "_");
		}
		if (document.form_val.link_2) {
			link_2 = document.form_val.link_2.value;
			link_2 = link_2.replace(/ /g, "_");
		}
		if (document.form_val.link_3) {
			link_3 = document.form_val.link_3.value;
			link_3 = link_3.replace(/ /g, "_");
		}
		if (document.form_val.link_4) {
			link_4 = document.form_val.link_4.value;
			link_4 = link_4.replace(/ /g, "_");
		}
		if (document.form_val.link_5) {
			link_5 = document.form_val.link_5.value;
			link_5 = link_5.replace(/ /g, "_");
		}
		if (document.form_val.link_6) {
			link_6 = document.form_val.link_6.value;
			link_6 = link_6.replace(/ /g, "_");
		}
		if (document.form_val.link_7) {
			link_7 = document.form_val.link_7.value;
			link_7 = link_7.replace(/ /g, "_");
		}
		if (document.form_val.link_8) {
			link_8 = document.form_val.link_8.value;
			link_8 = link_8.replace(/ /g, "_");
		}
		if (document.form_val.link_9) {
			link_9 = document.form_val.link_9.value;
			link_9 = link_9.replace(/ /g, "_");
		}
		if (document.form_val.name_10) {
			link_10 = document.form_val.link_10.value;	
			link_10 = link_10.replace(/ /g, "_");
		}
		
		
		
		//parse # ON COLOR
		bc = bc.replace(/#/, "");
		tc = tc.replace(/#/, "");
		//parse spaces ON COLOR
		t = t.replace(/ /g, "_");
		tf = tf.replace(/ /g, "_");

		var url = "/cgi-bin/widgets/v2/reader.pl?id=" + id + "&dir=" + dir + "&prod=" + prod + "&image=" + image + "&w=" + w + "&h=" + h + "&t=" + t + "&ts=" + ts + "&tf=" + tf + "&tc=" + tc + "&bc=" + bc + "&click=" + cl + "&v=" + v;
		
		// WDYW WIDGET
		
		url+= "&preview=1";
		
		if (name_1 != "" && link_1 != "") {
			url+= "&name_1=" + name_1 + "&link_1=" + link_1;
		} 
		if (name_2 != "" && link_2 != "") {
			url+= "&name_2=" + name_2 + "&link_2=" + link_2;
		} 
		if (name_3 != "" && link_3 != "") {
			url+= "&name_3=" + name_3 + "&link_3=" + link_3;
		} 
		if (name_4 != "" && link_4 != "") {
			url+= "&name_4=" + name_4 + "&link_4=" + link_4;
		} 
		if (name_5 != "" && link_5 != "") {
			url+= "&name_5=" + name_5 + "&link_5=" + link_5;
		} 
		if (name_6 != "" && link_6 != "") {
			url+= "&name_6=" + name_6 + "&link_6=" + link_6;
		} 
		if (name_7 != "" && link_7 != "") {
			url+= "&name_7=" + name_7 + "&link_7=" + link_7;
		} 
		if (name_8 != "" && link_8 != "") {
			url+= "&name_8=" + name_8 + "&link_8=" + link_8;
		} 
		if (name_9 != "" && link_9 != "") {
			url+= "&name_9=" + name_9 + "&link_9=" + link_9;
		} 
		if (name_10 != "" && link_10 != "") {
			url+= "&name_10=" + name_10 + "&link_10=" + link_10;
		} 
		
		$("#reader").empty().html('<img align = "center" src="http://galesupport.com/picts/loading.gif" />');
		$("#reader").load(url);	

	}
	

	function reset_widget() {
		document.form_val.image.value = "";
		if (v == 3) {
			document.form_val.h.value = "110"
			document.form_val.w.value = "180"
		}
		else {
			document.form_val.h.value = "85"
			document.form_val.w.value = "180"
		}
		document.form_val.t.value = "";
		document.form_val.ts.value = "";
		document.form_val.tc.value = "";
		
		reader();
	}	
	
	function custom_change(x) {
		$("#custom_size").hide();
		$("#custom_image").hide();
		$("#custom_text").hide();
		
		$(x).fadeIn("slow");
	}
	
	function loc_help() {
		$("#loc_help").toggle("slow");
	}
	
	function allow() {
		alert("hello");
		//THIS IS HERE TO MAKE SURE THEY DON'T HIT THE ENTER BUTTON AFTER ENTERING A LOCATION ID
	

	}	
