	var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5);
	
	var xmlHttp;
	
	function addOption(theSel, theText, theValue)
	{
		var newOpt = new Option(theText, theValue);
		var selLength = theSel.length;
		theSel.options[selLength] = newOpt;
	}
		
	function removeOptions(selectbox)
	{
		var i;
		for(i=selectbox.options.length-1;i>=0;i--)
		{
			if(selectbox.options[i].selected)
			selectbox.remove(i);
		}
	}
	
	function moveOptions(theSelFrom, theSelTo)
	{
		
		var selLength = theSelFrom.length;
		var selectedText = new Array();
		var selectedValues = new Array();
		var selectedCount = 0;
		
		var i;
		
		// Find the selected Options in reverse order
		// and delete them from the 'from' Select.
		
		for(i=selLength-1; i>=0; i--)
		{
			if(theSelFrom.options[i].selected)
			{
				selectedText[selectedCount] = theSelFrom.options[i].text;
				selectedValues[selectedCount] = theSelFrom.options[i].value;
				// deleteOption(theSelFrom, i);
				selectedCount++;
			}
		}
				
		// Add the selected text/values in reverse order.
		// This will add the Options to the 'to' Select
		// in the same order as they were in the 'from' Select.
		for(i=selectedCount-1; i>=0; i--)
		{
			addOption(theSelTo, selectedText[i], selectedValues[i]);
		}
		
		
		
		if(NS4) history.go(0);
	}
	
	function moveOptions2(theSelFrom, theSelTo)
	{
		
		var selLength = theSelFrom.length;
		var selectedText = new Array();
		var selectedValues = new Array();
		var selectedCount = 0;
		
		var i;
		
		// Find the selected Options in reverse order
		// and delete them from the 'from' Select.
		
		for(i=selLength-1; i>=0; i--)
		{
			if(theSelFrom.options[i].selected)
			{
				selectedText[selectedCount] = theSelFrom.options[i].text;
				selectedValues[selectedCount] = theSelFrom.options[i].value;
				// deleteOption(theSelFrom, i);
				selectedCount++;
			}
		}
				
		// Add the selected text/values in reverse order.
		// This will add the Options to the 'to' Select
		// in the same order as they were in the 'from' Select.
		for(i=selectedCount-1; i>=0; i--)
		{
			addOption(theSelTo, selectedText[i], selectedValues[i]);
			addOption(theSelTo, selectedText[i], selectedValues[i]);
		}
		
		if(NS4) history.go(0);
	}
	
	function moveOptions3(theSelFrom, theSelTo)
	{
		
		var selLength = theSelFrom.length;
		var selectedText = new Array();
		var selectedValues = new Array();
		var selectedCount = 0;
		
		var i;
		
		// Find the selected Options in reverse order
		// and delete them from the 'from' Select.
		
		for(i=selLength-1; i>=0; i--)
		{
			if(theSelFrom.options[i].selected)
			{
				selectedText[selectedCount] = theSelFrom.options[i].text;
				selectedValues[selectedCount] = theSelFrom.options[i].value;
				// deleteOption(theSelFrom, i);
				selectedCount++;
			}
		}
				
		// Add the selected text/values in reverse order.
		// This will add the Options to the 'to' Select
		// in the same order as they were in the 'from' Select.
		for(i=selectedCount-1; i>=0; i--)
		{
			addOption(theSelTo, selectedText[i], selectedValues[i]);
			addOption(theSelTo, selectedText[i], selectedValues[i]);
			addOption(theSelTo, selectedText[i], selectedValues[i]);
		}
		
		if(NS4) history.go(0);
	}
	
	function placeInHidden(delim, selStr, hidStr)
	{
		var selObj = document.getElementById(selStr);
		var hideObj = document.getElementById(hidStr);
		hideObj.value = '';

		for (var i=0; i<selObj.options.length; i++) {
			hideObj.value = hideObj.value ==
				'' ? selObj.options[i].value : hideObj.value + delim + selObj.options[i].value;
		}
	}	
	
	function viewCard(selectbox)
	{
		xmlHttp=GetXmlHttpObject();

		if (xmlHttp==null)
		  {
			  alert ("Browser does not support HTTP Request");
			  return;
		  } 

		var i;
		var valid = 0;
		for(i=0; i<=selectbox.options.length; i++)
		{
			if(selectbox.options[i].selected)
			{
				
				var no=selectbox.options[selectbox.selectedIndex].value;
				if (no > 0)
				{
					valid = no;
					var url="viewCard.php?deck_id=" + no;
					xmlHttp.onreadystatechange=stateChanged;
					xmlHttp.open("GET", url , true);
					xmlHttp.send(null);
				}
				break;
			}
		}
		
		if(valid == 0)
		{
			alert("no card has been selected!!");
		}
	}
	
	function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState==200)
		{
			xmlDoc=xmlHttp.responseXML;
			
			var card_id = xmlDoc.getElementsByTagName("card_id")[0].childNodes[0].nodeValue;
			var url		= "http://www.daigotsu.com/page.php?card=profile&id=" + card_id;
			window.open(url, "", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=700, height=700");
		}
	} 
	
	function GetXmlHttpObject()
	 { 
		 var objXMLHttp=null
		 if (window.XMLHttpRequest)
		  {
		  	objXMLHttp=new XMLHttpRequest()
		  }
		 else if (window.ActiveXObject)
		  {
		  	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		 return objXMLHttp
	 }
	
	<!-- deckInsert.php -->
	function validateForm()
	{
		if(document.deckVerify.deck_title.value == "")
		{
			alert('Title missing...');
		}
		else if(document.deckVerify.format_id.selectedIndex == 0)
		{
			alert('Format missing...');
		}
		else if(document.deckVerify.stronghold_id.selectedIndex == 0)
		{
			alert('Stronghold missing...');
		}
		else
		{
			placeInHidden(';', 'sel2', 'hide2');
			document.deckVerify.submit();
		}
	}
	
	<!-- deckVerify.php -->
	function newDeck()
	{
		document.deckverfication.action = "page.php?deck=new";
		document.deckverfication.submit();
	}