// JavaScript Document

function show(id){
document.getElementById(id).style.display="block";
}

function hide(id){
document.getElementById(id).style.display="none";
}

function cleartxt(thetxt) {
        thetxt.value = ""
    		}

function msg() {
	alert ("Your message has been sent to Windcases.\r\nWe will be in touch shortly.")
}

function showhide(id){
  if(document.getElementById(id).style.display=="none")
    document.getElementById(id).style.display="block";
  else
    document.getElementById(id).style.display="none";
}
 
function msgval(no){
var a = 'email' + no;
var b = 'message' + no;

if(document.getElementById(a).value=="" || document.getElementById(a).value=='email address...') {
alert("Please fill in the Email box.");
 	return false;
}

if(document.getElementById(b).value=="" || document.getElementById(b).value=='message...') {
alert("Please fill in the Message box.");
 	return false;
}

else
{
return true;
}
}


function Popup(mypage,myname,w,h,pos,infocus,product,catno,rating,dest){
	var PopupWindow=null;
			if(pos=='center'){
			LeftPosition=(document.documentElement.clientWidth) /2 -200;
			TopPosition=(document.documentElement.clientHeight) /2 -100;
			}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
		PopupWindow=window.open('',myname,settings);
			if(infocus=='front'){PopupWindow.focus();
			}
			if(dest==0) {
			PopupWindow.location='review.php?cat=' + catno + '&rating=' + rating + '&product=' + product;
			}
			else {
			PopupWindow.location='review_add.php?cat=' + catno + '&product=' + product;	
			}
}
