// JavaScript Document
var current = 1;

function changeClass(Elem, myClass) {
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	elem.className = myClass;
}
function next(){
	if(current<18){nextpic=current+1;}
	else {nextpic=1;}
	setpic(nextpic);
}
function previous(){
	if(current>1){nextpic=current-1;}
	else {nextpic=18;}
	setpic(nextpic);
}
function setpic(id){
	var preview;
	if(document.getElementById) {
		var preview = document.getElementById('preview');
	} else if (document.all){
		var preview = document.all['preview'];
	}
	preview.src='im/gallery/gallery-'+id+'.jpg';

	var old;
	if(document.getElementById) {
		var old = document.getElementById('t'+current);
	} else if (document.all){
		var old = document.all['t'+current];
	}
	old.src='im/gallery/up'+current+'.jpg';
	
	current=id;
	var thumb;
	if(document.getElementById) {
		var thumb = document.getElementById('t'+current);
	} else if (document.all){
		var thumb = document.all['t'+current];
	}
	thumb.src='im/gallery/over'+current+'.jpg';

}
function initialise(){
	setpic(current);
}

function P7_colH2(){ //v2.1.0 by PVII-www.projectseven.com
 var i,oh,h=0,tg,el,np,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
 for(i=1;i<dA.length;i+=2){dA[i+1].style.paddingBottom='';}for(i=1;i<dA.length;i+=2){
 oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=1;i<dA.length;i+=2){oh=dA[i].offsetHeight;
 if(oh<h){np=h-oh;if(!an&&dA[0]==1){P7_eqA2(dA[i+1].id,0,np);}else{
 dA[i+1].style.paddingBottom=np+"px";}}}document.p7eqa=1;
 document.p7eqth=document.body.offsetHeight;
 document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT2(){ //v2.1.0 by PVII-www.projectseven.com
 if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){P7_colH2();}
}
function P7_equalCols2(){ //v2.1.0 by PVII-www.projectseven.com
 var c,e,el;if(document.getElementById){document.p7eqc=new Array();
 document.p7eqc[0]=arguments[0];for(i=1;i<arguments.length;i+=2){el=null;
 c=document.getElementById(arguments[i]);if(c){e=c.getElementsByTagName(arguments[i+1]);
 if(e){el=e[e.length-1];if(!el.id){el.id="p7eq"+i;}}}if(c&&el){
 document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el}}
 setInterval("P7_eqT2()",10);}
}
function P7_eqA2(el,p,pt){ //v2.1.0 by PVII-www.projectseven.com
 var sp=10,inc=20,g=document.getElementById(el);np=(p>=pt)?pt:p;
 g.style.paddingBottom=np+"px";if(np<pt){np+=inc;
 setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);}
}
function validatebrochure(theform) {
	answer = '';

    if (theform.firstname.value=='') { answer = answer + '- First Name\n'; }
    if (theform.lastname.value=='') { answer = answer + '- Last Name\n'; }
    if (theform.address1.value=='') { answer = answer + '- Address\n'; }
    if (theform.town.value=='') { answer = answer + '- City/Town\n'; }
    if (theform.county.value=='') { answer = answer + '- County/State/Province\n'; }
    if (theform.postcode.value=='') { answer = answer + '- Postal Code/Zip Code\n'; }
    if (theform.country.value=='') { answer = answer + '- Country\n'; }

	if (answer!='') {
		answer = 'The following fields are required:\n\n' + answer;
		answer = answer + '\nPlease check and resubmit'  ;
		
		alert(answer);
		return false;
	}
	return true;


}

