
var t;


function SelectPic(pic) {
document.getElementById('pic').value = pic;
document.getElementById('picform').submit();
}


function isSafari() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("safari") != -1) {
		return true;
	} else return false;
}

function isOpera() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1) {
		return true;
	} else return false;
}

GetWindowDims(600, 940);

function fsub(frm) {
	document.getElementById(frm).submit();
}

function newImage(arg) {
	if (document.images) {
		var rslt = new Image();
		rslt.src = 'images/'+arg;
		return rslt;
	}
}

function TopbarClick(target, url) {
	target.className = 'topmenubarclicked';
	if (url != '#') t = setTimeout("Click2('"+url+"')", 500);
}

function KeyIssuesSubMenu(i) {
        document.getElementById('kimenu').style.display = (i ? 'block' : 'none');
}

function Click2(url) {
	window.location = url;
	clearTimeout(t);
}

function getValue(id) {var s = document.getElementById(id).value; return s;}

function GetWindowDims(h,w) {
	
 if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  mt = parseInt((myHeight - h) / 2);
  lm = parseInt((myWidth - w) / 2);
}

function d(s) {
	document.write(s);
}

function SetStyle(id,item,value) {
	var target = eval('document.getElementById("'+id+'").style.'+item)
	target = '"'+value+'"';
}

function SetTopLeft(id,t,l) {
	document.getElementById(id).style.top=t+'px';
	document.getElementById(id).style.left=l+'px';
}

function ReSize() {
	var x;
	
	GetWindowDims(600,900);
	document.getElementById('container').style.marginTop=mt+'px';
}


		
function SetSrc(id,pic) {
		document.getElementById(id).src = 'images/'+pic;
}


function Disp(target, truefalse) {
	if (truefalse) {
		//alert(document.getElementById(target).style.top);
		document.getElementById(target).style.display = 'block';
		document.getElementById(target).style.zIndex='10';
	} else {
		document.getElementById(target).style.display = 'none';	
	}
}

function checkform() {
	if (document.getElementById('name').value == '') {
		alert("Please enter your name");return false;
	}
	if (document.getElementById('address').value == '') {
		alert("Please enter your street address");return false;
	}
	if (document.getElementById('town').value == '') {
		alert("Please enter your town/city");return false;
	}
	if (document.getElementById('county').value == '') {
		alert("Please enter your county/state/area");return false;
	}
	if (document.getElementById('postcode').value == '') {
		alert("Please enter your postcode");return false;
	}
	if (document.getElementById('country').value == 'Country...') {
		alert("Please select your country");return false;
	}
	if (document.getElementById('email').value == '') {
		alert("Please enter your email");return false;
	}
	return true;
}