			/*****************************
			**  MODIFY FOR EACH ISSUE
			******************************/
			var currVol = "33";
			var currIss = "5";
			var currPubDate = "Sept.-Oct. 2007"; 
			var build = "01";
			/*****************************
			**  END MODIFICATIONS
			******************************/



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_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_findObj(n, d) { //v3.0
  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); 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];}
}

function init_StartPage() { // make sure login page is in page _top
	
	// make sure we don't re-log them out if their session times out
	
	if (window.top != window.self) {
		if (parent.winDestroyed) parent.winDestroyed = false;
		
		window.top.document.location = window.self.document.URL
	}

}

// close the data window if they logged out and left it open

function cleanupWindows() {
 /*
  cleanupWindows is called on onUnload and onBeforeUnload. Some popup blockers 
  disabled the onUnload event and hence onBeforeUnload event is implemented. 
  If there are no popup blockers, then we do not want the logout to be called
  twice and hence the use of window.logoutIssued flag.
 */
 if(!window.logoutIssued) {
   window.logoutIssued = true;
   asynchronousLogout();
 }
 

/***

	if (top.basefrm.dataWin != null) {
		top.basefrm.dataWin.close()
	}
	if (top.header.helpWin != null) {
		top.header.helpWin.close()
	}
***/	
}

function asynchronousLogout() {
  var xmlHttpReq = false;
  var self = this;	
  if (window.XMLHttpRequest) { // Mozilla/Safari/IE7/Netscape 7+
    self.xmlHttpReq = new XMLHttpRequest();
  } else if (window.ActiveXObject) { // IE6
    self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
  }
  self.xmlHttpReq.open('POST', "/online/justlogout", true);
  self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  self.xmlHttpReq.onreadystatechange = function() {
    if (self.xmlHttpReq.readyState == 4) {
      // Do processing on response here
      window.logoutIssued = false;
    }
  }
  self.xmlHttpReq.send(null);
}

function getTrimmedNewDateStr() {
	var date = new Date();
	//if Internet Explorer then do date replace, else if netscape do getTime()
	if(MTMUA.browserType == "IE") {
		date=Trim(date);
    	date=date.replace(/ /g, "");
    } 
    else {
    	date = date.getTime();
    }
    
    return date;
}

// Javascript functions for triming
function LTrim(ValueToTrim)
{
	ValueToTrim = ValueToTrim.toString()
	var WhiteSpace=new String(" \t\r\n");
	var i=0;
	if (ValueToTrim.length > 0) {
		while(WhiteSpace.indexOf(ValueToTrim.charAt(i)) > -1 && i < ValueToTrim.length)
		{
		  i++;
		}
		return ValueToTrim.substring(i);
	} else {
		return "";
	}

}

function RTrim(ValueToTrim)
{
	ValueToTrim = ValueToTrim.toString()
	var WhiteSpace=new String(" \t\r\n");
	var i=ValueToTrim.length-1;
	if (ValueToTrim.length > 0) {
    while(WhiteSpace.indexOf(ValueToTrim.charAt(i)) > -1 && i > -1)
		{
		  i--;
		}
		return ValueToTrim.substring(0,i+1);
	} else {
		return "";
	}
}

function Trim(ValueToTrim)
{
	return  LTrim(RTrim(ValueToTrim))
}


// Register Form Validation

function unescapeValues(theForm) {

	theForm.u.value = unescape(theForm.u.value);
	theForm.p1.value = unescape(theForm.p1.value);
	theForm.p2.value = unescape(theForm.p2.value);
	theForm.f.value = unescape(theForm.f.value);
	theForm.l.value = unescape(theForm.l.value);
	theForm.s1.value = unescape(theForm.s1.value);
	theForm.s2.value = unescape(theForm.s2.value);
	theForm.c.value = unescape(theForm.c.value);
	theForm.s.value = unescape(theForm.s.value);
	theForm.z.value = unescape(theForm.z.value);
	theForm.ct.value = unescape(theForm.ct.value);
	theForm.cp.value = unescape(theForm.cp.value);
	theForm.jt.value = unescape(theForm.jt.value);

}

