

function checkEmail(el) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(el.value)){
return (true)
}
alert("Plese input a valid e-mail address!")
return (false)
}


function newWindow1(url,iHeight,iWidth)
{
	var params;
	var agent = navigator.userAgent;
	var windowName = "PicWindow";

	params = "";
	params += "height="+iHeight+","
	params += "width="+iWidth+","
	params += "left=50,"
	params += "top=50,"
	params += "alwaysRaised=0,"
	params += "directories=0,"
	params += "fullscreen=0,"
	params += "location=0,"
	params += "menubar=b,"
	params += "resizable=1,"
	params += "scrollbars=1,"
	params += "status=0,"
	params += "toolbar=0"

	var win = window.open(url,windowName,params);

	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1)
	{
		win = window.open(url, windowName , params);
	}

	if (!win.opener)
	{
		win.opener = window;
	}
}

function newWindow(url)
{
	var params;
	var agent = navigator.userAgent;
	var windowName = "PicWindow";

	params = "";
	params += "height=556,"
	params += "width=553,"
	params += "alwaysRaised=0,"
	params += "directories=0,"
	params += "fullscreen=0,"
	params += "location=0,"
	params += "menubar=b,"
	params += "resizable=1,"
	params += "scrollbars=1,"
	params += "status=0,"
	params += "toolbar=0"

	var win = window.open(url,windowName,params);

	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1)
	{
		win = window.open(url, windowName , params);
	}

	if (!win.opener)
	{
		win.opener = window;
	}
}



function newPicWindow(url)
{
	var params;
	var agent = navigator.userAgent;
	var windowName = "PicWindow";

	params = "";
	params += "height=500,"
	params += "width=400,"
	params += "left=50,"
	params += "top=50,"
	params += "alwaysRaised=0,"
	params += "directories=0,"
	params += "fullscreen=0,"
	params += "location=0,"
	params += "menubar=b,"
	params += "resizable=1,"
	params += "scrollbars=1,"
	params += "status=0,"
	params += "toolbar=0"

	var win = window.open(url,windowName,params);

	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1)
	{
		win = window.open(url, windowName , params);
	}

	if (!win.opener)
	{
		win.opener = window;
	}
}





function validate_email(el) {
    if(-1 == el.value.indexOf("@")) {
       el.focus();
       alert("Your email must have a '@'.");
       return false;
       }
    if(-1 != el.value.indexOf(",")) {
       el.focus();
       alert("Your email must not have a ',' in it");
       return false;
       }
    if(-1 != el.value.indexOf("#")) {
       el.focus();
       alert("Your email must not have an '#' in it." );
       return false;
       }
    if(-1 != el.value.indexOf("!")) {
       el.focus();
       alert("Your email must not have a '!' in it." );
       return false;
       }
    if(-1 != el.value.indexOf(" ")) {
       el.focus();
       alert("Your email must not have a space in it." );
       return false;
       }
    if(el.value.length == (el.value.indexOf("@")+1) ) {
       el.focus();
       alert("Your email must have a domain name after the '@'.");
       return false;
       }

    if(el.value.length == 0) {
      el.focus();
      alert("Please enter your email.");
      return false;
      }

    return true;
  }
  
  
  function validate_radio(el, fieldName,description) {
  	var msg;
  	var verifyOK = false;
  
  	for(var i = 0 ; i < el.length ; ++i) {
  		if( el[i].type == "radio" && el[i].name == fieldName) {
  			var radiogroup = el[el[i].name]; // get the whole set of radio buttons.
  			if (radiogroup[0]) {
  				for(var j = 0 ; j < radiogroup.length ; ++j) {
  					if(radiogroup[j].checked) {
  						verifyOK = true;
  						break;
  					}
  				 }
  			}else{
  				if (radiogroup.checked) {
  					verifyOK = true;
  				}
  			}
  		}
  	}
  
  	if (verifyOK == false) {
  		msg =  description;
  		alert(msg);
  		return false;
  	}
  	return true;
  }


/*
Shake image script (onMouseover)- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

//configure shake degree (where larger # equals greater shake)
var rector=3

///////DONE EDITTING///////////
var stopit=0 
var a=1

function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}

function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}

function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}
