
function popUpGreen(){
		var leftVal = (screen.availWidth-550)/2;
		var topVal = (screen.availHeight-450)/2;
		var thedest=window.open("goinggreen.aspx",null,"height=450,width=550,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,left=" +leftVal+",top="+topVal);
	}
function load_item(id) {
	
   //hide existing
   opacity('thebody', 100, 0, 500);
   opacity('thetitle', 100, 0, 500);
	setTimeout("waitcomplete('"+id+"')", 700);	
	
} 
function load_branded_item(id,storagebanner){
	opacity('thebody', 100, 0, 500);
   opacity('thetitle', 100, 0, 500);
   
	setTimeout("waitcomplete('"+id+"')", 700);
	document.getElementById('advertisementbanner').style.display="none";
	
	
	if (storagebanner=="1"){
		document.getElementById('advertisementbanner').style.display="block";
	}else{
		document.getElementById('advertisementbanner').style.display="none";
	}
}
function theonloadbanner(){
	document.getElementById('advertisementbanner').style.display="block";
}
function load_item_commercial(id) {
	
   //hide existing
   opacity('thebody', 100, 0, 500);
   opacity('thetitle', 100, 0, 500);
   opacity('contact_col_1', 100, 0, 500);
   opacity('contact_col_2', 100, 0, 500);
	setTimeout("waitcomplete_commercial('"+id+"')", 700);	
} 

function waitcomplete_commercial(id){
	//change content\
	//alert("tests");
  
  
	   document.getElementById('thetitle').innerHTML = bio[id][0].split("[pos]").join("'");
	   document.getElementById('thebody').innerHTML = bio[id][1].split("[pos]").join("'");
	   document.getElementById('contact_col_1').innerHTML = bio[id][2].split("[pos]").join("'");
	   document.getElementById('contact_col_2').innerHTML = bio[id][3].split("[pos]").join("'");
  
   //re display
	opacity('thebody', 0, 100, 500);
	opacity('thetitle', 0, 100, 500);
	opacity('contact_col_1', 0, 100, 500);
    opacity('contact_col_2', 0, 100, 500);
	//alert(theitems_cnt);
	theloop(id);
	
	if (id=="3"){
		document.getElementById('advertisementbanner').style.display="block";
	}else{
		document.getElementById('advertisementbanner').style.display="none";
	}
	
}
function load_item_storage(id) {
	
   //hide existing
   opacity('thebody', 100, 0, 500);
   opacity('thetitle', 100, 0, 500);
	setTimeout("waitcomplete('"+id+"')", 700);	
	if (id=="3"){
		document.getElementById('advertisementbanner').style.display="block";
	}else{
		document.getElementById('advertisementbanner').style.display="none";
	}
} 
function load_homefade() {
   opacity('nav', 0, 100, 500);
  // initnavitems();
   //load rest of page content after the main wrapper
  // setTimeout("waitcomplete2()", 500);	
  opacity('welcomeWrapper', 0, 100, 500);
   opacity('dotted', 0, 100, 500);
   opacity('agentsWrapper', 0, 100, 500);
   
} 

function waitcomplete2(){
   
}
function waitcomplete(id){
	//change content\
	//alert("tests");
  
   if (about=='1'){
		document.getElementById('thetitle').innerHTML = bio[id][0].split("[pos]").join("'");
		
	   document.getElementById('thebody').innerHTML =  '<img src="data/images/'+bio[id][2]+'" style="float:left" />'+bio[id][1].split("[pos]").join("'");
   }else{
	   document.getElementById('thetitle').innerHTML = bio[id][0].split("[pos]").join("'");
	   document.getElementById('thebody').innerHTML = bio[id][1].split("[pos]").join("'");
   }
   //re display
	opacity('thebody', 0, 100, 500);
	opacity('thetitle', 0, 100, 500);
	
	//alert(theitems_cnt);
	theloop(id);
	
	
}
function login(){
	document.login_form.submit();
}

function launch_login(){
	var leftVal = (screen.availWidth-500)/2;
	var topVal = (screen.availHeight-600)/2;
//	var thedest=window.open("resources_popUp.aspx",null,"height=600,width=500,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,left=" +leftVal+",top="+topVal);
	var thedest=window.open("resources_popUp.aspx");
}
function contact_form_submit(){

	if (document.getElementById('txtname').value =="" || document.getElementById('txtstreet').value =="" || document.getElementById('txtcitystatezip').value =="" || document.getElementById('txtphone').value ==""){
		alert("All Fields are required. Please complete the entire form.");
		return;
	}else{
		if (echeck(document.getElementById('txtemail').value)!=false){
			//if (document.getElementById('chlocal').checked==false && document.getElementById('chinterstate').checked==false & document.getElementById('chcorporaterelocation').checked==false && document.getElementById('chinternationalmove').checked==false && document.getElementById('chhousehold').checked==false && document.getElementById('chportable').checked==false && document.getElementById('chmilitary').checked==false && document.getElementById('chrv').checked==false && document.getElementById('chofficeindustrial').checked==false && document.getElementById('chcommercial').checked==false && document.getElementById('chwarehouse').checked==false && document.getElementById('chtradeshow').checked==false && document.getElementById('chlogistics').checked==false && document.getElementById('chstorage').checked==false && document.getElementById('chhighval').checked==false && document.getElementById('chcorp').checked==false){	
			//	alert("All Fields are required. Please complete the entire form.");
			//}else{
				document.contact_form.submit();
			//}
		}
	}
}
function activenav(item){
	document.getElementById(item).className="subactive";
	}
function theloop(id){
	for (x=1; x<=theitems_cnt; x++){
	
		if (x==id){
				document.getElementById('item_'+x).className="subactive";
			}else{
				document.getElementById('item_'+x).className="";
			}
		
	}
}


/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		    alert("Invalid email address. Please re-enter email addrress.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid email address. Please re-enter email addrress.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Invalid email address. Please re-enter email addrress.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid email address. Please re-enter email addrress.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid email address. Please re-enter email addrress.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid email address. Please re-enter email addrress.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid email address. Please re-enter email addrress.")
		    return false
		 }

 		 return true					
	}

