        var base = "gecko.org.au";

        var cleanupAlias = "cleanup";
        cleanupAlias = cleanupAlias + "@" + base;

        var awardsAlias = "awards";
        awardsAlias = awardsAlias + "@" + base;

        var bookkeeperAlias = "bookkeeper";
        bookkeeperAlias = bookkeeperAlias + "@" + base;

        var campaignsAlias = "campaigns";
        campaignsAlias = campaignsAlias + "@" + base;

        var educatorsAlias = "educators";
        educatorsAlias = educatorsAlias + "@" + base;

        var fundraiserAlias = "fundraiser";
        fundraiserAlias = fundraiserAlias + "@" + base;

        var grantcoordAlias = "grantcoord";
        grantcoordAlias = grantcoordAlias + "@" + base;
        
        var infoAlias = "info";
        infoAlias = infoAlias + "@" + base;        

        var libraryAlias = "library";
        libraryAlias = libraryAlias + "@" + base;

        var managerAlias = "manager";
        managerAlias = managerAlias + "@" + base;

        var membershipAlias = "membership";
        membershipAlias = membershipAlias + "@" + base;

        var newsletterAlias = "newsletter";
        newsletterAlias = newsletterAlias + "@" + base;

        var officeAlias = "office";
        officeAlias = officeAlias + "@" + base;

        var presidentAlias = "president";
        presidentAlias = presidentAlias + "@" + base;

        var receptionAlias = "reception";
        receptionAlias = receptionAlias + "@" + base;

        var regenAlias = "geckoregen.org.au";
        regenAlias = "admin" + "@" + regenAlias;

        var secretaryAlias = "secretary";
        secretaryAlias = secretaryAlias + "@" + base;

        var speakersAlias = "speakers";
        speakersAlias = speakersAlias + "@" + base;

        var treasurerAlias = "treasurer";
        treasurerAlias = treasurerAlias + "@" + base;

        var vicepresAlias = "vicepres";
        vicepresAlias = vicepresAlias + "@" + base;

        var volcoordAlias = "volcoord";
        volcoordAlias = volcoordAlias + "@" + base;

        var websiteAlias = "website";
        websiteAlias = websiteAlias + "@" + base;

        var youthAlias = "youth";
        youthAlias = youthAlias + "@" + base;

        var greendayoutAlias = "greendayout";
        greendayoutAlias = greendayoutAlias + "@" + base;
		
		
        var eventsAlias = "events";
        eventsAlias = eventsAlias + "@" + base;
		
		
        var mediaAlias = "media";
        mediaAlias = mediaAlias + "@" + base;
		
		var ecoexplorersAlias = "eco-explorers";
        ecoexplorersAlias = ecoexplorersAlias + "@" + base;

//-------------------------------------------------------------------------------

function validateFields(thisOption,thisValue) {
    if (thisOption == "userName") {    //check name
        if (thisValue == null || thisValue == "" || thisValue.length == 0) {   
        return false;
        }
    }
    if (thisOption == "userEmail") {    //check email
        if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(thisValue)) {  
        return false;
        }
    } 
    if (thisOption == "userMessage") {  //check message
        if (thisValue == null || thisValue == "" || thisValue.length == 0) {   
        return false;
        }
    } 
    if (thisOption == "userUnsub") {    //check unsub email
        if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(thisValue)) {  
        return false;
        }
    }     
}

function validateForm() {
    var isRequired = document.getElementById('validateRequired');

    if (isRequired != null) {
        var checkField = new(Array);   //field name array
        var reqField   = new(Array);   //field object array
        var trimValue  = new(Array);   //trimmed value array
        checkField = isRequired.value.split(",");

        var i = 0;
        for (i = 0; i <= checkField.length; i++) {
            if (checkField[i] == "userName") {
                reqField[i]  = document.getElementById("userName");             //load object
                trimValue[i] = reqField[i].value.replace(/^\s+|\s+$/g, '') ;    //trim value
                document.forms[0].userName.value = trimValue[i];                //update form
                if (validateFields(reqField[i].name,trimValue[i]) == false) {   //validate
                    alert("Please enter your name...         ");                //show error
                    reqField[i].focus();                                        //form focus
                    return false;
                }
            }
            if (checkField[i] == "userEmail") {
                reqField[i]  = document.getElementById("userEmail");
                trimValue[i] = reqField[i].value.replace(/^\s+|\s+$/g, '') ; 
                document.forms[0].userEmail.value = trimValue[i];
                if (validateFields(reqField[i].name,trimValue[i]) == false) {
                    alert("Please enter a valid email...         ");
                    reqField[i].focus();    
                    return false;
                }
            }
            if (checkField[i] == "userMessage") {
                reqField[i]  = document.getElementById("userMessage");
                trimValue[i] = reqField[i].value.replace(/^\s+|\s+$/g, '') ; 
                document.forms[0].userMessage.value = trimValue[i];
                if (validateFields(reqField[i].name,trimValue[i]) == false) {
                    alert("Please enter your message...         ");
                    reqField[i].focus();    
                    return false;
                }
            }
            if (checkField[i] == "userUnsub") {
                //this routine uses two forms 
                //a value from one form is passed to the other
                //...document.forms[1].unsubEmail.value
                reqField[i]  = document.getElementById("unsubEmail");
		trimValue[i] = reqField[i].value.replace(/^\s+|\s+$/g, '');                
                document.forms[0].userUnsub.value = trimValue[i];
                if ((validateFields(reqField[i].name,trimValue[i]) == false) || (trimValue[i] == "undefined")) {
                    alert(" An error has occured on the server, and   \n  we could not detect your email address.");  
                    return false;
                    break;
                } 
            }            
        }
        document.forms[0].submit();  //validation OK,... submit form
    }
    else {
        document.forms[0].submit();  //validation not required,... submit form
    }
}

