function OpenWin(theURL,winName,features) {
win = window.open(theURL,winName,features);
if(win!=null)win.focus();	
}

function ValEmail(email) {
var emailPat=/^(.+)@(.+\..+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";

var atom = validChars + '+';
var word = "(" + atom + ")";

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

var matchArray=email.match(emailPat);
if (matchArray==null) {
    return false;
}

var user=matchArray[1];
var domain=matchArray[2];
if (!userPat.test(user) || !domainPat.test(domain)) {
    return false;
}
return true;
}

String.prototype.trim = function() { return this.replace(/^[\s\n]+|[\s\n]+$/, ''); };

function trim(str)
{
   while(str.charAt(text.length-1) == " " || (str.charAt(text.length-1)=="\r"))
    {    	
        str = str.substring(0, str.length-1);              
    }
    while(str.charAt(0)==" " || (str.charAt(text.length-1)=="\r"))
    {
        str = str.substring(1);
    }
    return str;
}

function init(){
try{
if(document.body.addEventListener){
document.body.addEventListener("mouseup",checkfocus, false); 
//document.getElementById("focusme").focus();
}
}
catch(e){}
//if netscape 6.* cart top + 2
var name = navigator.userAgent.toLowerCase()
var netscape = (name.indexOf("mozilla") >=-1 && name.indexOf("msie")==-1 && name.indexOf("opera") == -1)
if (netscape && name.indexOf("6.")>-1){
document.getElementById("cart").style.bottom="2px";
document.getElementById("uppercontent").style.bottom="36px";
}
}

function checkfocus(e){	
var temp=e.target;
var found=false;
if(e.target.tagName.toUpperCase()!="SELECT" && e.target.tagName.toUpperCase()!="INPUT" && e.target.tagName.toUpperCase()!="TEXTAREA"){
//document.getElementById("focusme").focus();
}
}

function PrintPage() {
if (window.print) window.print();
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}