
$(document).ready(function() {
	
	 
	$( "#hello_hide1, #hello_hide2, #submenu_all, #submenu_digital, #submenu_branding, #submenu_print").hide();

 
	 
	
	/* menu */
	$("#submenu_all,#submenu_digital,#submenu_branding,#submenu_print").mouseover(function(e)
	    {
	    $(this).addClass("over");
	    });
	
	$("#submenu_all,#submenu_digital,#submenu_branding,#submenu_print").mouseout(function(e)
	    {
	    $(this).removeClass("over");
	    });



	
	
	
	
		/* icons rollover */
		$("#sort_all,#submenu_all").mouseover(function() {
			if (!$("#allRollover").hasClass ('selected')) {
				$("#sort_all,#submenu_all").hover(function() {
						$("#allRollover").addClass("over");
				},function() {
				 		$("#allRollover").removeClass("over");
			 	});
			}
		});
		
		$("#sort_digital,#submenu_digital").mouseover(function() {
			if (!$("#digitalRollover").hasClass ('selected')) {
				$("#sort_digital,#submenu_digital").hover(function() {
						$("#digitalRollover").addClass("over");
				},function() {
				 		$("#digitalRollover").removeClass("over");
				 		
			 		
			 	});
			}
		});
		$("#sort_branding,#submenu_branding").mouseover(function() {
			if (!$("#brandingRollover").hasClass ('selected')) {
				$("#sort_branding,#submenu_branding").hover(function() {
						$("#brandingRollover").addClass("over");
				},function() {
				 		$("#brandingRollover").removeClass("over");

			 	});
			}
		});
		$("#sort_print,#submenu_print").mouseover(function() {
			if (!$("#printRollover").hasClass ('selected')) {
				$("#sort_print,#submenu_print").hover(function() {
						$("#printRollover").addClass("over");
				},function() {
				 		$("#printRollover").removeClass("over");
				 		
			 		
			 	});
			}
		});
		
		
		/* submenu rollover */
	
		$("#sort_all").hover(function() {
			$(this).doTimeout('hover',300, function(){
					$("#submenu_all").slideDown({duration:300 , easing: 'easeInOutCubic'});
			});
		},function() {
			$(this).doTimeout('hover',300, function(){
					myMouseOut("#submenu_all");
			});
		});
		
		$("#sort_digital").hover(function() {
			$(this).doTimeout('hover',300, function(){
					$("#submenu_digital").slideDown({duration:300 , easing: 'easeInOutCubic'});
			});
		},function() {
			$(this).doTimeout('hover',300, function(){
					myMouseOut("#submenu_digital");
			});
		});
		$("#sort_branding").hover(function() {
			$(this).doTimeout('hover',300, function(){
					$("#submenu_branding").slideDown({duration:300 , easing: 'easeInOutCubic'});
			});	
		},function() {
			$(this).doTimeout('hover',300, function(){
					myMouseOut("#submenu_branding");
			});
		});
		$("#sort_print").hover(function() {
			$(this).doTimeout('hover',300, function(){
					$("#submenu_print").slideDown({duration:300 , easing: 'easeInOutCubic'});
			});	
		},function() {
			$(this).doTimeout('hover',300, function(){
					myMouseOut("#submenu_print");
			});
		}); /* submenu ends */
		
		
		/* rollover icons ends */
		
		/* thumbnails hover action */
		$(".thumbnail_wrapper").hover(function(){
			$(".cover", this).stop().animate({top:'240px'},{queue:false,duration:300,easing: 'easeOutBack'});
			$(this).animate({top:'3px'},{duration:300 , easing: 'easeInQuad'});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:100, easing: 'easeInBack'});
			$(this).animate({top:'15px'},{duration:300, easing: 'easeOutBounce'});
			
		}); /* end thumbnails hover action */
		
		
		/* ends */
		$('div[id^=slideImg]').each(function(index) {
		
			$('#slideImg'+ (index+1)).cycle({
				fx:     'fade', 
				speed:  'fast', 
				timeout: 0, 
				next:   '.next,#slideImg'+ (index+1),
				prev:   '.prev'
			});
		});
	
});
	
function myMouseOut(id){
     	if ($(id).hasClass("over")){
     		$(id).mouseleave(function(){
     			$(id).slideUp({duration:300 , easing: 'easeInOutCubic'});
     		});
     	} else{
     		$(id).slideUp({duration:300 , easing: 'easeInOutCubic'});
     	}
}	












