$(document).ready(function(){

var donotbother=0;

// doing a sniff to see if it's IE6 - if it is, no animations for you.

if(jQuery.browser.version=="6.0"&&jQuery.browser.msie){
                
                donotbother=1;

}

// do the ajax for the statistics

$('#containers a').click(function(){
var args = {};
args.clickid = this.id;
$.ajax({ url:"ajax_update.php", type:"get", data: args
      //error:function(){alert('Failed');}, success:function(){alert('Success');}
   });
});

// if there's no hash, set up with introduction first

if(donotbother==0){

var whereURL = document.location.toString();

/*
<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentHome_1"/>
<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentEmployers_4"/>
<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentStudents_4"/>
<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentGraduates_4"/>
<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentStaff_4"/>
*/


if (!whereURL.match('#')) {
                        
$('#introduction').show();

// ADD TRACKER CODE

$('#trackerintroduction').append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentHome_1"/>');

// END TRACKER CODE

$('#employers').hide();
$('#students').hide();
$('#staff').hide();
$('#graduates').hide();

} else {
                
// otherwise hide everything except the hash
            
var hashOnly = whereURL.split('#')[1];
         
possibleLocations=Array("introduction", "employers", "students", "staff", "graduates");

for(i=0; i<possibleLocations.length; i++)
{
      
if(hashOnly!=possibleLocations[i]){
                
   $('#'+possibleLocations[i]).hide();             
                
}else{
               var addimg=possibleLocations[i]
}
            
}

// ADD TRACKER CODE
    
var capaddimg = addimg.substr(0,1).toUpperCase()+addimg.substr(1);

$('#tracker'+addimg).append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905Talent'+capaddimg+'_1"/>');

// END
    
}

// set up the return link


$('a.return').click(function(){
                
var fadethisout="#"+$(this).parent().attr("id");                

// ADD TRACKER CODE

var removeme=fadethisout.substr(1)

$('#tracker'+removeme+' img').remove();

$('#trackerintroduction').append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentHome_1"/>');

// END TRACKER CODE

$(fadethisout).customFadeOut("slow", function () {

                $("#introduction").customFadeIn("slow");

      });
               
});

// set up the links from the 'homepage' to the area pages 

$('#containers a#clickemployers').click(function(){
$('#trackerintroduction img').remove();	// tracker code
$('#introduction').customFadeOut("slow", function () {
$("#employers").customFadeIn("slow");
});
$('#trackeremployers').append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentEmployers_1"/>'); // tracker code
});


$('#containers a#clickstudents').click(function(){
$('#trackerintroduction img').remove();  // tracker code
$('#introduction').customFadeOut("slow", function () {
$("#students").customFadeIn("slow");
});
$('#trackerstudents').append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentStudents_1"/>');  // tracker code
});


$('#containers a#clickgraduates').click(function(){
$('#trackerintroduction img').remove();  // tracker code
$('#introduction').customFadeOut("slow", function () {
$("#graduates").customFadeIn("slow");
});
$('#trackergraduates').append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentGraduates_1"/>');  // tracker code
});


$('#containers a#clickstaff').click(function(){
$('#trackerintroduction img').remove();  // tracker code
$('#introduction').customFadeOut("slow", function () {
$("#staff").customFadeIn("slow");
});
$('#trackerstaff').append('<img height="1" width="1" src="http://view.atdmt.com/action/tmpmmu_0905TalentStaff_1"/>');  // tracker code
});
}

});
