document.write('<script type="text/javascript" language="JavaScript" src="/common/incImages.js"></script>');
document.write('<script type="text/javascript" language="JavaScript" src="/common/rchCommon.js"></script>');
	
var timBtnTip;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ menuBtnHover()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function menuBtnHover(inBtn, inName, inMode){
	
	if (inMode=='over'){
		document.getElementById('btnImg'+inName).src=eval('btn'+inName+'Over.src');
	}else{
		document.getElementById('btnImg'+inName).src=eval('btn'+inName+'.src');
	}
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ showBtnTip()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function showBtnTip(inBtn, inTip, inWidth){
	
	if (typeof inWidth == 'undefined'){
		inWidth=150;
	}
	
	hideBtnTip();
	
	objTip=document.getElementById('divBtnTip');
	objTip.innerHTML=inTip;
	
	objTip.style.left=(parseInt(findPosX(inBtn))+5)+'px';
	objTip.style.top=(parseInt(findPosY(inBtn))+parseInt(findPosH(inBtn)))+'px';
	objTip.style.width=inWidth+'px';
	
	objTip.style.display='block';
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ delayHideBtnTip()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function delayHideBtnTip(){
	
	timBtnTip=setTimeout('hideBtnTip()', 250);
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ hideBtnTip()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function hideBtnTip(){
	
	objTip=document.getElementById('divBtnTip');
	objTip.style.display='none';
	
	clearTimeout(timBtnTip);
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ toggleSubSection()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function toggleSubSection(inObjName){
	
	tmpObj=document.getElementById(inObjName);
	if (tmpObj.style.display=='block'){
		tmpObj.style.display='none';
	}else{
		tmpObj.style.display='block';
	}
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ viewLargeImageInWin()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function viewLargeImageInWin(inImgPath, inOptions){
	
	winLrgImg = window.open(inImgPath, 'safetyLinksSubWin', inOptions);
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ valContactForm()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function valContactForm(){
  
  tmpObj=document.getElementById('name');
  if (tmpObj.value==''){
    window.alert('Please enter your name!');
    tmpObj.focus();
    return false;
  }
  tmpObj=document.getElementById('captcha_code');
  if (tmpObj.value==''){
    window.alert('Please enter security code!');
    tmpObj.focus();
    return false;
  }
  tmpObj=document.getElementById('name3');
  if (tmpObj.value==''){
    window.alert('Please enter your email address!');
    tmpObj.focus();
    return false;
  }
  
  objForm=document.getElementById('frmContactForm24');
	objForm.action='/submitContactForm.php';
  objForm.submit();
  
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ valFAQForm()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function valFAQForm(){
	
	tmpObj=document.getElementById('name');
	if (tmpObj.value==''){
		window.alert('Please enter your name!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('name2');
	if (tmpObj.value==''){
		window.alert('Please enter question!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('name3');
	if (tmpObj.value==''){
		window.alert('Please enter your email address!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('captcha_code');
	if (tmpObj.value==''){
		window.alert('Please enter security code!');
		tmpObj.focus();
		return false;
	}
	
	objForm=document.getElementById('frmFAQForm');
	objForm.action='/submitFAQForm.php';
	objForm.submit();
  
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ valNewsletterForm()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function valNewsletterForm(){
	
	tmpObj=document.getElementById('name');
	if (tmpObj.value==''){
		window.alert('Please enter your name!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('company2');
	if (tmpObj.value==''){
		window.alert('Please enter company!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('telephone');
	if (tmpObj.value==''){
		window.alert('Please enter your phone number!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('name3');
	if (tmpObj.value==''){
		window.alert('Please enter your email!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('captcha_code');
	if (tmpObj.value==''){
		window.alert('Please enter security code!');
		tmpObj.focus();
		return false;
	}
	
	objForm=document.getElementById('frmNewsletter');
	objForm.action='/submitNewsletterForm.php';
	objForm.submit();
  
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ valEnrollForm()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function valEnrollForm(){
	
	tmpObj=document.getElementById('txtMemName');
	if (tmpObj.value==''){
		window.alert('Please enter your name!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtMemTitle');
	if (tmpObj.value==''){
		window.alert('Please enter your title!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtMemEmail');
	if (tmpObj.value==''){
		window.alert('Please enter your email!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtMemPhoneArea');
	if (tmpObj.value==''){
		window.alert('Please enter your phone!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtMemPhoneNum');
	if (tmpObj.value==''){
		window.alert('Please enter your phone!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtMemPwd');
	if (tmpObj.value==''){
		window.alert('Please create your password!');
		tmpObj.focus();
		return false;
	}
	tmpObj2=document.getElementById('txtMemCPwd');
	if (tmpObj2.value==''){
		window.alert('Please confirm your password!');
		tmpObj2.focus();
		return false;
	}
	if (tmpObj.value.length<6){
		window.alert('Password must be at least 6 characters long!');
		tmpObj.focus();
		return false;
	}
	if (tmpObj.value!=tmpObj2.value){
		window.alert('Passwords must match!');
		tmpObj2.focus();
		return false;
	}
	tmpObj=document.getElementById('txtComName');
	if (tmpObj.value==''){
		window.alert('Please enter company name!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtComPhoneArea');
	if (tmpObj.value==''){
		window.alert('Please enter company phone!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtComPhoneNum');
	if (tmpObj.value==''){
		window.alert('Please enter company phone!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtComSAddr');
	if (tmpObj.value==''){
		window.alert('Please enter street address!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtComSCity');
	if (tmpObj.value==''){
		window.alert('Please enter street city!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('cmbComSState');
	if (tmpObj.options[tmpObj.selectedIndex].value=='0'){
		window.alert('Please select street state!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtComSZip');
	if (tmpObj.value==''){
		window.alert('Please enter street zip code!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtSafetyName');
	if (tmpObj.value==''){
		window.alert('Please enter main safety contact name!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtSafetyTitle');
	if (tmpObj.value==''){
		window.alert('Please enter main safety contact title!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtSafetyEmail');
	if (tmpObj.value==''){
		window.alert('Please enter main safety contact email!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtSafetyPhoneArea');
	if (tmpObj.value==''){
		window.alert('Please enter main safety contact phone!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('txtSafetyPhoneNum');
	if (tmpObj.value==''){
		window.alert('Please enter main safety contact phone!');
		tmpObj.focus();
		return false;
	}
	tmpObj=document.getElementById('opPlan0');
	if (tmpObj.checked){
		//basic
		document.getElementById('txtAmt').value=0;
		
	}else{
		tmpObj=document.getElementById('opPlan1');
		if (tmpObj.checked){
			//premium
			
		}else{
			//plan not selected
			window.alert('Please select membership level!');
			tmpObj.focus();
			return false;
		}
	}
	
	objForm=document.getElementById('frmEnroll');
	objForm.action='processNewMember.php';
	objForm.submit();
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ addToOnload()
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function addToOnload(inFuncName){
	//remember to call this after any third party apps have been called
	//ie after the header
	//sample: <script>addToOnload('initPage()');</script>
	
	var nowOnload = window.onload; // Let's save the existing assignment, if any
	window.onload = function () {
		// Here is your precious function
		// You can call as many functions as you want here;
		
		setTimeout(inFuncName, 1); //myOnloadFunction1();
		
		// Now we call old function which was assigned to onLoad, thus playing nice
		if(nowOnload != null && typeof(nowOnload) == 'function') {
			nowOnload();
		}
	}
	
}