function popUp(legalBit){
newWindow=open(legalBit,legalBit,"height=300, width=500");
}

d=document;
function clrF(x){if(d.getElementById(x).value=='Enter your name' | d.getElementById(x).value=='Enter your email address'){d.getElementById(x).value=''}}
function rstF(x){if(d.getElementById(x).value==''){	if(x=='Name'){d.getElementById(x).value='Enter your name'}	else{ if(x=='email'){d.getElementById(x).value='Enter your email address'}}}}
function doS(x){if(d.getElementById(x).value=='Enter your email address' | d.getElementById(x).value=='Enter your email address'){
alert('Please enter your email address so that we can let you know the new site has been launched');
d.getElementById(x).focus();d.getElementById(x).style.backgroundColor='yellow'}else{document.forms[0].submit()}
}

var h="0123456789ABCDEF";
var Fullrgb = "#000000";

function gradient(string, startcolor, endcolor) {
    var len = string.length;
    var color;

    var start_red = startcolor >> 16;
    var start_green = (startcolor & 0x00FF00) >> 8;
    var start_blue = startcolor & 0x0000FF;

    var end_red = endcolor >> 16;
    var end_green= (endcolor & 0x00FF00) >> 8;
    var end_blue = endcolor & 0x0000FF;

    var incRed = Math.floor((end_red - start_red) / len);
    var incGreen = Math.floor((end_green - start_green) / len);
    var incBlue = Math.floor((end_blue - start_blue) / len);


    for (var x=0; x < len; x++) {
        if (start_red + incRed >= 0x00 && start_red + incRed <= 0xFF)
	    start_red += incRed;
        if (start_green + incGreen >= 0x00 && start_green + incGreen <= 0xFF)
	    start_green += incGreen;
        if (start_blue + incBlue >= 0x00 && start_blue + incBlue <= 0xFF)
	    start_blue += incBlue;

        color = hex(merge(start_red, start_green, start_blue));

        color = Fullrgb.substring(0, 6 - color.length + 1) + color;

        document.write("<font color = ", color, ">", string.charAt(x), "</font>");
    }
}

function merge(r, g, b) {
    return (r << 16 | g << 8 | b);
}

function hex(c) {
    var temp = "";
    var hexStr = "";
    var remainder, i;

    for ( ; c != 0; c >>= 4) {
        remainder = c % 16;
        hexStr += h.charAt(remainder);
    }

    for (i=5 ; i >= 0; i--)
        temp += hexStr.charAt(i);

    return temp;
}


function whichFees(){
var currDate=new Date();
var currMonth=currDate.getMonth();
var aMonth=new Array();
aMonth=["January","February","March","April","May","June","July","August","September","October","November","December"];
//currMonth=aMonth[currMonth];
//document.write(currMonth);
var c1="<optgroup label='Single Member Household'>";
var c2="<optgroup label='Multi Member Household'>";
if(currMonth<6){
document.write(c1 + "<option value='Single Membership - Half Year'>Single Member Membership for half year $10 (January 1 to June 30)</option></optgroup>");
document.write(c2+"<option value='Multi Membership - Half Year'>Multi Member Membership for half year $9 per member (January 1 to June 30)</option></optgroup>");
if(currMonth>3){document.write("<optgroup label='Special Note'><option>If you do not have a special requirement for immediate membership, it is recommended </option><option>that you wait until July and take advantage of a full membership.</option>")
}}else{document.write(c1 + "<option value='Single Membership - Full Year'>Single Member Membership for full year $20 (July 1 to June 30)</option></optgroup>");
document.write(c2+"<option value='Multi Membership - Full Year'>Multi Member Membership for full year $18 per member (July 1 to June 30)</option></optgroup>");
}
}

function checkOption(){
var y=document.forms[0];
document.getElementById('err1').style.display='none';
if(y.frmPayment.value=="NoSelect"){
y.frmPayment.style.backgroundColor='yellow';
}else{
y.frmPayment.style.backgroundColor='white';
};
if(y.frmType.value=="NoSelect"){
y.frmType.style.backgroundColor='yellow';
}else{
y.frmType.style.backgroundColor='white';
};
if(y.frmType.value=="NoSelect" || y.frmPayment.value=="NoSelect"){
alert("You must select a valid option in the shaded field at the top of this form.");;document.getElementById('err1').style.display='inline';window.location.href="#top"}
if(y.frmType.value!="NoSelect" && y.frmPayment.value!="NoSelect"){
if(y.Constitution.checked != 1){alert('You MUST acknowledge the Team Adelaide Constitution to submit your application.');document.getElementById('Constitution').style.backgroundColor='yellow';}else{
y.submit();};};
}

