		//function for making rollovers in per_nav
		function nav_overs(elem)
		{
			var pnav = document.getElementById(elem);
			
			var nav_items = pnav.getElementsByTagName('li');
			for(i=0;i<nav_items.length;i++){
				//dont try to make rollovers for images with no_rollover class
				if(nav_items[i].className != 'act'){
					nav_items[i].onmouseover=function(){this.className = 'act';}
					nav_items[i].onmouseout=function(){this.className = '';}
				}				
				
			}
			
			
			
		}
		
		function swapimg(elem){
				var itemimg = elem.getElementsByTagName('img');
				for(i=0;i<itemimg.length;i++){
					itemimg[i].src = splitSrc(itemimg[i].src);
				}
		}
		
		//helper function for rollovers
		function splitSrc(imgsrc){			
			//now break it into parts so that we can change it to the over state
			var this_ext = imgsrc.substring(imgsrc.length-4,imgsrc.length);
			//flag the current state (on/off)
			var state = imgsrc.substring(imgsrc.length-7,imgsrc.length-4) == '_on' ? true : false;
				
				if(state){
					var this_src_split = imgsrc.split('_on');
					var newsrc = this_src_split[0]+''+this_ext;
				}else{
					var this_src_split = imgsrc.split(this_ext);
					var newsrc = this_src_split[0]+'_on'+this_ext;
				} 
			return newsrc;
		}
		
		//function to show warranty statement
		
		function showWarranty(){
			var vis = document.getElementById('warr_content').style.display;
			vis == 'block' ? document.getElementById('warr_content').style.display ='none' : document.getElementById('warr_content').style.display = 'block';
		}
	
	//functions for validation
	
	function isEmail(str){
	if(str == '') return false;
	var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i
	return re.test(str);
	}
	
	function isText(str){
		if(str == '') return false;
		return true;
	}
	
    // returns true if the string is a US phone number formatted as...
    // (000)000-0000, (000) 000-0000, 000-000-0000, 000.000.0000, 000 000 0000, 0000000000
    function isPhoneNumber(str){
        var re = /^\(?[2-9]\d{2}[\)\.-]?\s?\d{3}[\s\.-]?\d{4}$/
        return re.test(str);
    }
	
function stripWhitespace(str, replacement){// NOT USED IN FORM VALIDATION
	if (replacement == null) replacement = '';
	var result = str;
	var re = /\s/g
	if(str.search(re) != -1){
		result = str.replace(re, replacement);
	}
	return result;
}

function setHeights(){
	
	if(document.getElementById('wide_col') && document.getElementById('narrow_col')){
		var wc = document.getElementById('wide_col').offsetHeight;
		var nc = document.getElementById('narrow_col').offsetHeight;
	
		var diff = wc-nc;
	
		if(diff < 0){
			document.getElementById('wide_col').style.height = wc - diff + 'px';
		}
	}

}

	/****NEWS SCROLLER CODE***************************************************/
		
		var iPress = 0;
		
		function initPress(){
			//test to make sure we have the news element
			if(document.getElementById('press_item')){
			
				beginPressLoop();
				setInterval(beginPressLoop, 6000);
			
			}
		}
		
		
		function beginPressLoop(){
			resetPress();
			document.getElementById('press_item').innerHTML = press[iPress]; slide('up');
			if(iPress < press.length -1 ){ iPress++; }else{ iPress = 0; }
		}
		
		function resetPress(){
			document.getElementById('press_item').style.top = '-35px';
			document.getElementById('press_item').style.color = '#37424A';
		}
		
	/*************************************************************************/
	
	/****NOTES**********************************************************************
 
 This script will scroll the thumbnails pane vertically.
 
*******************************************************************************/

// These 2 vars control the speed and easing of the scrolling.
steps = 30; 
speed = 25;

//flag to tell when menu is moving
inMotion = false;

		function slide(side){
			
			//****TEST FOR MENU THAT IS STILL MOVING****************************/
			if(inMotion){return false;}
			
			//****get the amount of the div that is not visible*****************/
			
			vHei = sansPX(document.getElementById('press_container').style.height);
			
			eHei = document.getElementById('press_item').offsetHeight;
			
			hDiff = eHei - vHei;
			
			//******************************************************************/


			//****test for direction********************************************/
			
			
			if(side == 'up'){
				//if the current size is greater than our object, no need to go any further
				if(currentTop() < 0){
					//get the scroll on
					b = Math.abs(currentTop());
					t = 0;
					d = steps;
					c = hDiff;
					inMotion = true;
					
					dropping = setInterval(dropItem, speed);
				}else{
					return false;
				}
			
			}else{
				return false;
			}
			
			//******************************************************************/
			
		}
		
		function dropItem(){
			
			if(t < d){
				t++;
				withEase = easeOut(t, b, c, d); //1,100,100,30
				//scrollTo(withEase,0);
				document.getElementById('press_item').style.top = withEase +'px';
				
			}else{
				clearInterval(dropping);
				//reset position
				inMotion = false;

			}
		}
		
		/****EASING FUNCTION***************************************************/
		
		///////////// BOUNCE EASING ////////////////////////////////////////////
		// t: current time, b: beginning value, c: change in position, d: duration
		// sinusoidal easing in/out - accelerating until halfway, then decelerating
		// equation from Robert Penner - http://robertpenner.com/easing
		// Copyright © 2001 Robert Penner All rights reserved. /////////////////
		
		function easeOut (t, b, c, d) {
				if ((t/=d) < (1/2.75)) {
					var ret =   Math.ceil(c*(7.5625*t*t) - b);
				} else if (t < (2/2.75)) {
					var ret =  Math.ceil(c*(7.5625*(t-=(1.5/2.75))*t + .75) - b);
				} else if (t < (2.5/2.75)) {
					var ret =  Math.ceil(c*(7.5625*(t-=(2.25/2.75))*t + .9375) - b);
				} else {
					var ret =  Math.ceil(c*(7.5625*(t-=(2.625/2.75))*t + .984375) - b);
				}
				
				return ret;
				
			}
		
		/****GET THE CURRENT POSITION******************************************/
		
		function currentTop(){
			var tempTop = document.getElementById('press_item').style.top;
			if(tempTop == ''){return 0;}
			else{
			var asInt = tempTop.substring(0, tempTop.length-2);
			return asInt;
			}
			
		}
		
		/****GET THE MEASURE SANS PX*******************************************/
		
		function sansPX(str){
			var tempMeasure = str;
			if(tempMeasure == ''){return 0;}
			else {
				if(tempMeasure.substring(tempMeasure.length-2, tempMeasure.length) == 'px'){
					var asInt = tempMeasure.substring(0, tempMeasure.length-2);
					return asInt;
				}else{
					return tempMeasure;
					
				}
			}
			
		}
		
/*******************************************************************************/
//  END OF SCROLLING SCRIPT
/*******************************************************************************/
		
		
		window.onload=function(){
			//initLightbox();
			nav_overs('nav');
			setHeights();
			initPress();
			nextNewsItem();
			if(document.getElementById('contact')){formEvents();}
		}