function validateForm(theForm) {	

	var reason = "";

	reason += validateEmail(theForm.u);
	reason += validatePassword(theForm.p1);
	reason += validatePassVer(theForm.p2);
	reason += validateFirst(theForm.f);
	reason += validateLast(theForm.l);
	reason += validateAddress(theForm.s1);
	reason += validateAddress(theForm.s2);
	reason += validateCity(theForm.c);
	reason += validateState(theForm.s);
	reason += validateZip(theForm.z);
	reason += validateCountry(theForm.ct);
	reason += validateCompany(theForm.cp);
	reason += validateJobtitle(theForm.jt);	
	
	
	if (reason != "") {
		scroll(0,0);
		alert("Some fields need correction:\n" + reason);
		return false;
	} else {
	
	
		theForm.u.value = escape(theForm.u.value);
		theForm.p1.value = escape(theForm.p1.value);
		theForm.p2.value = escape(theForm.p2.value);
		theForm.f.value = escape(theForm.f.value);
		theForm.l.value = escape(theForm.l.value);
		theForm.s1.value = escape(theForm.s1.value);
		theForm.s2.value = escape(theForm.s2.value);
		theForm.c.value = escape(theForm.c.value);
		theForm.s.value = escape(theForm.s.value);
		theForm.z.value = escape(theForm.z.value);
		theForm.ct.value = escape(theForm.ct.value);	
		theForm.cp.value = escape(theForm.cp.value);
		theForm.jt.value = escape(theForm.jt.value);
		
	}
	
	

	return true;
	
	
	
}
				
				
function validateEmail(fld) {
	
	var error="";
	var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
	var illegalChars= /[\(\)\\,\;\:\\\"\[\]]/ ;
	
	if (fld.value == "") {		
		fld.style.background = 'Yellow';
		error = "You didn't enter an Email Address.\n";
	} else if (!emailFilter.test(fld.value)) {              
		fld.style.background = 'Yellow';
		error = "Please enter a valid email address.\n";
	} else if (fld.value.match(illegalChars)) {
		fld.style.background = 'Yellow';
		error = "The Email Address contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validatePassword(fld) {
	var error = "";
	var illegalChars = /[\W_]/; // allow only letters and numbers 
	
	passwordValue = fld.value;
 
	if (fld.value == "") {
		fld.style.background = 'Yellow';
		error = "You didn't enter a Password.\n";
	} else if ((fld.value.length < 6) || (fld.value.length > 12)) {
		error = "The Password is the wrong length. \n";
		fld.style.background = 'Yellow';
	} else if (illegalChars.test(fld.value)) {
		error = "The Password contains illegal characters.\n";
		fld.style.background = 'Yellow';
	} else {
		fld.style.background = 'White';
	}
   return error;
}  

function validatePassVer(fld) {
	var error = "";
 
	if (fld.value == "") {
		fld.style.background = 'Yellow';
		error = "You didn't Re-enter your Password.\n";
	} else if (fld.value != passwordValue) {
		error = "Your Passwords didn't match. \n";
		fld.style.background = 'Yellow';
	} else {
		fld.style.background = 'White';
	}
   return error;
}

function validateFirst(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a First Name.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The First Name contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}
	
	return error;
}

function validateLast(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a Last Name.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The Last Name contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}

	return error;
}

function validateAddress(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
	//var numberFinder = /[\d_]/; // allow only numbers
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow';
		//error = "You didn't enter an Address.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		error = "The Address contains illegal characters.\n";
		fld.style.background = 'Yellow';
	} else {
		fld.style.background = 'White';
	}

   return error;
}  

function validateCity(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a City.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The City contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}

	return error;
}

function validateState(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a State.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The State contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}

	return error;
}

function validateZip(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a Zip/Postal Code.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The Zip/Postal Code is not valid.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateCountry(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a Country.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The Country contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}

	return error;
}

function validateCompany(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a Company.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The Company Name contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}

	return error;
}

function validateJobtitle(fld) {
	var error = "";
	var illegalChars = /[^A-Za-z0-9.,# -]/; // allow only letters, numbers, #, comma, period, hyphen, space
 
	if (fld.value == "") {
		//fld.style.background = 'Yellow'; 
		//error = "You didn't enter a Job Title.\n";
	} else if ((fld.value != "") && (fld.value.match(illegalChars))) {
		fld.style.background = 'Yellow'; 
		error = "The Job Title contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	}

	return error;
}