// JavaScript Document
$(document).ready(
	function(){
		$('#top-nav ul ul li').bind('mouseenter',function(){
				$(this).children(':first').css('color','#FFFFFF');
			}
		)
		$('#top-nav ul ul li').bind('mouseleave',function(){
				if($(this).hasClass('selected')){
					$('#'+loc[4]+"-nav").find(':first-child').css('color','#02BBE6');
					return;
				}
				
				$(this).children(':first').css('color','FFFFFF');
			}
		)
		
		
		var  loc=new Array();
		var url=document.location.href.toString()
		
		loc=url.split("/");
		var page=loc[3];
		
		switch(page){
			case '':
			case null:
				$('#home-nav').children(':first-child').addClass('selected');
				break;
			case 'about-us':
				$('#about-nav').children(':first-child').addClass('selected');
				break;
			case 'contact-us':
		
				$('#contact-nav').children(':first-child').addClass('selected');
				break;
			case 'optikam':
				$('#optikam-nav').children(':first-child').addClass('selected');
				break;
			case 'press':
				$('#press-nav').children(':first-child').addClass('selected');
				break;
			case 'brands':
			
				$('#brands-nav').children(':first-child').addClass('selected');
				$('#'+loc[4]+"-nav").addClass('selected');
				$('#'+loc[4]+"-nav").find(':first-child').addClass('selected');
				
				$('#'+loc[4]+"-nav").find(':first-child').css('color','#02BBE6');
				break;
		}
		
		Cufon.replace('h1')
		$('h1').show()
	}
)
  
function liNav(li){

  document.location.href=$(li).children('a:first').attr('href')
  
}
