
var restoreimgsrc="";

function MMon(p){
restoreimgsrc = document.images[p].src;
document.images[p].src=restoreimgsrc.substring(0,restoreimgsrc.length-4)+"_on.gif";
}
function MMof(p){
 document.images[p].src=restoreimgsrc;
}

function Pagelocation(page) {
 if (page.indexOf("/")>=0 ) document.location = page;
}

function imgchange(chimg){
  var imgobj = document.images[chimg];
  imgpath = imgobj.src;
  imgpath_base = imgpath.substring(0,imgpath.length-6);

  switch (imgobj.width){
     case 231:   // normal=>lager
       imgobj.width  = 456;
       imgobj.height = 306;
       imgobj.src=imgpath_base + '_1.jpg';
       break;
     case 456:
       imgobj.width  = 231;
       imgobj.height = 156;
       imgobj.src=imgpath_base + '_2.jpg';
       break;
     case 156:  //vertcal=>v.large
       imgobj.width  = 306;
       imgobj.height = 456;
       imgobj.src=imgpath_base + '_1.jpg';
       break;
     case 306:  //vertcal=>v.large
       imgobj.width  = 156;
       imgobj.height = 231;
       imgobj.src=imgpath_base + '_2.jpg';
       break;
  }

}

function galeryimgshow(chimg){
  var imgobj = document.images[chimg];
  imgpath = imgobj.src;
  imgpath_base = imgpath.substring(0,imgpath.length-5);
  //imgwidth  = imgobj.width;
  bgimg.src=imgpath_base + '1.jpg';
}

function showNavLayer(){
document.getElementById("NavLayer").style.visibility="visible";
}

function hideNavLayer(){
document.getElementById("NavLayer").style.visibility="hidden";
}


function ShowMe(el) {
  document.all[el].style.visibility = "visible";
}
function HideMe(el) {
  document.all[el].style.visibility = "hidden";
}


function popup( src) {
 wdparms = 'width=330,height=330,scrollbars=no,resizable=yes,toolbar=no,menubar=no,left=20,top=20';
 window.open( 'popup.php?src='+src,'',  wdparms );
}

function validateFormEmail(msgCorrectEmail){
   //validate email
   email = myform.epasts.value;
   if (!isValidEmail(email)) {
	alert(msgCorrectEmail);
    	myform.epasts.focus();
	return false;
   }
}

function isValidEmail(email){
 var emailRegExp = "[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]{2,4}$";
 var regex = new RegExp(emailRegExp);
 return regex.test(email);
}
