/*
	// $RCSfile: template.js,v $
	// $Source: /cvs/cyplonweb-live/includes/template.js,v $, $Revision: 1.1 $, $Date: 2010/07/12 10:32:37 $, $State: Exp $ 
*/

function PopupPic(sPicURL) {
 window.open( ""+sPicURL, "",  "scrollbar=no,menubar=no,resizable=1,WIDTH=640,HEIGHT=480");
}

/**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;
}**/

var win= null; 
function newwindow(mypage,myname,w,h,scroll){ 
	var winl = 0;
	var wint = 0;
	winl = (screen.width-w)/2;
	if (navigator.userAgent.indexOf("Opera")==-1){  //Opera needs to be zero as it keeps popups within the browser content area
		wint = (screen.height-h)/2;
	}
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no' 
	win=window.open(mypage,myname,settings) 
	if(parseInt(navigator.appVersion) >= 4){
		win.window.focus();
	}
}

function checkNews() {
    var message = "";

    var firstname = document.getElementById('nfirstname').value;
    var surname = document.getElementById('nsurname').value;
    var email = document.getElementById('nemail').value;
    var offers = document.getElementById('noffer').checked;
    var newsletter = document.getElementById('nnewsletter').checked;

    if ((firstname == "") || (surname == "")) {
        message = "You must enter your full name";
    } else if (email == "") {
        message = "You must enter your email address";
    } else if ((offers == false ) && (newsletter == false)) {
        message = "You must tick the items you wish to receive";
    }

    if (message != "") {
        alert(message);
        return false;
    }
}

/* ENDS */