	var adindex = 0;
	var theInt = null;
	var $crosslink, $navthumb;
	var curclicked = 0;		

	$(document).ready( function(){
		
		gettutorrequirements();
		getfeedbacks();
		change_ad();
		
		setInterval("getfeedbacks()",10000);
		setInterval("gettutorrequirements()",10000);
		setInterval("change_ad()",10000);
		
		gettutors();
		getvisitors();
		
		$("#imguser").bind("mouseover",	function(e){
				animatedcollapse.toggle('divexplanationstudent');
			}
		);
		$("#imguser").bind("mouseout",function(e){
				animatedcollapse.toggle('divexplanationstudent');
			}
		);
		
		$("#imgtutor").bind("mouseover",function(e){
				animatedcollapse.toggle('divexplanationtutor');
			}
		);
		$("#imgtutor").bind("mouseout",function(e){
				animatedcollapse.toggle('divexplanationtutor');
			}
		);

		showfeaturedtutors();
		setInterval("showfeaturedtutors()",20000);
	});
	
	function showfeaturedtutors(){
		
		$.ajax({
          url: 'featuredtutors.php',
          data: 's=' + new Date().getSeconds(),
          type: 'POST',
          success: function (result) {
            $("#featuredtutors").html(result);
          }
        });			
	}

	function showChat(){
		window.open("offlinechat.php","offline","width=500px, height=380px, menubar=no, titlebar=no, location=no, status=no, toolbar=no, left=300px, top=100px");
		return false;
	}

	function gettutorrequirements(){

		$.ajax({
          url: 'gettutorrequirements.php',
          data: 's=' + new Date().getSeconds(),
          type: 'POST',
          success: function (result) {
            $("#tutreq").html(result);
          }
        });
	}

	function getfeedbacks(){
		$.ajax({
          url: 'getfeedbacks.php',
          data: 's=' + new Date().getSeconds(),
          type: 'POST',
          success: function (result) {
            $("#feedbk").html(result);
          }
        });
	}

	function getvisitors(){
		$.ajax({
          url: 'getvisitors.php',
          data: 's=' + new Date().getSeconds(),
          type: 'POST',
          success: function (result) {
            $("#visitorcnt").html("<b>" + result + "</b>");
          }
        });
	}


	function gettutors(){
		$.ajax({
          url: 'gettutorcount.php',
          data: 's=' + new Date().getSeconds(),
          type: 'POST',
          success: function (result) {
            $("#tutorcnt").html("<b>" + result + "</b>");
          }
        });
	}
