function isEmail(elm) {
    if (elm.value.indexOf("@") == "-1" || elm.value.indexOf(".") == "-1" || elm.value == "")
    return true;
    else return false;
}

function checkData_contact() {
  	if (document.form_contact.name.value.length == 0) {
		alert("Please enter your Name. ");
		document.form_contact.name.focus();
       return false;
	};
	
	if (isEmail(document.form_contact.email) == true) {
       alert("Please enter a valid Email address.");
		document.form_contact.email.focus();
       return false;
    };
	
  	if (document.form_contact.security_code.value.length == 0) {
		alert("Please enter the Security Code. ");
		document.form_contact.name.focus();
       return false;
	};

	return true;
}

function show(obj)
{
	hideAll();
	document.getElementById(obj).style.display = 'block';
}
function hideAll(){
	hide('sub1');
	hide('sub2');
}
function hide(obj) {
		
		if (document.getElementById(obj).style.display == 'block') {
			document.getElementById(obj).style.display = 'none';
		}

}

function swapimg_over(pictureName,imageFile)
{
  document.getElementById(pictureName).src = imageFile;
}

function swapimg_out(pictureName,imageFile)
{
  document.getElementById(pictureName).src = imageFile;
}

if (document.images)
{
  pic1= new Image(400,400); 
  pic1.src="images/avail_paintings_namal.jpg";
  
  pic2= new Image(400,400); 
  pic2.src="images/avail_paintings_nafem.jpg"; 
  
  pic3= new Image(400,400); 
  pic3.src="images/avail_paintings_cowboys.jpg"; 
  
  pic4= new Image(400,400); 
  pic4.src="images/avail_paintings_cowgirls.jpg"; 
  
  pic5= new Image(400,400); 
  pic5.src="images/avail_paintings_landscape.jpg"; 
  
  pic6= new Image(400,400); 
  pic6.src="images/avail_paintings_architectural.jpg"; 
  
  pic7= new Image(400,400); 
  pic7.src="images/avail_paintings_other.jpg"; 
  
  pic8= new Image(400,400); 
  pic8.src="images/avail_paintings_all.jpg"; 
}
