function clearText(thefield){
	if (thefield.defaultValue==thefield.value) { thefield.value = ''; }
}

function form_redirect(thisForm) {
		if(thisForm.issue.selectedIndex == 0 || thisForm.issue.selectedIndex == 1)
			alert('Please select one of the available issues.\n\nThank you.');
		else
			window.location.href=''+thisForm.issue.options[thisForm.issue.selectedIndex].value;
	}

function validate(thisForm) {
		var validRegExp, login, password, confirmpw, firstname, lastname, address, postal, email, errormsg, errormsg2
		validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;

		firstname=thisForm.f_firstname.value;
		lastname=thisForm.f_lastname.value;
		designation=thisForm.f_designation.value;
		organization=thisForm.f_organization.value;
		address=thisForm.f_address.value;
		postalcode=thisForm.f_postalcode.value;
		telephone=thisForm.f_telephone.value;
		fax=thisForm.f_fax.value;
		email=thisForm.f_email.value;

		errormsg = '';

		if (firstname == '') { errormsg += '\n- First Name'; }
		if (lastname == '') { errormsg += '\n- Last Name';	}
		if (designation == '') { errormsg += '\n- Designation'; }
		if (organization == '') { errormsg += '\n- Organization Name'; }
		if (address == '') { errormsg += '\n- Address'; }
		if (postalcode == '') { errormsg += '\n- Postal Code'; }
		if (telephone == '') { errormsg += '\n- Telephone Number'; }
		if (fax == '') { errormsg += '\n- Fax Number'; }
		if (email.search(validRegExp) == -1) { errormsg += '\n- Email Address (invalid)'; }
		if (thisForm.f_privacy.checked) {
			if (errormsg !='') {
				alert('Please check if the following fields are entered correctly: '+errormsg+'\n\nThank you.');
				event.returnValue=false;
			}
		} else {
			if (errormsg !='') {
				alert('Please confirm that you have read and understood our privacy statement,\nand that the following fields are entered correctly:\n'+errormsg+'\n\nThank you.');
				event.returnValue=false;
			} else {
				alert('Please confirm that you have read and understood our privacy statement.\n\nThank you.');
				event.returnValue=false;
			}
		}
	}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// Amazing Frameless Popup Window - Version I
// (C) 2000 www.CodeLifter.com
// Free for all users, but leave in this  header

// set the popup window width and height
var windowW=300 // wide
var windowH=120 // high
// set the screen position to center where the popup should appear
//var windowX = 260 // from left
//var windowY = 100 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);
// set the url of the page to show in the popup
var urlPop = "gotoURL.php"
// set the title of the page
var title =  "Staff Access Only"
// set this to true if the popup should close
// upon leaving the launching page; else, false
var autoclose = true
// ============================
// do not edit below this line
// ============================
s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openFrameless(){
  if (beIE){
    NFW = window.open("","popFrameless",+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset><noframes></noframes>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless",+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }
  NFW.focus()
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
