
	function refresh(number){
		var	location = "dashboard.php?gameid="+number;
		$('#container').load(location);		
	}

	function fade() { 
		$("#container").fadeIn('600'); 
	}
	
	function clearname(){
		$("input#nme").val('');
	}
	function clearemail(){
		$("email").val('');
	}
	
	
function updated(which, what) {
var message = "<h2>"+which +" is now "+ what+"</h2>";  
    $.ajax({
		url: "control.php",
		cache: false,
		success: function(html){
		$("#container").load('control.php');
	    $('#status').html("algorithms updated").fadeIn(2000);  
	    $('#message').html(message)  
	    .append("<p>Your suggestion will make us smarter.</p>").fadeIn(2000, function() {
	  	$('#message').append("<img id='checkmark' src='http://www.shedali.com/caps//hovercraft-20090405-041542.jpg' />");  
	    });
	}
}); 
  }  
  
  
  function removed(){
  alert('managed to remove that shit');
  }
  
  
  function removeGame(gameid){
		$.ajax({
   type: "POST",
   url: "reset-chart-record.php",
   data: "gameid="+gameid,
   success: function(html){
   alert('gameid='+gameid);
		$("#container").load('dashboard.php').append(html);
	    $('#status').html("algorithms updated").fadeIn(2000);  
	    $('#message').html(message)  
	    .append("<p>Your suggestion will make us smarter.</p>").fadeIn(2000, function() {
	  	$('#message').append("<img id='checkmark' src='http://www.shedali.com/caps//hovercraft-20090405-041542.jpg' />");  
	    });
	}
   });
  }
	
	function update(which, what){
		var t = true;
		var f = false;
		if (what==true) what=1; else what=0;
		$.ajax({
   type: "POST",
   url: "checkbox-send.php",
   data: which+"="+what,
   success: updated(which, what)
   });
		
		
		
	//	$.post("algorithmchoice.php", which:what, updated(which, what));
	}
	
function success() {  
    $('#container').html("<div id='message' height='300px'></div>");  
    $('#message').html("<h2>Thank you for your feedback!</h2>").hide().fadeIn(2000, function() {  
    $('#message').append("<img id='checkmark' src='http://www.shedali.com/caps//hovercraft-20090405-041542.jpg' />");  
    });  
  }  
	
	function navigateto(page){
		$('#container').load(page+'.php');
	}
	
	function submitform(mess, nme){//#56
		$.post("quickmail.php", {message:mess, name: nme}, success());
	}
	
	function updateparams(){
		$('#regform').submit();
	}
	
	function highlight(){
//		window.alert('hello');
		SyntaxHighlighter.All('code');
	}
	
	function shadowbox(){

			Shadowbox.init({language: 'en',players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']});
			Shadowbox.setup();		
	}
	
	function videoOpen(id, title){
		Shadowbox.open({
	        content:    'http://vimeo.com/moogaloop.swf?clip_id='+id+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=59a5d1&amp;fullscreen=1;autoplay=1',
	        player:     "swf",
	        title:      title,
	        height:     375,
	        width:      600
	    });	}
	
	
				
$(document).ready(function(){//UPON PAGE LOAD



	//LOAD FIRST PAGE
	$('#container').load('welcome.php');
			
	//NAVIGATION BUTTON ACTIONS		
	$('#overview').click(function(){
		$('#container').load('dashboard.php');		
	});

	$('#button').click(function(){
			$('#container').load('chart.php');
	});  
	
	$('#home').click(function(){
		$('#container').fadeIn(1000);
		$('#container').load('welcome.php');
	});
	
	$('#feedback').click(function(){
		$('#container').load('contact.php');
	});
	
	
	$('#learn').click(function(){
		$('#container').load('info.php');
	});	
	
	$('#download').click(function(){
		$('#container').load('download.php');		
	});
			
	$('#configure').click(function(){
		$('#container').load('control.php');		
	});
});

