

function hideImage (name) {
  var c = document.getElementById(name);
  c.style.left        = -5000+"px";
}



function hideAll () {
hideImage('BROKEN_WINDOW_REPAIRS');
hideImage('GLASS_REPLACEMENTS');
hideImage('DOORS');
hideImage('SECURITY');
hideImage('CUSTOM_DOORS');
}



function showImage (name) {
  var c = document.getElementById(name);
  c.style.left        = 161 +"px";
}










function checkForm(){
	var email = document.getElementById('email');
	var message = document.getElementById('message');

	if(!isEmpty(message, "Please fill in all sections first")){
							if(emailValidator(email, "Invalid email address")){ return true; }
	}
	
	
	
	return false;	
}



function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); 
		return true;
	}
	return false;
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}



//function SlideShow(){
//var imgs = new Array();
//img[0] = 'http://www.gtaglassanddoor.com/images/slideshow/1.png';
//img[1] = 'http://www.gtaglassanddoor.com/images/slideshow/2.png';
//img[2] = 'http://www.gtaglassanddoor.com/images/slideshow/3.png';


//var t;
//var j = 0;
//var p = imgs.length;

//   j = j + 1;
//   if (j > (p-1)) j=0;
//   t = setTimeout('runSlideShow()', spd);
//}



