function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}


function chkfeed(){
           var msg="";
           if (document.feed_form.topic.value=="") {
               msg+="Topic\n";
           }
           if (document.feed_form.name.value=="") {
               msg+="Name\n";
           }
           if (document.feed_form.email.value=="") {
                  msg+="Email\n";
           }
           if (document.feed_form.message.value=="") {
                  msg+="Message\n";
           }
           if(msg!="") {
            alert("You have not filled in the following fields:\n"+msg);
            return false;
            }
           if (isEmail(document.feed_form.email.value) == false) {
              alert("Invalid email address!");
              return false;
           }
}


function chkspon(){
           var msg="";
           if (document.sponform.fname.value=="") {
               msg+="First name\n";
           }
           if (document.sponform.lname.value=="") {
               msg+="Last name\n";
           }
           if (document.sponform.email.value=="") {
                  msg+="Email\n";
           }
           if (document.sponform.add1.value=="") {
                  msg+="Address\n";
           }
           if (document.sponform.city.value=="") {
                  msg+="City\n";
           }
           if (document.sponform.zip.value=="") {
                  msg+="Zip\n";
           }
           if (document.sponform.country.value=="") {
                  msg+="Country\n";
           }
           if (document.sponform.phone.value=="") {
                  msg+="Phone\n";
           }
           if(msg!="") {
            alert("You have not filled in the following fields:\n"+msg);
            return false;
           }
           if (isEmail(document.sponform.email.value) == false) {
              alert("Invalid email address!");
              return false;
           }
}


function chkcond(){
           var msg="";
           if (document.condform.fname.value=="") {
               msg+="First Name\n";
           }
           if (document.condform.lname.value=="") {
               msg+="Last Name\n";
           }
           if (document.condform.country.value=="") {
               msg+="Country\n";
           }
           if (document.condform.email.value=="") {
               msg+="Email\n";
           }
           if (document.condform.msg.value=="") {
               msg+="Message\n";
           }
           if(msg!="") {
            alert("Please fill in the following fields:\n"+msg);
            return false;
           }
           if (isEmail(document.condform.email.value) == false) {
              alert("Invalid email address!");
              return false;
           }
}




function chkcontrib(){
           var msg="";
           if (document.contform.fname.value=="") {
               msg+="First Name\n";
           }
           if (document.contform.lname.value=="") {
               msg+="Last Name\n";
           }
           if (document.contform.country.value=="") {
               msg+="Country\n";
           }
           if (document.contform.email.value=="") {
               msg+="Email\n";
           }
           if(msg!="") {
            alert("Please fill in the following fields:\n"+msg);
            return false;
           }
           if (isEmail(document.contform.email.value) == false) {
              alert("Invalid email address!");
              return false;
           }
}


function pageshift(page, total){
	for(i=1;i<=total;i++){
	    document.getElementById('list_page_' + i).style.display='none';	
	}
	document.getElementById('list_page_'+page).style.display='block';
}


function photoshift(spot, total){
	for(i=1;i<=total;i++){
	    document.getElementById('imageBox_' + i).className='imageBox';	
	    document.getElementById('photocaption_' + i).className='captionbox';	
	    document.getElementById('box_' + i).className='boxlist';	
	}
	document.getElementById('imageBox_' + spot).className='imageBox_on';
	document.getElementById('photocaption_' + spot).className = 'captionbox_on';
	document.getElementById('box_' + spot).className='boxlist_on';
}





