<!-- Begin
var EventDates = new Array();
var MemCnt = new Array();
var Details = new Array();
var BGCol = new Array();
function maxDays(mm, yyyy){
var mDay;
	if((mm == 3) || (mm == 5) || (mm == 8) || (mm == 10)){
		mDay = 30;
  	}
  	else{
  		mDay = 31
  		if(mm == 1){
   			if (yyyy/4 - parseInt(yyyy/4) != 0){
   				mDay = 28
   			}
		   	else{
   				mDay = 29
  			}
		}
  }
return mDay;
}

function changeLoc(id){
        var tname = "";
        var tname=id;
        var iLen = String(tname).length;
       
        if(iLen==3){
          var ii = parseInt(String(tname).substring(2,3));
          }
        else{
          var ii = parseInt(String(tname).substring(2,4));
        }
        if (document.getElementById){
            myDiv = document.getElementById(id);
           }
         else if (document.all) {     // for IE
            myDiv = document.all[id];
           }
         else if (document.layers) {  // for Netscape
            myDiv = document.layers[id];
        }
        var arrN = parseInt(myDiv.innerHTML);
        var tcurrM = parseInt(document.calForm.selMonth.value) ;
        var tYY = document.calForm.selYear.value
        tcurrM = tcurrM + 1
        if ((ii<7)&&(arrN>20)) {
          if (tcurrM!=1){
              tcurrM = tcurrM - 1;
           }
           else{
              var tcurrM = 12 ;
              tYY = tYY - 1;
           }
        }
        if ((ii>27)&&(arrN<20)) {
          if (tcurrM!=12){
              tcurrM = tcurrM + 1;
           }
           else{
              var tcurrM = 0 ;
              tYY = tYY + 1;
           }
        }

        var tDate = myDiv.innerHTML + "/" + tcurrM + "/"+ document.calForm.selYear.value;
        for (var el=0;el<EventDates.length;el++){
	  if (tDate==EventDates[el]){
//             window.location.href="http://www.avawa.com.au/auction_list.php?d="+tDate;
             el=EventDates.length;
          }
        }

}

function showDet(id){
        var tname = "";
        var tname=id;
        var iLen = String(tname).length;
       
        if(iLen==3){
          var ii = parseInt(String(tname).substring(2,3));
          }
        else{
          var ii = parseInt(String(tname).substring(2,4));
        }
        if (document.getElementById){
            myDiv = document.getElementById(id);
           }
         else if (document.all) {     // for IE
            myDiv = document.all[id];
           }
         else if (document.layers) {  // for Netscape
            myDiv = document.layers[id];
        }
        var arrN = parseInt(myDiv.innerHTML);
        var tcurrM = parseInt(document.calForm.selMonth.value) ;
        var tYY = document.calForm.selYear.value
        tcurrM = tcurrM + 1
        if ((ii<7)&&(arrN>20)) {
          if (tcurrM!=1){
              tcurrM = tcurrM - 1;
           }
           else{
              var tcurrM = 12 ;
              tYY = tYY - 1;
           }
        }
        if ((ii>27)&&(arrN<20)) {
          if (tcurrM!=12){
              tcurrM = tcurrM + 1;
           }
           else{
              var tcurrM = 0 ;
              tYY = tYY + 1;
           }
        }

        var tDate = myDiv.innerHTML + "/" + tcurrM + "/"+ tYY;
        for (var el=0;el<EventDates.length;el++){
	  if (tDate==EventDates[el]){
             var s = Details[el];
             while (s.indexOf("&lt;br /&gt;") > -1)
                s = s.replace("&lt;br /&gt;","\n");
    	     overlib(s, CAPTION, 'Event Details for ' + tDate);
             el=EventDates.length;
          }
        }
}


