function insertNextMarket(){
	var sidebar = $("sidebar");
	var sidebarList = sidebar.firstChild;
	var newItem = document.createElement('li');
	newItem.setAttribute('id', 'next market');
	
	//get market date
	var now = new Date();
	var date  = new Date();//ini the date to today
	date.setDate(1);//set it to the first of the month (so we can find out what day of week this month started on)
	date.setDate(21-date.getDay());//set the day of month to the 3rd sat
	if(date.getDate()<now.getDate()){//if thats before today then it must be next month
		var date  = new Date();//ini the date back to today
		date.setDate(1);//set it to the first of this month
		if (date.getMonth() == 11){ //if it's december
			date.setYear(date.getYear()+1); //increase the year
			date.setMonth(0); //set the month to Jan
		}else{
			date.setMonth(date.getMonth()+1);	//increase the month
		}
		date.setDate(21-date.getDay());//set the day of month to the 3rd sat
	}
	//got market (date= market)
	
	//test
	now.setDate(10);
	//test
	
	//add extra info
	var extra = "";
	//alert("if((("+date.getDate()+"-6) < "+now.getDate()+" < "+date.getDate()+")&("+now.getMonth()+" == "+date.getMonth()+"))");
	if(((date.getDate()-6) < now.getDate())&(now.getDate() < date.getDate())&(now.getMonth() == date.getMonth())){//if today is in the week before the market
		extra="This Saturday!";
	}
	//alert("if(("+date.getDate()+" == "+now.getDate()+")&("+now.getMonth()+" == "+date.getMonth()+"))");
	if((date.getDate() == now.getDate())&(now.getMonth() == date.getMonth())){
		extra="Today, 8.30am - 1pm!";
	}	   
	// got extra info (=extra)
	
	
	var months = new Array(13);
    months[0]  = "January";
    months[1]  = "February";
    months[2]  = "March";
    months[3]  = "April";
    months[4]  = "May";
    months[5]  = "June";
    months[6]  = "July";
    months[7]  = "August";
    months[8]  = "September";
    months[9]  = "October";
    months[10] = "November";
    months[11] = "December";
	var text = document.createTextNode("Next Market: "+months[date.getMonth()]+" "+date.getDate()+" "+extra);
	newItem.appendChild(text);
	sidebarList.insertBefore(newItem,sidebarList.firstChild);
}

function $(id) {
	  return document.getElementById(id);
}