// JavaScript Document

function navBack(){
	window.history.back();
}

function winClose(){
	window.close();
}

function toggleEmailFriend() {
  try{	
		if (document.getElementById('emailFriend2').style.visibility != 'visible'){
				document.getElementById('orderHalo').style.visibility = 'hidden';
				document.getElementById('emailFriend2').style.visibility = 'visible';
				document.getElementById('to').value = 'Enter Friends Email Address Here';
				document.getElementById('body').value = 'Take a look at the Halo Swim Training System web site: http://www.haloswimtraining.com. The system is built to train and condition three key elements of competetive swimming:High Elbow Catch, Power Stroke Path, and Race Pace Tempo.';
				document.getElementById('to').focus();
				document.getElementById('to').select();
		}else{ 
			document.getElementById('emailFriend2').style.visibility = 'hidden';
			}
	} catch(e){}
}

function toggleOrderHalo() {
  try{	
		if (document.getElementById('orderHalo').style.visibility != 'visible'){
				document.getElementById('emailFriend2').style.visibility = 'hidden';
				document.getElementById('orderHalo').style.visibility = 'visible';
				document.orderHalo.reset();
		}else{ 
			document.getElementById('orderHalo').style.visibility = 'hidden';
			}
			document.getElementById('HaloWeb').focus();
	} catch(e){}
}

function sendMail(mailingType) {
  try {	
  if (mailingType == 'order'){
		  //for (i=0; i<document.orderHalo.templates.length; i++){
					//if (document.orderHalo.templates[i].checked){
						//templateSize = document.orderHalo.templates[i].value;
					//}
		  //}
		  //for (i=0; i<document.orderHalo.pace.length; i++){
					//if (document.orderHalo.pace[i].checked){
						//pace = document.orderHalo.pace[i].value;
					//}
		  //}
			//var placeholder = 'New Halo System Order submitted online\nName: '+document.orderHalo.name.value +'\nTemplate Size: '+templateSize+'\nPacing Equipment: '+pace+'\nAddress: '+document.orderHalo.address1.value +', '+document.orderHalo.address2.value+'\nCity: '+document.orderHalo.city.value +','+document.orderHalo.state.value +' '+document.orderHalo.zip.value +'\nContact Info:\nEmail Address: '+document.orderHalo.emailAddress.value +'\nPhoneNumber: '+document.orderHalo.phoneNumber.value +'\nPromoCode: '+document.orderHalo.promoCode.value;
  		document.orderHalo.action =	'/mailer.php';
			document.orderHalo.subject.value = 'Halo Online Order Request'; 
			document.orderHalo.body.value = 'an order was placed online';
			document.orderHalo.from.value = 'craig@lanegainer.com';
			#document.orderHalo.to.value = 'craig@lanegainer.com,mark@iqguys.com' ;
			document.orderHalo.to.value = 'ryan@iQguys.com,mark@iqguys.com' ;
			document.orderHalo.submit();
	}else if (mailingType == 'friend'){
			document.friend.action ='/mailer.php';
			document.friend.subject.value = 'Halo Swim Training System - http://www.haloswimtraining.com';
			document.friend.from.value = 'craig@lanegainer.com';
			document.friend.submit();
	}
	document.getElementById('orderHalo').style.visibility = 'hidden';
	document.getElementById('emailFriend2').style.visibility = 'hidden';
  } catch(e){}
}


function toggleRow (ID){
	try{
		if (document.getElementById(ID).style.display != 'inline'){
				document.getElementById(ID).style.display = 'inline';
				}
		for (ii=1; ii<=2; ii++){
			if('navigationList'+ii!= ID){
				document.getElementById('navigationList'+ii).style.display = 'none';
			}
		}
		document.getElementById('HaloWeb').focus();
	} catch(e){}
	
}

