$j(document).ready(function() 
{
  $j(function() 
  {
    $j('#images a').lightBox({fixedNavigation:true});
  });
  $j("#toolbar").mouseleave(function() 
  {
    $j("#toolbarInfo").fadeOut("slow"); 
  });
  $j("#toolbar").mouseenter(function() 
  {
    $j("#toolbarInfo").fadeIn("slow");
  }); 
});

function setCursor(act)
{
  if (act == 1)
	$j('#form_footer_input').css('cursor', 'pointer');
  else if (act == 0)	
	$j('#form_footer_input').css('cursor', 'default');
}

function fadeProducts(which , act)
{
  $j(document).ready(function() 
  {			
	if (which == 'chryslerProductproductOverviewLink')
	{	  
	  if (act == 1)
	  {		
	    $j('#'+which).css('background', 'url(/images/layout/chrysler_product_hover.jpg) no-repeat');
	    $j("#products").fadeIn("slow");
      }
	}
	else if (which == 'jeepProductproductOverviewLink')
	{	  
	  if (act == 1)
	  {		
	    $j('#'+which).css('background', 'url(/images/layout/jeep_product_hover.jpg) no-repeat');
	    $j("#products").fadeIn("slow");
      }
	}
	else if (which == 'dodgeProductproductOverviewLink')
	{	  
	  if (act == 1)
	  {		
	    $j('#'+which).css('background', 'url(/images/layout/dodge_product_hover.jpg) no-repeat');
	    $j("#products").fadeIn("slow");
      }
	}
	if (act == 0)
	{
	  $j('#'+which).mouseleave(function() 
	  {
		$j('#'+which).css('background', 'none');
		$j("#products").fadeOut("slow");
	  });
    }	
  });	
}

function setZipThumbBg(divId , act) 
{ 
  if (act == 1)
    $j('#'+divId).css('background', 'url(/images/layout/zip_gallery_act_thumb_bg.jpg) no-repeat');
  else if (act == 0)
    $j('#'+divId).css('background', 'url(/images/layout/zip_gallery_thumb_bg.jpg) no-repeat');
}

function setProductBg(which , divId , act) 
{ 
  if (which == 'chryslerProduct')
  {	  
	if (act == 1)
	{	  
      $j('#'+which+divId).css('background', 'url(/images/layout/chrysler_menu_1_hover.jpg) no-repeat');
	  $j('#'+which+'Link'+divId).css('color', '#ffffff');
	}
	else if (act == 0)
	{  
	  $j('#'+which+divId).css('background', 'none');
	  $j('#'+which+'Link'+divId).css('color', '#333');
	}
  }
  else if (which == 'jeepProduct')
  {
	if (act == 1)  
	  $j('#'+which+divId).css('background', 'url(/images/layout/jeep_menu_1_hover.jpg) no-repeat');
	else if (act == 0) 
	  $j('#'+which+divId).css('background', 'none');
  }
  else if (which == 'dodgeProduct')
  {	  
	if (act == 1)
	{	  
	  $j('#'+which+divId).css('background', 'url(/images/layout/dodge_menu_1_hover.jpg) no-repeat');
	  $j('#'+which+'Link'+divId).css('color', '#ffffff');
	}
	else if (act == 0)
	{  
	  $j('#'+which+divId).css('background', 'none');
	  $j('#'+which+'Link'+divId).css('color', '#333');
	}
  }
}  

function setMenuUpper(which , divId , divId2 , children , act) 
{ 
  if (which == 'chrysler')
  {	  
	if (act == 1)
	{	  
	  $j('#'+which+divId).css('background', 'url(/images/layout/chrysler_menu_2_hover.jpg) repeat-x');
	}
  }	
  else if (which == 'dodge')
  {	  
	if (act == 1)
	{	  
	  $j('#'+which+divId).css('background', 'url(/images/layout/dodge_menu_2_hover.jpg) repeat-x'); 	  
	}
  }	
  else if (which == 'jeep')
  {	  
	if (act == 1)
	{	  
	  $j('#'+which+divId).css('background', 'url(/images/layout/jeep_menu_2_hover.jpg) repeat-x');
	}
  }	
  if (act == 1 && children)
  {	   
    fadeIn(divId2);   	
  }
  if (act == 0)
  {  
	$j('#'+which+divId).mouseleave(function() 
	{		      	
      $j('#'+which+divId).css('background', 'none');
	  if (children)
        $j('#'+divId2).fadeOut('slow');
	});
  }
}  

function fadeMenu(divId , divId2 , act)
{
  if (act == 1)
  {
    $j(document).ready(function() 
	{
	  $j('#'+divId2).fadeIn('slow');
    });
  }	  
  else if (act == 0)
  {
	$j('#'+divId).mouseleave(function() 
	{
	  $j('#'+divId2).fadeOut('slow');	
    });
  }	  
}

function setTeamImageBg(divId , act) 
{ 
  if (act == 1)
    $j('#'+divId).css('background', 'url(/images/layout/team_act_thumb_bg.jpg) no-repeat');
  else if (act == 0)
    $j('#'+divId).css('background', 'url(/images/layout/team_thumb_bg.jpg) no-repeat');
}

function fadeIn(divId) 
{ 
  $j(document).ready(function() 
  {
    $j('#'+divId).fadeIn('slow');
  });
}

function fadeOut(divId) 
{
  $j(document).ready(function() 
  {
    $j('#'+divId).mouseleave(function() 
    {  		  
      $j('#'+divId).fadeOut('slow');
    });
  });  
}

function fadeOut2(divId , divId2) 
{
  $j(document).ready(function() 
  {
    $j('#'+divId).mouseleave(function() 
    {  		  
      $j('#'+divId2).fadeOut('slow');
    });
  });  
}

function setFadeMenuBg(divId , act)
{
  if (act)
  {
    $j('#'+divId).css('backgroundColor', '#e39608');
    $j('#'+divId+' a').css('color', '#ffffff');
  }	    
  else 
  {  
	$j('#'+divId).mouseleave(function() 
    {  	
	  $j('#'+divId).css('background', 'none');
	  $j('#'+divId+' a').css('color', '#333333');
    });
  }
}

function setMenu3Bg(which , divId , act)
{
  if(which == 'chrysler')
  {
    if (act)
    {
      $j('#'+divId).css('backgroundColor', '#0079A8');
      $j('#'+divId+' a').css('color', '#ffffff');
    }	    
    else 
    {  
	  $j('#'+divId).mouseleave(function() 
      {  	
	    $j('#'+divId).css('background', 'none');
	    $j('#'+divId+' a').css('color', '#333333');
      });
    }
  } 
  if(which == 'dodge')
  {
    if (act == 1)
    { 	
	  $j('#'+divId).css('backgroundColor', '#d5d4d4');
      $j('#'+divId+' a').css('color', '#990000');
    }   
    else 
    {   
	  $j('#'+divId).mouseleave(function() 
      {  	
	    $j('#'+divId).css('background', 'none');
	    $j('#'+divId+' a').css('color', '#111111');
      });
    }
  }  
  if(which == 'jeep')
  {
    if (act == 1)
    {
      $j('#'+divId).css('backgroundColor', '#ffffff');
      $j('#'+divId+' a').css('color', '#849467');
    }
    else 
    {
      $j('#'+divId).mouseleave(function() 
      {  	
        $j('#'+divId).css('background', 'none');
    	$j('#'+divId+' a').css('color', '#ffffff');
      });	
    }
  }
}