//-------------------------------------------------------------------------------------

function popMeUp(theURL, winName, winWidth, winHeight) {
    var w = winWidth;
    var h = winHeight;
    var features = "width=" + w + ",";
    features += "height=" + h + ",";
    features += "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
    newWindow = window.open(theURL, winName, features);
    newWindow.focus()
}

function viewCart() {
    //add paypal cart form to the page
    var cartForm;  //
    cartForm = document.createElement("form");
    cartForm.setAttribute("id", "view_cart")
    cartForm.action = "https://www.paypal.com/cgi-bin/webscr";
    cartForm.target = "paypal";
    cartForm.method = "post";
    document.body.appendChild(cartForm);

    //add paypal elements to the form
    var cartElem1;  //
    cartElem1 = document.createElement("input");
    cartElem1.setAttribute("type", "hidden");
    cartElem1.setAttribute("name", "cmd");
    cartElem1.setAttribute("value", "_cart");
    cartForm.appendChild(cartElem1);

    var cartElem2;  //
    cartElem2 = document.createElement("input");
    cartElem2.setAttribute("type", "hidden");
    cartElem2.setAttribute("name", "business");
    cartElem2.setAttribute("value", "manager@gecko.org.au");
    cartForm.appendChild(cartElem2);

    var cartElem3;  //
    cartElem3 = document.createElement("input");
    cartElem3.setAttribute("type", "hidden");
    cartElem3.setAttribute("name", "display");
    cartElem3.setAttribute("value", "1");
    cartForm.appendChild(cartElem3);

    var cartElem4;
    cartElem4 = document.createElement("input");
    cartElem4.setAttribute("type", "hidden");
    cartElem4.setAttribute("name", "page_style");
    cartElem4.setAttribute("value", "Gecko1");
    cartForm.appendChild(cartElem4);

    cartForm.submit();
    return true;
}

function validateShop(formID, isRequired) {

    var QntyID;                //the quantity id to validate
    var iQnty;                   //the quantity value
    QntyID = "qnty-" + formID; //construct field ID using formID
    iQnty = document.getElementById("" + QntyID + "").value.replace(/^\s+|\s+$/g, '');  //get trimmed value

    if (isNaN(iQnty * 1)) {   //check if it's a number
        document.getElementById("" + QntyID + "").value = 1;    
        document.getElementById("" + QntyID + "").focus();
        alert("Please enter a quantity between 1 and 100")
        return false;
    }
    else {
        if (((iQnty * 1) <= 0) || ((iQnty * 1) >= 101)) {   //check if it's out of range
            document.getElementById("" + QntyID + "").value = 1;
            document.getElementById("" + QntyID + "").focus();
            alert("Please enter a quantity between 1 and 100... ")
            return false;
        }
        else {    //number is good, continue
            document.getElementById("" + QntyID + "").value = Math.floor(iQnty);  //strip out decimals
            //alert("OK = " + Math.floor(iQnty));
            //return false;

            var thisForm;  //complete form properties
            thisForm = document.getElementById("" + formID + "");
            thisForm.action = "https://www.paypal.com/cgi-bin/webscr";
            thisForm.target = "paypal";
            thisForm.method = "post";           

            if (isRequired == true) {         //check if form needs selection validation

                var OptionID;                 //the id to validate         
                var selectIndex;              //the selectedIndex
                var selectChoice;             //the selection

                //check for a selection
                OptionID = "os0-" + formID; //construct field ID using formID
                selectIndex = document.getElementById("" + OptionID + "").selectedIndex;
                selectChoice = document.getElementById("" + OptionID + "").options[selectIndex].value;

                if (selectChoice == "0") {  //no selection made, show alert
                    alert("Please choose a size... ");
                    return false;
                }
                else {  //selection OK, submit form
                    thisForm.submit();
                    return true;
                }
            }
            else {  //validation not required, submit form
                thisForm.submit();
                return true;
            }
                                 
        }
    } 

    //------------------------------------------------------

}



//-------------------------------------------------------------------------------------

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];}
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value) thefield.value = "";
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function int_only(value) {
	value = parseInt(value);
	if(value<0) value = value * -1;
	return (value) ? value+"" : "";
}

function BookMark_Page() {
	if(document.all) {
		window.external.AddFavorite(this.location,document.title);
	} else {
		alert("To bookmark page use (Ctrl+D)");
	}
}

/*
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var ns6=document.getElementById&&!document.all;
var ns4=document.layers;
*/
var ie4 = document.all ? 1 : 0;
var ns4 = document.layers ? 1 : 0;
var ns6 = window.netscape ? 1 : 0;

//alert("ie4: "+ie4+"\nns4: "+ns4+"\nns6: "+ns6);

function addText(id,text) {
	
	menuobj = (ie4) ? document.all[id] : (ns6 ? document.getElementById(id) : (ns4 ? document.layers[id] : ''));
	
	if(ie4 || ns6) {
		menuobj.innerHTML=text;
	} else {
		menuobj.document.open();
		menuobj.document.write(text);
		menuobj.document.close();
	}	
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
