function checkForm()
{
	contactform=document.contactForm;
	at=contactform.email.value.indexOf("@")
	dots = contactform.email.value.indexOf(".")
	if (at == -1 || dots<1){
		alert("Please enter a valid E-mail Address")
		return false
		}
	if (contactform.contactName.value <=0){
		alert("please enter your name " );
		return false
		}	
	if (contactform.enquiry.value.length<1){
		alert("Have you entered a message?" );
		return false
		}	
}

function checksignupForm()
{
	signupform=document.signupForm;
	at=signupform.userEmail.value.indexOf("@")
	dots = signupform.userEmail.value.indexOf(".")
	if (at == -1 || dots<1){
		alert("Please enter a valid E-mail Address")
		return false
		}
	if (signupform.userName.value <=0){
		alert("please enter your name " );
		return false
		}	
if (signupform.userName.value =="Your Name"){
		alert("please enter your name " );
		return false
		}		
}



function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function pageInit(){
if(typeof current_images!='undefined'){
	if(current_images.length>1){
	doGallery();
	}else if(current_images.length ==1){
	doImage()
	}
	}
}

////////////////////////////////////////////
//     Image functions                 ////
////////////////////////////////////////////

function doGallery(){// this code makes the gallery thumbs
if (typeof gal == 'undefined'){showImage(0)}// show the first image if the page has just loaded
	gal='<div id="thumblock">';
	  for(i=0;i<current_images.length;i++){
		var imgname =imgfolder + current_images[i].path + '/thumbs/thum_'+ current_images[i].file;
		//file,path,credits,comment
		var title = current_images[i].title; 
		gal+='<div class="thumb floatleft"><a href="javascript:showImage('+i+')"><img src="'+ imgname +'" alt="'+ current_images[i].comment+'" border="0"></a></div>'
	}	
gal+=('<div class="clearall"><br></div></div>');
update('thumbs',gal);
}

function doImage(){ /* a single image */
var imgname =imgfolder+ current_images[0].path +'/'+ current_images[0].file;
var bigimage = imgfolder+ current_images[0].path +'/full/full_'+ current_images[0].file;

	if (typeof current_images[0].credits !='undefined' && current_images[0].credits !=''){
		var credit = ' ('+current_images[0].credits +')';
	}else{credit=''} 
if (typeof current_images[0].caption !='undefined'){
	var caption = current_images[0].caption;
	}else{caption=''} 

var data='<div align="center"><a href="'+bigimage+'" target="_blank"><img src="'+imgname+'" id="currentimage" alt="'+caption+'"></a></div>';
	data +='<p class="img_caption">'+caption+'</p>';
update('bigImage',data);
}

/************  show the chosen picture  ***********/
function showImage(imgval){
	arraypos=imgval;
	//alert (imgval);
	if (arraypos <0){arraypos= current_images.length-1};
	if (arraypos ==current_images.length){
	arraypos=0};

	if (typeof current_images[imgval].comment !='undefined'){
	var comment = current_images[imgval].comment;
	}else{comment=''} 

	var imgname =imgfolder+ current_images[arraypos].path +'/'+ current_images[arraypos].file;
	var bigimage = imgfolder+ current_images[arraypos].path +'/full/full_'+ current_images[arraypos].file;
	var title = current_images[arraypos].title;

	var data = '<div align="center" id="showImageText">';
	data += '<a href="javascript:showImage(arraypos-1);">Previous</a>';
	data +=' | '+(arraypos +1) + ' of '+ current_images.length + ' | ';
	data += '<a href="javascript:showImage(arraypos+1);">Next</a><br></div>';
	data += '<a href="'+bigimage+'" target="_blank"><img src="'+imgname+'" id="currentimage" alt="'+comment+'"></a><p class="img_caption">'+comment+'</p>';

	update('bigImage',data);
}

/* ########   update the chosen area - a useful multi-purpose function #######  */

function update(target,data) { 
var ie4=Boolean(document.all && !document.getElementById);
var target=(ie4)?document.all[target]:document.getElementById(target);
target.innerHTML=data;
}