	//pretty photo
	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto();
	});


//image effects 
	$(document).ready(function(){
			var image_e= $(".image.portfolio, .image.product_image");
			image_e.mouseover(function(){$(this).stop().animate({ opacity:0.6
					}, 400);
			}).mouseout(function(){
				image_e.stop().animate({ 
					opacity:1
					}, 400 );
			});
	});

	
//img preload
$(function () {
			$('.loadpie').hide();//hide all the images on the page
		});
		
		var i = 0;//initialize
		var int=0;//Internet Explorer Fix
		$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
			var int = setInterval("doThis(i)",500);//500 is the fade in speed in milliseconds
		});

		function doThis() {
			var imgs = $('.loadpie').length;//count the number of images on the page
			if (i >= imgs) {// Loop the images
				clearInterval(int);//When it reaches the last image the loop ends
			}
			$('loadpie:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
			i++;//add 1 to the count
		}




//preloading 
$(function () {
	//$('.preload').hide();//hide all the images on the page
	$('.play,.magnifier').css({opacity:0});
	$('.preload').css({opacity:0});
	$('.preload').addClass("animated");
	$('.play,.magnifier').addClass("animated_icon");
});


var i = 0;//initialize
var cint=0;//Internet Explorer Fix
$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	var cint = setInterval("doThis(i)",70);//500 is the fade in speed in milliseconds

});

$(document).ready(
			function(){
				$('#news').innerfade({
					animationtype: 'slide',
					speed: 750,
					timeout: 2000,
					type: 'random',
					containerheight: '1em'
				});
				
				$('ul#portfolio').innerfade({
					speed: 1000,
					timeout: 5000,
					type: 'sequence',
					containerheight: '220px'
				});
				
				$('.fade').innerfade({
					speed: 1000,
					timeout: 6000,
					type: 'random_start',
					containerheight: '1.5em'
				});
				
				$('.adi').innerfade({
					speed: 'slow',
					timeout: 5000,
					type: 'random',
					containerheight: '150px'
				});

		});


function doThis() {
	var images = $('.preload').length;//count the number of images on the page
	if (i >= images) {// Loop the images
		clearInterval(cint);//When it reaches the last image the loop ends
	}
	$('.preload:hidden').eq(i).fadeIn(500);//fades in the hidden images one by one
	$('.animated_icon').eq(0).animate({opacity:1},{"duration": 500});
	$('.animated').eq(0).animate({opacity:1},{"duration": 500});
	$('.animated').eq(0).removeClass("animated");
	$('.animated_icon').eq(0).removeClass("animated_icon");
	i++;//add 1 to the count
}
