function checkEmail(email) {
 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.toLowerCase())) {
  return true;
 } else {
  return false;
 }
}

function isInt(myNum) {
 // get the modulus: if it's 0, then it's an integer
  var myMod = myNum % 1;
 if (myMod == 0) {
  return true;
 } else {
  return false;
 }
}

function urlEncode(sStr) {
 sStr = escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 return sStr;
}

var show = new Array();
show['projList']=0;

function showMenu(object) {
	show[object]=1;
 document.getElementById(object).style.visibility="visible";
}

function hideMenu(object) {
	if (show[object]==0) {
  document.getElementById(object).style.visibility="hidden";
	}
}

function preHide(object) {
 show[object]=0;
 setTimeout("hideMenu('"+object+"')",1000);
}

function fadeSlide(img_num,project) {
 cOpacity+=10;
 document.getElementById('pic_over').style.opacity=cOpacity/100;
 document.getElementById('pic_over').style.filter="alpha(opacity="+cOpacity+")";
 if (cOpacity>=100) {
  cOpacity=0;
  document.getElementById('pic_under').src='../img/projects/'+project+'-'+img_num+'.jpg';
	 document.getElementById('pic_over').style.opacity=0;
	 document.getElementById('pic_over').style.filter="alpha(opacity=1)";
  for (i=0;i<=9;i++) if (document.getElementById('pn_'+i)) document.getElementById('pn_'+i).className='';
  document.getElementById('pn_'+img_num).className='current';
 } else {
  setTimeout("fadeSlide("+img_num+","+project+")",50);
 }
}
function gotoSlide(project,img_num) {
	cOpacity=0;
 document.getElementById('pic_over').style.opacity=0;
 document.getElementById('pic_over').style.filter="alpha(opacity=1)";
 document.getElementById('pic_over').src='../img/projects/'+project+'-'+img_num+'.jpg';
	fadeSlide(img_num,project);
	return false;
}
