	
	learnmore = new Image;
	learnmoreover = new Image;
	
	learnmore.src = "images/learnmore.gif";
	learnmoreover.src = "images/learnmoreover.gif";
	
	function loadflash (){
		var settings = "top=0, left=0, toolbar=no, width=700, height=430, scrollbars=no";
		var theurl = "flash/GUI.html";
		window.open (theurl,'flashwin',settings);
	}
	
	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	@end @*/

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}

	function getmyhtml(serverPage, objID) {
		var obj = document.getElementById(objID);
		xmlhttp.open("GET", serverPage);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
				obj.innerHTML = xmlhttp.responseText;
			}
		}
		xmlhttp.send(null);
	}
	
	var resetxmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		resetxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			resetxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			resetxmlhttp = false;
		}
	}
	@end @*/

	if (!resetxmlhttp && typeof XMLHttpRequest != 'undefined') {
		resetxmlhttp = new XMLHttpRequest();
	}
	
	function resethtml (serverPage, objID){
		var obj = document.getElementById(objID);
		resetxmlhttp.open("GET", serverPage);
		resetxmlhttp.onreadystatechange = function() {
			if (resetxmlhttp.readyState == 4 && resetxmlhttp.status == 200) {
				obj.innerHTML = resetxmlhttp.responseText;
			}
		}
		resetxmlhttp.send(null);
	}
	
	var checkxmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		checkxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			checkxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			checkxmlhttp = false;
		}
	}
	@end @*/

	if (!checkxmlhttp && typeof XMLHttpRequest != 'undefined') {
		checkxmlhttp = new XMLHttpRequest();
	}
	
	function checkmyhtml (serverPage, objID, thefield){
		
		//Ensure a valid selection.
		if (thefield.value == ""){
			alert ("You must make a selection.");
			thefield.focus();
		} else {
			
			var obj = document.getElementById(objID);
			checkxmlhttp.open("GET", serverPage + "&thecond=" + thefield.value);
			checkxmlhttp.onreadystatechange = function() {
				if (checkxmlhttp.readyState == 4 && checkxmlhttp.status == 200) {
					obj.innerHTML = checkxmlhttp.responseText;
				}
			}
			checkxmlhttp.send(null);
		}
	}
	
	var savexmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		savexmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			savexmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			savexmlhttp = false;
		}
	}
	@end @*/

	if (!savexmlhttp && typeof XMLHttpRequest != 'undefined') {
		savexmlhttp = new XMLHttpRequest();
	}
	
	function savemyhtml (serverPage, objID, thefield){
		
		//Ensure a valid selection.
		if (thefield.value == ""){
			alert ("You must make a selection.");
			thefield.focus();
		} else {
			
			var obj = document.getElementById(objID);
			savexmlhttp.open("GET", serverPage + "&thecond=" + thefield.value);
			savexmlhttp.onreadystatechange = function() {
				if (savexmlhttp.readyState == 4 && savexmlhttp.status == 200) {
					obj.innerHTML = savexmlhttp.responseText;
				}
			}
			savexmlhttp.send(null);
		}
	}
	
	function confirmdelete (theid){
		var retval = confirm ("Is it ok to delete this record?");
		if (retval){
			var togo = "remove_from_collection.php?indid=" + theid;
			getmyhtml (togo,'gamecol');
		}
	}
	
	function confirmfdelete (theid){
		var retval = confirm ("Is it ok to remove this friend?");
		if (retval){
			var togo = "clients/remove_friend.php?indid=" + theid;
			getmyhtml (togo,'friendcol');
		}
	}
	
	function confirmreqdelete (theid){
		var retval = confirm ("Is it ok to delete this record?");
		if (retval){
			var togo = "remove_from_request.php?indid=" + theid;
			getmyhtml (togo,'reqcol');
		}
	}
	
	function confirmdeletemessage (theid){
		var retval = confirm ("Is it ok to delete this message?");
		if (retval){
			var togo = "clients/delete_message.php?indid=" + theid;
			getmyhtml (togo,'message');
		}
	}
	
	//Function to cancel a trade request.
	function cancelrequest (theid){
		var retval = confirm ("Are you sure you want to cancel this request?");
		if (retval){
			var togo = "clients/remove_request.php?indid=" + theid;
			getmyhtml (togo,'pend');
		}
	}
	
	function openmessagewin (theid){
		settings = "toolbar=no, "  + "location=no, " + "scrollbars=yes, width=310, height=150, top=0, left=0";
		thepage = "games/indmessage.php?indid=" + theid;
		newWindow = window.open(thepage, "newWin3", settings);
	}
	
	function openibuckswin (){
		settings = "toolbar=no, "  + "location=no, " + "scrollbars=yes, width=410, height=150, top=0, left=0";
		thepage = "clients/getibucks.php";
		newWindow = window.open(thepage, "ibuckswin", settings);
	}
	
	function openitradeswin (){
		settings = "toolbar=no, "  + "location=no, " + "scrollbars=yes, width=410, height=150, top=0, left=0";
		thepage = "clients/getitrades.php";
		newWindow = window.open(thepage, "ibuckswin", settings);
	}
	
	var profarr = new Array ();
	var messagearr = new Array ();
	var tradearr = new Array ();
	var pendarr = new Array ();
	
	function dropprof (){
		if (profarr[0] == 1){
			profarr[0] = 0;
			document.getElementById('profimg').src = 'images/plus.gif';
			document.getElementById("profile").innerHTML = "";
		} else {
			profarr[0] = 1;
			document.getElementById('profimg').src = 'images/mins.gif';
			getmyhtml ('clients/editprof.php','profile');
			//If the message window is open, close it.
			if (messagearr[0] == 1){
				document.getElementById('messageimg').src = 'images/plus.gif';
				messagearr[0] = 0;
				document.getElementById("message").innerHTML = "";
			}
			//If the trades window is open, close it.
			if (tradearr[0] == 1){
				document.getElementById('tradeimg').src = 'images/plus.gif';
				tradearr[0] = 0;
				document.getElementById("trades").innerHTML = "";
			}
			//If the pending window is open, close it.
			if (pendarr[0] == 1){
				document.getElementById('pendimg').src = 'images/plus.gif';
				pendarr[0] = 0;
				document.getElementById("pend").innerHTML = "";
			}
		}
	}
	function dropmessage (){
		if (messagearr[0] == 1){
			messagearr[0] = 0;
			document.getElementById('messageimg').src = 'images/plus.gif';
			document.getElementById("message").innerHTML = "";
		} else {
			messagearr[0] = 1;
			document.getElementById('messageimg').src = 'images/mins.gif';
			getmyhtml ('clients/messages.php','message');
			//If the profile window is open, close it.
			if (profarr[0] == 1){
				document.getElementById('profimg').src = 'images/plus.gif';
				profarr[0] = 0;
				document.getElementById("profile").innerHTML = "";
			}
			//If the trades window is open, close it.
			if (tradearr[0] == 1){
				document.getElementById('tradeimg').src = 'images/plus.gif';
				tradearr[0] = 0;
				document.getElementById("trades").innerHTML = "";
			}
			//If the pending window is open, close it.
			if (pendarr[0] == 1){
				document.getElementById('pendimg').src = 'images/plus.gif';
				pendarr[0] = 0;
				document.getElementById("pend").innerHTML = "";
			}
		}
	}
	function droptrade (){
		if (tradearr[0] == 1){
			tradearr[0] = 0;
			document.getElementById('tradeimg').src = 'images/plus.gif';
			document.getElementById("trades").innerHTML = "";
		} else {
			tradearr[0] = 1;
			document.getElementById('tradeimg').src = 'images/mins.gif';
			getmyhtml ('clients/trades.php','trades');
			//If the profile window is open, close it.
			if (profarr[0] == 1){
				document.getElementById('profimg').src = 'images/plus.gif';
				profarr[0] = 0;
				document.getElementById("profile").innerHTML = "";
			}
			//If the messages window is open, close it.
			if (messagearr[0] == 1){
				document.getElementById('messageimg').src = 'images/plus.gif';
				messagearr[0] = 0;
				document.getElementById("message").innerHTML = "";
			}
			//If the pending window is open, close it.
			if (pendarr[0] == 1){
				document.getElementById('pendimg').src = 'images/plus.gif';
				pendarr[0] = 0;
				document.getElementById("pend").innerHTML = "";
			}
		}
	}
	function droppend (){
		if (pendarr[0] == 1){
			pendarr[0] = 0;
			document.getElementById('pendimg').src = 'images/plus.gif';
			document.getElementById("pend").innerHTML = "";
		} else {
			pendarr[0] = 1;
			document.getElementById('pendimg').src = 'images/mins.gif';
			getmyhtml ('clients/pending.php','pend');
			//If the profile window is open, close it.
			if (profarr[0] == 1){
				document.getElementById('profimg').src = 'images/plus.gif';
				profarr[0] = 0;
				document.getElementById("profile").innerHTML = "";
			}
			//If the messages window is open, close it.
			if (messagearr[0] == 1){
				document.getElementById('messageimg').src = 'images/plus.gif';
				messagearr[0] = 0;
				document.getElementById("message").innerHTML = "";
			}
			//If the trades window is open, close it.
			if (tradearr[0] == 1){
				document.getElementById('tradeimg').src = 'images/plus.gif';
				tradearr[0] = 0;
				document.getElementById("trades").innerHTML = "";
			}
		}
	}
	
	function validatemessage (theform){
		if (trim (theform.subject.value) == ""){
			alert ("Please enter a subject.");
			theform.subject.focus();
			return false;
		}
		if (trim (theform.message.value) == ""){
			alert ("Please enter your message.");
			theform.message.focus();
			return false;
		}
		return true;
	}
	
	function validateranking (theform){
		if (trim (theform.ranking.value) == "nogo"){
			alert ("Please select a ranking.");
			theform.ranking.focus();
			return false;
		}
		if (trim (theform.message.value) == ""){
			alert ("Please enter your message.");
			theform.message.focus();
			return false;
		}
		return true;
	}
	
	//Function to validate the report a problem form.
	function validatereportprob (theform){
		if (trim (theform.message.value) == ""){
			alert ("Please enter a detailed description of the problem.");
			theform.message.focus();
			return false;
		}
		return true;
	}
	
	function validateeform(addform){
		if (trim(addform.firstname.value) == ""){
			alert ("Please enter your first name.");
			addform.firstname.focus();
			return false;
		}
		if (trim(addform.lastname.value) == ""){
			alert ("Please enter your last name.");
			addform.lastname.focus();
			return false;
		}
		if (trim(addform.phone.value) == ""){
			alert ("Please enter your phone number (xxx-xxx-xxxx).");
			addform.phone.focus();
			return false;
		}
		if (!validEmail(trim(addform.email.value))){
			alert ("Please enter a proper email address");
			addform.email.focus();
			return false;
		}
		if (trim(addform.address.value) == ""){
			alert ("Please enter your address.");
			addform.address.focus();
			return false;
		}
		if (trim(addform.city.value) == ""){
			alert ("Please enter your city.");
			addform.city.focus();
			return false;
		}
		if (trim(addform.province.value) == ""){
			alert ("Please enter a state/province.");
			addform.province.focus();
			return false;
		}
		if (addform.country.value == "nogo"){
			alert ("Please select your country.");
			addform.country.focus();
			return false;
		}
		if (trim(addform.postal.value) == ""){
			alert ("Please enter your postal/zip code.");
			addform.postal.focus();
			return false;
		}
		var illegalChars = /\W/;
  		// allow only letters, numbers, and underscores
		if (illegalChars.test(trim(addform.password.value))) {
			alert ("Password may only contain letters, numbers, and underscores.");
			addform.password.focus();
			return false;
		}
		if (trim(addform.password.value) == ""){
			alert ("Password cannot be empty.");
			addform.password.focus();
			return false;
		}
		if (trim(addform.password.value.length) < 5){
			alert ("Password must be longer than 5 characters in length.");
			addform.password.focus();
			return false;
		}
		
		return true;
	}
	function trim(inputString) {
	   // Removes leading and trailing spaces from the passed string. Also removes
	   // consecutive spaces and replaces it with one space. If something besides
	   // a string is passed in (null, custom object, etc.) then return the input.
	   if (typeof inputString != "string") { return inputString; }
	   var retValue = inputString;
	   var ch = retValue.substring(0, 1);
	   while (ch == " ") { // Check for spaces at the beginning of the string
	      retValue = retValue.substring(1, retValue.length);
	      ch = retValue.substring(0, 1);
	   }
	   ch = retValue.substring(retValue.length-1, retValue.length);
	   while (ch == " ") { // Check for spaces at the end of the string
	      retValue = retValue.substring(0, retValue.length-1);
	      ch = retValue.substring(retValue.length-1, retValue.length);
	   }
	   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
	      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	   }
	   return retValue; // Return the trimmed string back to the user
	} // Ends the "trim" function

	//Function to validate email addresses
	function validEmail(email){
		invalidChars = " /:,;";
		
		if (email == ""){
			return false;
		}
		
		for (i=0; i<invalidChars.length; i++){
			badChar = invalidChars.charAt(i);
			if (email.indexOf(badChar,0) > -1){
				return false;
			}
		}
		atPos = email.indexOf("@",1);
		if (atPos == -1){
			return false;
		}
		if (email.indexOf("@",atPos+1) > -1){
			return false;
		}
		periodPos = email.indexOf(".",atPos);
		if (periodPos+3 > email.length){
			return false;
		}
		return true;
	}
	
	
	//Function to pop up the location of a user.
	function showloc (e, theid){
		
		var locxmlhttp=false;
		/*@cc_on @*/
		/*@if (@_jscript_version >= 5)
		try {
			locxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				locxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				locxmlhttp = false;
			}
		}
		@end @*/
	
		if (!locxmlhttp && typeof XMLHttpRequest != 'undefined') {
			locxmlhttp = new XMLHttpRequest();
		}
		
		theObject = document.getElementById("locdiv");
		
		theObject.style.visibility = "visible";
		theObject.style.height = "110px";
		theObject.style.width = "210px";
		
		var posx = 0;
		var posy = 0;
		
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop;
		
		theObject.style.left = posx + "px";
		theObject.style.top = posy + "px";
		
		//The location we are loading the page into.
		var objID = "locdiv";
		var serverPage = "loc.php?indid=" + theid;
		
		var obj = document.getElementById(objID);
		locxmlhttp.open("GET", serverPage);
		locxmlhttp.onreadystatechange = function() {
			if (locxmlhttp.readyState == 4 && locxmlhttp.status == 200) {
				obj.innerHTML = locxmlhttp.responseText;
			}
		}
		locxmlhttp.send(null);
		
	}
	
	//Function to hide the location box.
	function hideloc (){
		
		theObject = document.getElementById("locdiv");
		
		theObject.style.visibility = "hidden";
		theObject.style.height = "0px";
		theObject.style.width = "0px";
		
		theObject.innerHTML = "";
	}
	
	//File upload.
	function uploadimg (theform){
		//Submit the form.
		theform.submit();
	}
	
	//Function to check all boxes.
	function checkall (id, checked){
		var el = document.getElementById(id);
		for (var i = 0; i < el.elements.length; i++) {
			el.elements[i].checked = checked;
		}
	}
	
	//Form submittal.
	var xmlReq = null;
	function submitform (f,serverPage,validatefunc,objID) {
		
		var file = serverPage;
		var str = getFormValues(f,validatefunc);
		xmlReq = getXML(file,str,objID);
	}
	//Function to validate review form.
	function validatereview (thevalue,thename) {
		var nowcont = true;
					
		if (thename == "title"){
			if (trim (thevalue) == ""){
				alert ("You must enter a title.");
				document.revform.title.focus();
				nowcont = false;
			}
		}
			
		if (thename == "rating"){
			if (trim (thevalue) == "nogo"){
				alert ("Please choose a rating.");
				document.revform.rating.focus();
				nowcont = false;
			}
		}
			
		if (thename == "content"){
			if (trim (thevalue) == ""){
				alert ("You must enter your review.");
				document.revform.content.focus();
				nowcont = false;
			}
		}
		
		return nowcont;
	}
	
	function getXML(file,str,objID) {
		
		var obj = document.getElementById(objID);
		var doc = null;
		
		try {
			doc = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				doc = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				doc = false;
			}
		}
		
		if (!doc && typeof XMLHttpRequest != 'undefined') {
			doc = new XMLHttpRequest();
		}
		
		if (plscont == true){
			doc.open("POST", file, true);
			doc.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			doc.setRequestHeader("Enctype","multipart/form-data");
			doc.setRequestHeader("postmode", "multipart form");
			doc.onreadystatechange = function() {
				if (doc.readyState == 4 && doc.status == 200) {
					obj.innerHTML = doc.responseText;
				}
			}
			doc.send(str);
		}
	}
	
	function getFormValues(fobj,valFunc) { 
		var str = ""; 
		var valueArr = null; 
		var val = ""; 
		var cmd = "";
		var aok = true;

			for(var i = 0; i < fobj.elements.length; i++) {
   			
   			switch(fobj.elements[i].type) { 
       			
       		
				case "text": 
					if(valFunc) {
	                    //use single quotes for argument so that the value of 
	                    //fobj.elements[i].value is treated as a string not a literal 
	                    cmd = valFunc + "(" + 'fobj.elements[i].value' + "," + 'fobj.elements[i].name' + ")"; 
	                    if (aok == true){
		                    val = eval(cmd);
		                    if (val == false){
			                    aok = false;
		                    }
	                    }

               		} 

                	str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&"; 
               		break;
               	
               	case "password": 
					if(valFunc) {
	                    //use single quotes for argument so that the value of 
	                    //fobj.elements[i].value is treated as a string not a literal 
	                    cmd = valFunc + "(" + 'fobj.elements[i].value' + "," + 'fobj.elements[i].name' + ")"; 
	                   
	                    if (aok == true){
		                    val = eval(cmd);
		                    if (val == false){
			                    aok = false;
		                    }
	                    }

               		} 

                	str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&"; 
               		break; 
            
       			case "select-one": 
       			
       				if(valFunc) {
	                    //use single quotes for argument so that the value of 
	                    //fobj.elements[i].value is treated as a string not a literal 
	                    cmd = valFunc + "(" + 'fobj.elements[i].options[fobj.elements[i].selectedIndex].value' + "," + 'fobj.elements[i].name' + ")"; 
	                   
	                    if (aok == true){
		                    val = eval(cmd);
		                    if (val == false){
			                    aok = false;
		                    }
	                    }

               		} 

                	str += fobj.elements[i].name + "=" + fobj.elements[i].options[fobj.elements[i].selectedIndex].value + "&";
                	break;
                	
                case "radio":
         
                	
                	if (fobj.elements[i].checked){
						str += fobj.elements[i].name + "=" + fobj.elements[i].value + "&";
                		
					}
					break;
					
                	
                case "select-multiple":
                   	var finstring = "";
                   
					for (var j = 0; j < fobj.elements[i].length; j++){
						if (fobj.elements[i].options[j].selected){
							finstring += fobj.elements[i].options[j].value + "-";
						}
					}
					str += fobj.elements[i].name + "=" + finstring + "&";
                	break; 
                	
                case "file":
                
                	str += fobj.elements[i].name + "=" + escape(fobj.elements[i]) + "&";
                	break;
                	
            	case "hidden":
            
            		str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&";
            		break;
            		
            	case "textarea":
            	
            		if(valFunc) {
	                    //use single quotes for argument so that the value of 
	                    //fobj.elements[i].value is treated as a string not a literal 
	                    cmd = valFunc + "(" + 'fobj.elements[i].value' + "," + 'fobj.elements[i].name' + ")"; 
	                   
	                    if (aok == true){
		                    val = eval(cmd);
		                    if (val == false){
			                    aok = false;
		                    }
	                    }

               		} 
            
            		str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&";
            		break;
            		
            	case "checkbox":
            		if (fobj.elements[i].checked){
                		str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&";
            		} else {
                		str += fobj.elements[i].name + "=" + "&";
            		}
            		
            		break;

  			} 

			} 
			
			if (aok == false){
   			plscont = false;
			} else {
   			plscont = true;
			}

			str = str.substr(0,(str.length - 1)); 
			return str; 

	}
	
	function validdelcheck (){
		return true;
	}
	
	//Function to enable the check for availability button.
	function theavail (thevalue){
		if (thevalue.length > 0){
			document.getElementById("checkavail").disabled = false;
		} else {
			document.getElementById("checkavail").disabled = true;
		}
	}
	
	//Function to load availability script.
	function loadavail (theval){
		
		var illegalChars = /\W/;
  		// allow only letters, numbers, and underscores
  		if (theval.username.value.length < 5){
	  		alert ("Your username must be at least 5 characters in length.");	
  		} else {
			if (illegalChars.test(theval.username.value)) {
				alert ("Your username can contain only letters and numbers.");	
			} else {
				var thepage = "register/checkavail.php?uname=" + theval.username.value;
				getmyhtml (thepage,'avail');
			}
		}
	}
	
	//Function to load affiliate availability script.
	function loadaavail (theval){
		
		var illegalChars = /\W/;
  		// allow only letters, numbers, and underscores
  		if (theval.username.value.length < 5){
	  		alert ("Your username must be at least 5 characters in length.");	
  		} else {
			if (illegalChars.test(theval.username.value)) {
				alert ("Your username can contain only letters and numbers.");	
			} else {
				var thepage = "affiliates/checkavail.php?uname=" + theval.username.value;
				getmyhtml (thepage,'avail');
			}
		}
	}
	
	//Function to load developer availability script.
	function dloadavail (theval){
		
		var illegalChars = /\W/;
  		// allow only letters, numbers, and underscores
  		if (theval.username.value.length < 5){
	  		alert ("Your username must be at least 5 characters in length.");	
  		} else {
			if (illegalChars.test(theval.username.value)) {
				alert ("Your username can contain only letters and numbers.");	
			} else {
				var thepage = "developers/checkavail.php?uname=" + theval.username.value;
				getmyhtml (thepage,'avail');
			}
		}
	}
	
	//Function to generate the html for the banners page.
	function generatehtml (theform, indid){
		var yesorno = false;
		var thevalue = "";
		for (var i=0; i < theform.banner.length; i++) {
     		if (theform.banner[i].checked) {
	     		thevalue = theform.banner[i].value;
        		yesorno = true;
     		}
  		}
  		if (yesorno == false){
      		alert ("Please select a banner.");
      		return false;
  		} else {
	  		//Generate the code.
	  		if (thevalue == "textonly"){
		  		thecode = "<a href=\"http://www.itrademydvds.com/index.php?aid=" + indid + "\">iTradeMyDVDs.com</a>";
	  		} else {
	  			thecode = "<a href=\"http://www.itrademydvds.com/index.php?aid=" + indid + "&bid=" + thevalue + "\"><img src=\"http://www.itrademydvds.com/affiliates/banner.php?bid=" + thevalue + "&aid=" + indid + "\" alt=\"iTradeMyDVDs.com\" title=\"iTradeMyDVDs.com\" style=\"border: none;\" /></a>";
  			}
	  		document.getElementById("gencode").value = thecode;
  		}
	}
	
	//Function to select all in the textarea.
	function selectall (whichbox){
		whichbox.focus();
		whichbox.select();
	}