<!-- 

$(document).ready(function(){

	var sliderollwidth=400;
	var sliderollheight=140;
	var sliderollspeed=320;
	$(".slideroll").css({"overflow":"hidden","position":"relative"});
	$(".slideroll .normal").css({"position":"absolute"});
	$(".slideroll .rollover").css({"position":"absolute", 'width':sliderollwidth});
	$(".slideroll").css({'width':sliderollwidth});
	$(".slideroll").css({'height':sliderollheight});
	$(".slideroll .rollover").show();
	$(".slideroll .rollover").css({"marginLeft":sliderollwidth});
	$(".slideroll").hover( 
		function(){$(this).children().stop(); $(this).children(".normal").animate({"marginLeft":-sliderollwidth},sliderollspeed); $(this).children(".rollover").animate({"marginLeft":0},sliderollspeed);},
		function(){$(this).children().stop(); $(this).children(".rollover").animate({"marginLeft":sliderollwidth},sliderollspeed); $(this).children(".normal").animate({"marginLeft":0},sliderollspeed);}
	);
});


var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}

function new_win(url,winprops)  {
	mywin=window.open(url,"win",winprops);//mywin.moveTo(0,0);
	mywin.focus();
}


function js_validateform(fm){

	if (fm.formid.value == "processcontact" && fm.formname.value == "contact_form"){

		if ((!emailCheck(fm.email.value)) && fm.tel.value==""){
			alert("Please enter a phone number or a valid email address.");
		}else{
			fm.submit();
		}

	}else if (fm.formid.value == "processcontact" && fm.formname.value == "recruitment_form"){

		if (fm.position.value=="none_selected"){
			alert("Please select a position.");
		}else if (fm.name.value==""){
			alert("Please enter your name.");
		}else if (!emailCheck(fm.email.value)){
			alert("Please enter a valid email address.");
		}else if (fm.tel.value==""){
			alert("Please enter a phone number.");
		}else if (fm.age.value==""){
			alert("Please enter your age.");
		}else if (fm.address.value==""){
			alert("Please enter your address.");
		}else if (fm.experience.value==""){
			alert("Please include your experience.");
		}else{
			fm.submit();
		}
 

	}else if (fm.formid.value == "processcontact" && fm.formname.value == "question_form"){
		
		if (fm.name.value==""){
			alert("Please enter your name.");
		}else if (!emailCheck(fm.email.value)){
			alert("Please enter a valid email address.");
		}else if (fm.question.value==""){
			alert("Please include your question.");
		}else{
			fm.submit();
		}

	}else if (fm.formid.value == "processbasket"){

		if (fm.task.value == "gotocheckout"){
			if (checkradio(fm.delivery)>0){
				return true;
			}else{
				alert ("Please select a delivery method");
				return false;
			}
		}

	}
/*
			alert(document.getElementById('delivery'));
			alert(fm.delivery.selectedIndex.value);
			//alert(document.getElementById('delivery').selectedIndex.value);

	if (document.getElementById('sbp_min').value==''){
		alert ("Please select your minimum price");
	}else if (document.getElementById('sbp_max').value==''){
		alert ("Please select your maximum price");
	}else{
		return true;	
	}	
	return false;

FormRef.comments.focus();*/


}
function checkradio(nm) {
    var c = -1;
    for (var i=nm.length-1; i > -1; i--) {
        if (nm[i].checked) {c = i; i = -1;}
    }
    if (c > -1) return nm[c].value;
    else return null;
}

function js_showemaillinkv1(enco1, enco2, email1, email2, email3, email4){
	emailE = email1 + email2 + '<code class=\"link\">@</code>' + email3 + email4;
	document.write('<a href="mailto:' + enco1 + enco2 + '?subject=website contact">' + emailE + '</a>')
}

function js_togglevisibility(e) {	
	if (document.getElementById(e).style.display=="none"){
		document.getElementById(e).style.display="block";
		document.getElementById('urlbody').focus();/*purely to remove line from around button, focus must be an input form element to work*/
	}else{
		document.getElementById(e).style.display="none";
		document.getElementById('urlbody').focus();
	}
}

function jumptohref(loc){
	window.location.href=loc.value;
}

function emailCheck (emailStr) {
	var checkTLD=1;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);

	if (matchArray==null) {
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			return false;
		}
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			return false;
		}
	}

	if (user.match(userPat)==null) {
		return false;
	}

	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				return false;
			}
		}
		return true;
	}

	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			return false;
		}
	}

	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
		return false;
	}

	if (len<2) {
		return false;
	}

	return true;
}
-->
