jQuery(document).ready(function() {
	$("#youtube").fancybox({				
        'padding'			: '5',
        'margin'			: '5',
        'autoScale'			: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',		
		'modal'				: false,
		'overlayColor'		: '#202020'
	});
	$("#login_link").fancybox({				
        'padding'			: '5',
        'margin'			: '5',
        'width'				: '37.35%',
        'height'			: '48%',
        'autoScale'			: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',				
		'overlayColor'		: '#202020'
	});
	$("#testimonials_accord_more").click(function(){						
		$("#testimonials_accord").removeClass('test_accord');	
		$("#testimonials_accord").slideDown('fast').show();
		$("#testimonials_accord_more").addClass('hidden_class');
	});
	$("#testimonials_accord_less").click(function(){						
		$("#testimonials_accord").addClass('test_accord');	
		$("#testimonials_accord_more").removeClass('hidden_class');
	});
    $("ul.nokaoi-nav li span").click(function() { //When trigger is clicked...
    	$("ul.nokaoi-nav li").find("a:first").removeClass('active_link');            
    	$("ul.nokaoi-nav li").find("a:first-child").removeClass('active_link');            
    	if($("ul.nokaoi-nav li").find("ul.subnav").is(':visible')){            
            $("ul.nokaoi-nav li").parent().find("ul.subnav").slideUp('fast');                                    
        }
    });
    $("ul.nokaoi-nav li").click(function() { //When trigger is clicked...
        //Do nothing when the list is open                
        if(!$(this).find("ul.subnav").is(':visible')){            
            $(this).parent().find("ul.subnav").slideUp('fast');                        
            $(this).find("a:first").addClass('active_link');
            $(this).find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
        }        
    });  
     $("ul.nokaoi-nav li ul li").click(function() { //When trigger is clicked...
        //Do nothing when the list is open                
        $(this).find("a:first").removeClass('active_link');                    
    });  
    $("a.fancybox").attr('rel', 'gallery').fancybox({
    	'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}	
    });
    $("a.fancybox2").attr('id', 'favorite_kine').fancybox({    	
    });
    $("a.product_galleries").fancybox();
    $("ul.locations-nav li span").click(function() { //When trigger is clicked...
    	$("ul.locations-nav li").find("a:first").removeClass('active_link');            
    	$("ul.locations-nav li").find("a:first-child").removeClass('active_link');            
    	if($("ul.locations-nav li").find("ul.subnav").is(':visible')){            
            $("ul.locations-nav li").parent().find("ul.subnav").slideUp('fast');                                    
        }
    });
    $("ul.locations-nav li").click(function() { //When trigger is clicked...
        //Do nothing when the list is open                
        if(!$(this).find("ul.subnav").is(':visible')){            
            $(this).parent().find("ul.subnav").slideUp('fast');                        
            $(this).find("a:first").addClass('active_link');
            $(this).find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
        }        
    });  
     $("ul.locations-nav li ul li").click(function() { //When trigger is clicked...
        //Do nothing when the list is open                
        $(this).find("a:first").removeClass('active_link');                    
    });  
});

function InsertMailToTag( userName, domainName){
	var EmailId;
	var atSign = "&#64;"
	var fullStop = "&#46";
	
	EmailId = userName;
	EmailId = "" + EmailId + atSign; 
	EmailId = EmailId + domainName;
	
	document.write( "<a href='mail" + "to:" + EmailId + "'>" + EmailId
	+"</A>" );
}
