// ------- 
// ------- preload all css images - START -------
// ------- 
		$(document).ready(function(){
			$.preloadCssImages();
		}); 
// ------- 
// ------- preload all css images - START -------
// ------- 

// ------- 
// ------- scroll to top/bottom of page - START -------
// ------- 
        $(function() {
            var $elem = $('#div_footer');
            
            $('#nav_up').fadeIn('slow');
            $('#nav_down').fadeIn('slow');  
            
            $(window).bind('scrollstart', function(){
                $('#nav_up,#nav_down').stop().animate();
            });
            $(window).bind('scrollstop', function(){
                $('#nav_up,#nav_down').stop().animate();
            });
            
            $('#nav_down').click(
                function (e) {
                    $('html, body').animate({scrollTop: $elem.height()},  800);
                }
            );
            $('#nav_up').click(
                function (e) {
                    $('html, body').animate({scrollTop: '0px'}, 800);
                }
            );
        });
// ------- 
// ------- scroll to top/bottom of page - END -------
// -------

// ------- 
// ------- services page hover div - START -------
// ------- 
        jQuery(document).ready(function(){
            jQuery("#div_services_web_design").bind("mouseover", function(e) {
                jQuery("#div_services_web_design_content").css({
                                left:jQuery(this).offset().left-25, 
                                top:jQuery(this).offset().top-jQuery("#div_services_web_design_content").height()-9 
                            }).show();
                e.stopPropagation(); // Stops the following click function from being executed
                jQuery(document).one("mouseout", function(f) {
                    jQuery("#div_services_web_design_content").hide();
                });
            });
            // STOP the menu from disappearing when it is clicked
            jQuery("#div_services_web_design").bind("click", function(e) { e.stopPropagation(); });
        });
		
        jQuery(document).ready(function(){
            jQuery("#div_services_web_development").bind("mouseover", function(e) {
                jQuery("#div_services_web_development_content").css({
                                left:jQuery(this).offset().left-195, 
                                top:jQuery(this).offset().top-jQuery("#div_services_web_development_content").height()-54 
                            }).show();
                e.stopPropagation(); // Stops the following click function from being executed
                jQuery(document).one("mouseout", function(f) {
                    jQuery("#div_services_web_development_content").hide();
                });
            });
            // STOP the menu from disappearing when it is clicked
            jQuery("#div_services_web_development").bind("click", function(e) { e.stopPropagation(); });
        });
		
        jQuery(document).ready(function(){
            jQuery("#div_services_cms").bind("mouseover", function(e) {
                jQuery("#div_services_cms_content").css({
                                left:jQuery(this).offset().left-365, 
                                top:jQuery(this).offset().top-jQuery("#div_services_cms_content").height()-8
                            }).show();
                e.stopPropagation(); // Stops the following click function from being executed
                jQuery(document).one("mouseout", function(f) {
                    jQuery("#div_services_cms_content").hide();
                });
            });
            // STOP the menu from disappearing when it is clicked
            jQuery("#div_services_cms").bind("click", function(e) { e.stopPropagation(); });
        });	
		
		
        jQuery(document).ready(function(){
            jQuery("#div_services_ecommerce").bind("mouseover", function(e) {
                jQuery("#div_services_ecommerce_content").css({
                                left:jQuery(this).offset().left-528, 
                                top:jQuery(this).offset().top-jQuery("#div_services_ecommerce_content").height()-182 
                            }).show();
                e.stopPropagation(); // Stops the following click function from being executed
                jQuery(document).one("mouseout", function(f) {
                    jQuery("#div_services_ecommerce_content").hide();
                });
            });
            // STOP the menu from disappearing when it is clicked
            jQuery("#div_services_ecommerce").bind("click", function(e) { e.stopPropagation(); });
        });						
// ------- 
// ------- services page hover div - END -------
// ------- 
    
// ------- 
// ------- web design tabs - START -------
// ------- 
		$(document).ready(function() {
		
			//When page loads...
			$(".tab_content").hide(); //Hide all content
			$("ul.tabs li:first").addClass("active").show(); //Activate first tab
			$(".tab_content:first").show(); //Show first tab content
		
			//On Click Event
			$("ul.tabs li").click(function() {
		
				$("ul.tabs li").removeClass("active"); //Remove any "active" class
				$(this).addClass("active"); //Add "active" class to selected tab
				$(".tab_content").hide(); //Hide all tab content
		
				var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
				$(activeTab).fadeIn(); //Fade in the active ID content
				return false;
			});
		
		});    
// ------- 
// ------- web design tabs - END -------
// ------- 
    
// ------- 
// ------- portfolio cycle - START -------
// ------- 
		$(document).ready(function() {
			$('#portfolio').cycle({ 
				fx:     'scrollDown', 
				speed:  'slow', 
				timeout: 0, 
				next:   '#next1', 
				prev:   '#prev1' 
			});
		});
// ------- 
// ------- portfolio cycle - END -------
// ------- 
    
// ------- 
// ------- portfolio show image (fancy box) - START -------
// ------- 
		$(document).ready(function() {
			/*
			*   Examples - images
			*/
			$("a[rel=portfolio_item]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
				    return '<span id="fancybox-title-over">' + title + '</span>';
				}
			});
		});
// ------- 
// ------- portfolio show image (fancy box) - END -------
// ------- 
    
// ------- 
// ------- latest news cycle - START -------
// -------  
		$(document).ready(function() {		
			$('.news_story').cycle({ 
				fx:     'scrollVert', 
				speed:  'slow',
				timeout: 0, 
				next:   '#next', 
				prev:   '#prev'
			});
			
			$('.our-clients').cycle({
				fx: 'fade' // .......
			});			
		});		
// ------- 
// ------- latest news cycle - END -------
// -------  
    
// ------- 
// ------- image preloader - START -------
// -------  
		<!--
		function MM_preloadImages() { //v3.0
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}
		//-->
// ------- 
// ------- image preloader - END -------
// -------     