function mm(){
var y=document.forms[0];
if(y.frmPayment.value=="Multi Membership - Half Year" || y.frmPayment.value=="Multi Membership - Full Year" ){
document.getElementById('member2').style.display='inline'
showAll();}else {document.getElementById('member2').style.display='none'}}
function hideAll(){
document.getElementById('member2').style.display='none';}
function showAll(){
var y=document.forms[0];
y.m2FirstName.style.display='inline';y.txbFamilyName2.style.display='inline';y.txbDaytime2.style.display='inline';y.txbEvening2.style.display='inline';y.txbMobile2.style.display='inline';y.txbFax2.style.display='inline';y.txbEmailP2.style.display='inline';y.txbEmailS2.style.display='inline';y.other2.style.display='inline';y.m2s1.style.display='inline';y.m2s2.style.display='inline';y.m2s3.style.display='inline';y.m2s4.style.display='inline';y.m2s5.style.display='inline';y.m2s6.style.display='inline';y.m2s7.style.display='inline';y.m2s8.style.display='inline';y.m2s9.style.display='inline';y.m2s10.style.display='inline';y.m2s11.style.display='inline';y.m2s12.style.display='inline';y.m2s13.style.display='inline';y.m2s14.style.display='inline';y.m2s15.style.display='inline';y.m2s16.style.display='inline';y.m2s17.style.display='inline';y.m2s18.style.display='inline';y.m2s19.style.display='inline';y.m2FirstName.disabled=false;y.txbFamilyName2.disabled=false;y.txbDaytime2.disabled=false;y.txbEvening2.disabled=false;y.txbMobile2.disabled=false;y.txbFax2.disabled=false;y.txbEmailP2.disabled=false;y.txbEmailS2.disabled=false;y.other2.disabled=false;y.m2s1.disabled=false;y.m2s2.disabled=false;y.m2s3.disabled=false;y.m2s4.disabled=false;y.m2s5.disabled=false;y.m2s6.disabled=false;y.m2s7.disabled=false;y.m2s8.disabled=false;
y.m2s9.disabled=false;y.m2s10.disabled=false;y.m2s11.disabled=false;y.m2s12.disabled=false;y.m2s13.disabled=false;y.m2s14.disabled=false;y.m2s15.disabled=false;y.m2s16.disabled=false;y.m2s17.disabled=false;y.m2s18.disabled=false;y.m2s19.disabled=false;
}
function clearField(F){
var y=document.forms[0];
var d=F.value;F.value='';
}

function doBase(){
var legal='http://www.teamadelaide.org.au/content/legal.htm';
var checkLegal='legal.htm';
var fullURL=document.location.href;
//alert("Full URL is " + fullURL)
thisURL = fullURL.substring(fullURL.lastIndexOf('/')+1,fullURL.length);
if(thisURL.search('#')!= -1){
thisURL=thisURL.substring(0,thisURL.indexOf('#'))
}
//alert("This URL is " + thisURL)
var aMonth=new Array();
aMonth=["January","February","March","April","May","June","July","August","September","October","November","December"];
var pUpdate=document.lastModified;
pUpdate=new Date(pUpdate);
pUpdate=pUpdate.getDate() + '&nbsp;' + aMonth[pUpdate.getMonth()] + '&nbsp;' + pUpdate.getFullYear();
document.write("<br><div id='base' style='padding-bottom:6;background-color:#FDECDA!important;width:100%'>")
document.write("<div style='padding-bottom:6;background-color:#FDECDA;width:50%;float:left;text-align:left!important;margin-top:0;' id='leftBase' name='leftBase'>&nbsp;");
if(thisURL!=checkLegal){
document.write("<a class='legal' href='"+legal+"#copyright'>Copyright</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
document.write("<a class='legal' href='"+legal+"#privacy'>Privacy</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
document.write("<a class='legal' href='"+legal+"#disclaimer'>Disclaimer</a>&nbsp;&nbsp;|");
//document.write("<div style='text-align:center;margin-top:-16' id='centreBase'><span class='legal'>Page Updated: ");
//document.write("</span></div>");
}
document.write("</div><div  style='padding-bottom:6;background-color:#FDECDA;width:50%;float:right;text-align:right;margin-top:0' id='rightBase' name='rightBase'><span class='legal'>URL for this page is: </span><a class='legal' href='mailto:webmaster@teamadelaide.org.au?");
document.write("subject=Error Report on URL&body=URL: " + fullURL);
document.write("' title='Click here to report any errors you find with this page'>" + thisURL  + "</a><span class='legal' style='cursor:hand;' title='This page was last updated on " + pUpdate+ "'>&nbsp;|&nbsp;" + pUpdate+ "</span>&nbsp;</div></div>");
}




function doClose(){
document.write("<a href='javascript:self.close();'>Click here to close this window</a>");
}	


