<!--
var allPageTags = new Array(); 
var pub_page_no = 1;

function DropClass() {
var allPageTags=document.getElementsByTagName("*");
	for (i=0; i<allPageTags.length; i++) {
		if (allPageTags[i].className=='current') {
			allPageTags[i].className='';
		}
	}
} 

function changeIMG(name, num){
	var url = "/images/style/"+ name + num + ".jpg";
	var ID = "li_" + num;
	
	document.getElementById('large_img').src = url;
	DropClass();
	document.getElementById(ID).className = "current";
}

function ProjDesc(project){
//		document.getElementById('examp_title').innerHTML = project;
     hideRow('example_desc1');
     hideRow('example_desc2');
     hideRow('example_desc3');
     showRow(project);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showRow(name) {
  var obj;
  if ((obj = MM_findObj(name)) != null) {
    obj.style.display = "";
  }
}

function hideRow(name) {
  var obj;
  if ((obj = MM_findObj(name)) != null) {
    obj.style.display = "none";
  }
}

function highlightPage(name) {
  var obj;
  if ((obj = MM_findObj(name)) != null) {
    obj.style.textDecoration  = "underline";
  }
}

function unhighlightPage(name) {
  var obj;
  if ((obj = MM_findObj(name)) != null) {
    obj.style.textDecoration  = "none";
  }
}
function changePage(page_no) {
  if (page_no == '-') {
     page_no = pub_page_no  - 1;
  }
  if (page_no == '+') {
     page_no = pub_page_no  + 1;     
  }
  if (page_no == '--') {
     page_no = 1;
  }
  if (page_no == '++') {
     page_no = 2;     
  }

  if (page_no == '1') {
     hideRow('page_2');
     hideRow('page_3');
     showRow('page_1');
	highlightPage('page_link_1');
	unhighlightPage('page_link_2');
	unhighlightPage('page_link_3');
	pub_page_no = 1;
  }
  if (page_no == '2') {
     
     hideRow('page_1');
     hideRow('page_3');
     showRow('page_2');
	highlightPage('page_link_2');
	unhighlightPage('page_link_1');
	unhighlightPage('page_link_3');
	pub_page_no = 2;
  }
/*  if (page_no == '3') {
     hideRow('page_1');
     hideRow('page_2');
     showRow('page_3');
	highlightPage('page_link_3');
	unhighlightPage('page_link_1');
	unhighlightPage('page_link_2');
	pub_page_no = 3;
  }*/
}

function setMenu(id,c_id){
	if(document.result){
		document.result.id.value = id;
		if(c_id > 0){
			document.result.c_id.value = c_id;
		}
		document.result.submit();
		return false;
	}
	return true;
}

function check_tick_validation(){
	var selLength = sel_cate_ids.length;
	var i;
	var num_ticked = 0;
	for(i=0; i<selLength; i++)
	{
		tmp_name = "cat_" + sel_cate_ids[i];
		//get object
		if ((tmp_obj = MM_findObj(tmp_name)) != null) {
			//get checked = obj.checked
			if(tmp_obj.checked == true){
				num_ticked++;
			}
		}
	}
	return num_ticked;
}


function validateEnquiryForm(type) {
	var err = 0;
	var errors='';
	var email = /^.+\@.+\..+$/;

	if(type == 'c'){
		if (!trim(document.form.name.value)) {
			errors += ' - you must enter your name\n';
			err += 1;
		}
		
		if (!trim(document.form.telephone.value) && !trim(document.form.mobile.value)) {
			err += 1;
			errors += ' - the must enter a contact phone number\n';
		}
	
		if (!trim(document.form.email.value)) {
			errors += ' - you must enter an email address\n';
			err += 1;
			if (document.form.email.value && email.test(document.form.email.value) == false) {
				err += 1;
				errors += ' - the email is in an invalid format\n';
			}
		}

		if (!trim(document.form.notes.value)) {
			errors += ' - you must enter your message\n';
			err += 1;
		}	
	}else{

		if (!trim(document.form.name.value)) {
			errors += ' - you must enter your name\n';
			err += 1;
		}
	
	
		if (!trim(document.form.company.value)) {
			errors += ' - you must enter your company name\n';
			err += 1;
		}
	
		if (!trim(document.form.address.value)) {
			errors += ' - you must enter your address\n';
			err += 1;
		}
	
		if (!trim(document.form.telephone.value) && !trim(document.form.mobile.value)) {
			err += 1;
			errors += ' - the must enter a contact phone number\n';
		}
	
		if (!trim(document.form.email.value)) {
			errors += ' - you must enter an email address\n';
			err += 1;
			if (document.form.email.value && email.test(document.form.email.value) == false) {
				err += 1;
				errors += ' - the email is in an invalid format\n';
			}
		}
	
		if (check_tick_validation() < 1) {
			err += 1;
			errors += ' - you must select at least one service.\n';
		}
	}
//        if (check_tick_validation() > 2) {
//                err += 1;
//                errors += ' - you can only select a maximum of two categories to enter.\n';
//        }

	if (err > 0) {
		alert('The following error(s) occurred:\n'+errors);
	}

	return (err == 0);
}

function submitEnquiryForm(type){
	if (validateEnquiryForm(type)) {
		document.form.submit();
	}
	return false;
}

function checkContent(c){
	
	if(c == 't'){
		if (document.form.notes.value == 'Enter your message here'){
			document.form.notes.value = '';
		}
	}else{
		if (!trim(document.form.notes.value)){
			document.form.notes.value = 'Enter your message here';
		}
	}
}


//-->