function switch_bigimg(imgname,dir){
	document.images['bigimg'].src=dir+"admin/photos/uploads/thumbs/"+imgname+"";
}

function dsp(loc){
   if(document.getElementById){
      var foc=loc.firstChild;
      foc=loc.firstChild.innerHTML?
         loc.firstChild:
         loc.firstChild.nextSibling;
      foc=loc.parentNode.nextSibling.style?
         loc.parentNode.nextSibling:
         loc.parentNode.nextSibling.nextSibling;
      foc.style.display=foc.style.display=='block'?'none':'block';}
} 

function submitit() {

	fname=document.regform.FName.value;
	fname=fname.replace(/(^\s*)|(\s*$)/g,''); 
	if(fname==""){alert("Please fill out your First Name!"); return false;}

	lname=document.regform.LName.value;
	lname=lname.replace(/(^\s*)|(\s*$)/g,''); 
	if(lname==""){alert("Please fill out your Last Name!"); return false;}

	address=document.regform.Address.value;
	address=address.replace(/(^\s*)|(\s*$)/g,''); 
	if(address==""){alert("Please fill out your Address!"); return false;}

	city=document.regform.City.value;
	city=city.replace(/(^\s*)|(\s*$)/g,''); 
	if(city==""){alert("Please fill out your City!"); return false;}

	state=document.regform.State.value;
	state=state.replace(/(^\s*)|(\s*$)/g,''); 
	if(state==""){alert("Please fill out your State!"); return false;}

	zip=document.regform.Zip.value;
	zip=zip.replace(/(^\s*)|(\s*$)/g,''); 
	if(zip==""){alert("Please fill out your Zip!"); return false;}

	phone=document.regform.Phone.value;
	phone=phone.replace(/(^\s*)|(\s*$)/g,''); 
	if(phone==""){alert("Please fill out your Phone Number!"); return false;}

	email=document.regform.Email.value;
	email=email.replace(/(^\s*)|(\s*$)/g,''); 
	if(email==""){alert("E-mail Address is not valid!"); return false;}
	email_array=email.split("@");
	if(email_array.length!=2){alert("E-mail Address is not valid!"); return false;}
	user=email_array[0].replace(/(^\s*)|(\s*$)/g,'');
	domain=email_array[1].replace(/(^\s*)|(\s*$)/g,'');
	if(user=="" || domain==""){alert("E-mail Address is not valid!"); return false;}
	domain_array=domain.split(".");
	if(domain_array.length<2){alert("E-mail Address is not valid!"); return false;}
	domain_name=domain_array[0].replace(/(^\s*)|(\s*$)/g,'');
	domain_ext=domain_array[1].replace(/(^\s*)|(\s*$)/g,'');
	if(domain_name=="" || domain_ext==""){alert("E-mail Address is not valid!"); return false;}

	pass=document.regform.Password.value;
	pass1=document.regform.Password2.value;
	pass=pass.replace(/(^\s*)|(\s*$)/g,''); 
	pass1=pass1.replace(/(^\s*)|(\s*$)/g,''); 
	if(pass==""){alert("Please enter a password!"); return false;}
	else{
		if(pass.length<6){
			document.regform.Password.value=pass;
			alert("Password must be at least 6 chars!"); 
			return false;
		}
		else{
			if(pass!=pass1){
				alert("Passwords do not match!!"); 
				return false;
			}
			else{document.regform.Password.value=pass;}
		}
	}

	hear=document.regform.HearAboutUs.value;
	hear=hear.replace(/(^\s*)|(\s*$)/g,''); 
	if(hear==""){alert("Please fill out how you heard about us!"); return false;}

	img=document.regform.vImageCodP.value;
	img=img.replace(/(^\s*)|(\s*$)/g,''); 
	if(img==""){alert("Enter Image Varification Text (case sensitive)!"); return false;}

	return true;
}

function submitContact() {

	uname=document.contactForm.uname.value;
	uname=uname.replace(/(^\s*)|(\s*$)/g,''); 
	if(uname==""){alert("Please fill out your name!"); return false;}

	from=document.contactForm.from.value;
	from=from.replace(/(^\s*)|(\s*$)/g,''); 
	if(from==""){alert("E-mail Address is not valid!"); return false;}
	from_array=from.split("@");
	if(from_array.length!=2){alert("E-mail Address is not valid!"); return false;}
	user=from_array[0].replace(/(^\s*)|(\s*$)/g,'');
	domain=from_array[1].replace(/(^\s*)|(\s*$)/g,'');
	if(user=="" || domain==""){alert("E-mail Address is not valid!"); return false;}
	domain_array=domain.split(".");
	if(domain_array.length<2){alert("E-mail Address is not valid!"); return false;}
	domain_name=domain_array[0].replace(/(^\s*)|(\s*$)/g,'');
	domain_ext=domain_array[1].replace(/(^\s*)|(\s*$)/g,'');
	if(domain_name=="" || domain_ext==""){alert("E-mail Address is not valid!"); return false;}

	subject=document.contactForm.subject.value;
	subject=subject.replace(/(^\s*)|(\s*$)/g,''); 
	if(subject==""){alert("Please fill out a subject!"); return false;}

	message=document.contactForm.message.value;
	message=message.replace(/(^\s*)|(\s*$)/g,''); 
	if(message==""){alert("Please fill out a message!"); return false;}

this.form.submit();
}

var pop_height = screen.height *.60
var pop_width = screen.width *.60
var strPopup = "height=" + pop_height + ",width=" + pop_width + ",top=10,left=10,status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes"
var strPopupNM = "height=" + pop_height + ",width=" + pop_width + ",top=10,left=10,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes"

function loadPopup(url)
{
	var winPopup = window.open(url, "ImagePopup", strPopup)
	winPopup.focus()
}
function loadPopupNM(url)
{
	var winPopup = window.open(url, "ImagePopup", strPopupNM)
	winPopup.focus()
}
