// JavaScript Document

// .....................................FUNCTIONS



// .....................................DOM IN

$(document).ready(function(){
						   
// main nav rollovers
	      if ($.browser.msie && $.browser.version < 7) return;
        
        $('#navigation li')
            .removeClass('highlight')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(200, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(600, 0);
                    });
                });
			

				
	// get location
	var myLocation = window.location.href.slice(window.location.href.indexOf('?') + 1).split('/');
	
	
	switch(myLocation[3])
{
		case "index.php":
				$("#navigation a.aboutus").css({"backgroundPosition" : "0px 0px"});
		  break;
	
		case "":
				$("#navigation a.aboutus").css({"backgroundPosition" : "0px 0px"});
		  break;
		
		case "history.php":
				$("#navigation a.history").css({"backgroundPosition" : "-122px 0px"});
		  break;
	
		case "practiceAreas.php":
				$("#navigation a.practiceAreas").css({"backgroundPosition" : "-232px 0px"});
		  break;
		  
		case "partners.php":
				$("#navigation a.partners").css({"backgroundPosition" : "-410px 0px"});
		  break;
		  
		case "contacts.php":
				$("#navigation a.contacts").css({"backgroundPosition" : "-549px 0px"});
		  break;
		  
		case "login_users":
				$("#navigation a.login").css({"backgroundPosition" : "-677px 0px"});
		  break;
		  
		default:
				$("#navigation a.partners").css({"backgroundPosition" : "-410px 0px"});

}
	

// ..................................... PARTNERS PAGE



$("#wrapLeftPartner a").each(function() {

$(this).hover(function() {
$(this).addClass('hoverIcon');
myhref = $(this).attr("href");

	switch(myhref)
{
		case "jay.php":
			   $("#wrapRightPartner").html('<div id="jayOver"><img src="../images/jayOver.png"></div>');
		  break;

		case "tara.php":
			   $("#wrapRightPartner").html('<div id="taraOver"><img src="../images/taraOver.png"></div>');

		  break;

		case "mick.php":
			   $("#wrapRightPartner").html('<div id="mickOver"><img src="../images/mickOver.png"></div>');
		  break;
		  
		case "aj.php":
			   $("#wrapRightPartner").html('<div id="ajOver"><img src="../images/ajOver.png"></div>');
		  break;
		default:
		       $("#wrapRightPartner").html(" ");

}


},
function() {
$(this).removeClass('hoverIcon')
$("#wrapRightPartner").html(" ");
});
});

// Track mousmovement for partner img rollover 

$("#wrapRightPartner").mousemove(function(e){
var offset = $(this).offset();
	var x = e.pageX - offset.left;
	var y = e.pageY - offset.top;
	
        var jayPos = x>0 && x<128 && y>0 && y<325;
        var taraPos = x>142 && x<265 && y>0 && y<325;
        var mickPos = x>287 && x<400 && y>0 && y<325;
       // var amiePos = x>426 && x<545 && y>0 && y<325;
        var ajPos = x>426 && x<545 && y>0 && y<325;
//var ajPos = x>560 && x<670 && y>0 && y<325;

if(jayPos){
       $("#wrapRightPartner:first").html('<a href="jay.php"><div id="jayOver"><img src="../images/jayOver.png" border="0"></div></a>');
       $("#wrapLeftPartner a:eq(0)").addClass('hoverIcon');
} 
else if(taraPos) {
       $("#wrapRightPartner:first").html('<a href="tara.php"><div id="taraOver"><img src="../images/taraOver.png" border="0"></div></a>');
       $("#wrapLeftPartner a:eq(1)").addClass('hoverIcon');
} 
else if(mickPos) {
       $("#wrapRightPartner:first").html('<a href="mick.php"><div id="mickOver"><img src="../images/mickOver.png" border="0"></div></a>');
       $("#wrapLeftPartner a:eq(2)").addClass('hoverIcon');
} 

//else if(amiePos) {
//       $("#wrapRightPartner:first").html('<a href="amie.php"><div id="amieOver"><img src="../images/amieOver.png" border="0"></div></a>');
//       $("#wrapLeftPartner a:eq(3)").addClass('hoverIcon');
} 
else if(ajPos) {
       $("#wrapRightPartner:first").html('<a href="aj.php"><div id="ajOver"><img src="../images/ajOver.png" border="0"></div></a>');
       $("#wrapLeftPartner a:eq(4)").addClass('hoverIcon');
} 

else {
$("#wrapRightPartner:first").html(" ");
$("#wrapLeftPartner a").removeClass('hoverIcon');
} 
});						   

// .....................................BIO 

}); // end ready







// .....................................FUNCTIONS
