// JavaScript Document


ns4 = (document.layers) ? true : false
		ie4 = (document.all) ? true : false
		ns6 = (!document.all && document.getElementById) ? true : false;
	
		// list of all portfolio items
		var work = new Array();
			work[0] = "understanding";
			work[1] = "quest";
			work[2] = "systems";
			work[3] = "epson";	
			work[4] = "boreal";	
			work[5] = "ars";	
			work[6] = "macpark";	
			work[7] = "urban";
			work[8] = "mm";	
			work[9] = "strategic";	
			work[10] = "fonts";
			work[11] = "qlcharts_sem";
			work[12] = "skins";
		
		
			var active = "default";
		
		
		// show a <div>
		function show(id) 
		{
			// hide current if it's not a reload
			if (active != id)
			{
				hide(active);
				
				// display selected
				if (ns4) document.layers[id].visibility = "show"
				else if (ie4) document.all[id].style.visibility = "visible"
				else if (ns6) document.getElementById(id).style.visibility = "visible"
				else return false;
				
				// note the selected
				active = id;
			}
			
			return true;
		}
		
		// hide a <div>
		function hide(id)
		{		
			if (ns4) document.layers[id].visibility = "hide"
			else if (ie4) document.all[id].style.visibility = "hidden"
			else if (ns6) document.getElementById(id).style.visibility = "hidden"
		}
	
		// hide all <div>'s at the beginning
		function initWork()
		{
			for (ii = 0; ii < work.length; ii++)
			{
				hide(work[ii]);
			}
		}
	
		function restore()
		{ 
			if (ns4)
			{
				location.reload();
			}
		} 
	
		function preSubmit(form)
		{
		        if (form.vchMailingList.value == "your email here" || form.vchMailingList.value == "")
				{
		            alert('Enter a valid e-mail address');
		            form.vchMailingList.value = "";
		            form.vchMailingList.focus();
		            return false;
		        }
		        else if (form.vchMailingList.value != "")
				{
		              var str = form.vchMailingList.value;
		              var isEmail = ((str.indexOf("@") != -1) && (str.indexOf(".") != -1) && (str.indexOf(" ") == -1));
		              
		              if (!isEmail) 
					  {
	                      alert("" + str + " is an invalid email address!  Please clear the field or correct the address.  Be sure to include your domain.");
	                      form.vchMailingList.value = "";
	                      form.vchMailingList.focus();
	                      return false;
					  }
				}
		        else { return true; }
		}