function writeCalendar(){
var now = new Date
//now.setFullYear(2008,0,1)
var dd = now.getDate()
var mm = now.getMonth()
var dow = now.getDay()
var yyyy = now.getFullYear()
var arrM = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var arrY = new Array()
	for (ii=0;ii<=2;ii++){
		arrY[ii] = yyyy + ii
	}
var arrD = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")

var text = ""
text = "<form name=calForm>"
text += "<table border=1>"
text += "<tr><td>"
text += "<table width=100%><tr>"
text += "<td align=left>"
text += "<select name=selMonth onChange='changeCal()' class='bodycopy' onFocus=\"style.backgroundColor='#B5E9FF'\" onBlur=\"style.backgroundColor='white'\">"
	for (ii=0;ii<=11;ii++){
		if (ii==mm){
			text += "<option value= " + ii + " Selected class='bodycopy'>" + arrM[ii] + "</option>"
		}
		else{
			text += "<option value= " + ii + " class='bodycopy'>" + arrM[ii] + "</option>"
		}
	}
text += "</select>"
text += "</td>"
text += "<td align=right>"
text += "<select name=selYear onChange='changeCal()' class='bodycopy' onFocus=\"style.backgroundColor='#B5E9FF'\" onBlur=\"style.backgroundColor='white'\">"
	for (ii=0;ii<=2;ii++){
		if (ii==0){
			text += "<option value= " + arrY[ii] + " Selected class='bodycopy'>" + arrY[ii] + "</option>"
		}
		else{
			text += "<option value= " + arrY[ii] + " class='bodycopy'>" + arrY[ii] + "</option>"
		}
	}
text += "</select>"
text += "</td>"
text += "</tr></table>"
text += "</td></tr>"
text += "<tr><td>"
text += "<table border=1>"
text += "<tr>"
	for (ii=0;ii<=6;ii++){
		text += "<td align=center><span class=label>" + arrD[ii] + "</span></td>"
	}
text += "</tr>"
aa = 0
	for (kk=0;kk<=5;kk++){
		text += "<tr>"
		for (ii=0;ii<=6;ii++){
			text += "<td align=center><span id='sp" + aa + "' name='sp" + aa + "' onClick='changeLoc(this.id)' onMouseOver='showDet(this.id)' onMouseOut='nd()'>1</span></td>"
			aa += 1
		}
		text += "</tr>"
	}
text += "</table>"
text += "</td></tr>"
text += "</table>"
text += "</form>"
document.write(text)
changeCal()
}
function changeCal(){
var now = new Date
var dd = now.getDate()
var mm = now.getMonth()
var dow = now.getDay()
var yyyy = now.getFullYear()
var currM = parseInt(document.calForm.selMonth.value)
var prevM
	if (currM!=0){
		prevM = currM - 1
	}
	else{
		prevM = 11
	}
var currY = parseInt(document.calForm.selYear.value)
var mmyyyy = new Date()
//mmyyyy.setFullYear(currY)
mmyyyy.setFullYear(currY,currM,1)
//mmyyyy.setMonth(currM)
//mmyyyy.setDate(1)
var day1 = mmyyyy.getDay()
	if (day1 == 0){
		day1 = 7
	}
var arrN = new Array(41)
var aa
	for (ii=0;ii<day1;ii++){
		arrN[ii] = maxDays((prevM),currY) - day1 + ii + 1
	}
	aa = 1
	for (ii=day1;ii<=day1+maxDays(currM,currY)-1;ii++){
		arrN[ii] = aa
		aa += 1
	}
	aa = 1
	for (ii=day1+maxDays(currM,currY);ii<=41;ii++){
		arrN[ii] = aa
		aa += 1
	}
	for (ii=0;ii<=41;ii++){
                if (document.getElementById){
                  eval("myDiv = document.getElementById('sp" + ii + "')");
                 }
                else if (document.all) {     // for IE
                  eval("myDiv = document.all['sp" + ii + "']");
                }
                else if (document.layers) {  // for Netscape
                  eval("myDiv = document.layers['sp" + ii + "']");
                 }
		myDiv.style.backgroundColor = "#FFFFFF";
	}
        var dCount = 0
	for (ii=0;ii<=41;ii++){
                if (document.getElementById){
                  eval("var myDiv = document.getElementById('sp" + ii + "')");
                 }
                else if (document.all) {     // for IE
                  eval("var myDiv = document.all['sp" + ii + "']");
                }
                else if (document.layers) {  // for Netscape
                  eval("var myDiv = document.layers['sp" + ii + "']");
                 }
		if (((ii<7)&&(arrN[ii]>20))||((ii>27)&&(arrN[ii]<20))){
			myDiv.innerHTML = arrN[ii];
			myDiv.className = "c3";

                        var tMonth = currM + 1; 
                        var tYY = currY;        
                        if ((ii<7)&&(arrN[ii]>20)) {
                           if (tMonth!=1){
                             var tcurrM = tMonth - 1 ;
                             }
                           else{
                             var tcurrM = 12 ;
                             tYY = tYY - 1;
                           }
                        }
                        if ((ii>27)&&(arrN[ii]<20)) {
                           if (tMonth!=12){
                             var tcurrM = tMonth +1;
                             }
                           else{
                             var tcurrM = 1 ;
                             tYY = tYY + 1;
                           }

                        }
                        var tDate = arrN[ii] + '/' + tcurrM + '/' + tYY;
                        for (var el=0;el<EventDates.length;el++){
		  	  if (tDate==EventDates[el]){
//			      eval("sp"+ii).style.backgroundColor="yellow";
//			      myDiv.style.backgroundColor="yellow";
		      	      myDiv.style.backgroundColor=BGCol[el];
                              el=EventDates.length;
                          }
                        }

		}
		else{
			myDiv.innerHTML = arrN[ii]
			if ((dCount==0)||(dCount==6)){
				myDiv.className = "c2"
			}
			else{
				myDiv.className = "c1"
			}
			if ((arrN[ii]==dd)&&(mm==currM)&&(yyyy==currY)){
				myDiv.style.backgroundColor="#90EE90"
			}
                        var tcurrM = currM + 1;
                        var tDate = arrN[ii] + '/' + tcurrM + '/' + currY;
                        for (var el=0;el<EventDates.length;el++){
		  	  if (tDate==EventDates[el]){
		      	      myDiv.style.backgroundColor=BGCol[el];
                              el=EventDates.length;
                          }
                        }
		}
	dCount += 1
		if (dCount>6){
			dCount=0
		}
	}
}
//  End -->

