(function(jQuery){
		  
	jQuery.fn.slideshow = function(options){ 
		var defaults = {
		speed 				:	1000,
		showStrip 			: 	true,
		imagestripClass 	: 	"imageStrip",
		slideActiveClass 	: 	"active",
		currentImgActive 	: 	1,
		auto				:	true,
		pause				: 7000
		}; 
		var options = jQuery.extend(defaults, options); 
		
		// Creating Object for this
			var element = this;
			var _imageListingItem = new Array();
			jQuery(element).each(function(){
				jQuery('.imageList img').each(function(){
			 		if ( jQuery(this).attr("src") == "" || jQuery(this).attr("src") ==  "assets/images/blank.gif" )
					{	
						jQuery(this).parent().remove();
					}
					else
					{
						_imageListingItem.push(jQuery(this).parent())
					}
				})

				/*jQuery('.imageList div').each(function(){
					if ( jQuery(this).attr("href") == "" || jQuery(this).attr("href") == "#")
					{	
						//jQuery(this).attr("target","_self")
						jQuery(this).removeAttr("href");
						jQuery(this).removeAttr("target");
						jQuery(this).css("cursor","default");
						//alert("_self");
						
					}
					else 
					{	//alert("_self2");
						jQuery(this).attr("target","_self")
					}
				})*/ 
		
		var _imageListingItem_total = _imageListingItem.length; 
		jQuery(_imageListingItem).each(function(i){ 
				
				var zindex = (_imageListingItem_total - i) + 1;
				jQuery(this).css("z-index",zindex);
				
		}) 
		if (_imageListingItem_total > 1)
			
			{
				var timeout;
				if (options.showStrip)
					{
						jQuery(element).append('<div class="btn_outer"></div>');
						//jQuery(element).append('<ul class=' + options.imagestripClass + '></ul>');
						jQuery(document.createElement("ul")).addClass(options.imagestripClass).appendTo(".btn_outer");
						// Append Image in Image Strip
						jQuery(_imageListingItem).each(function(i){ 
						if(i==0)
						{
								jQuery(document.createElement("li")).addClass('first next active')
						
						.hover(function(){ jQuery(this).addClass("hover") },function(){ jQuery(this).removeClass("hover") })
						.click(function(){ changeImages((i + 1)) })
						.html('<span id='+"slideNumber" + i+'>'+ (i + 1) +'</span>')
						.appendTo("." + options.imagestripClass)
							}
							else
							{
						jQuery(document.createElement("li")).addClass('next'+i)
						
						.hover(function(){ jQuery(this).addClass("hover") },function(){ jQuery(this).removeClass("hover") })
						.click(function(){ changeImages((i + 1)) })
						.html('<span id='+"slideNumber" + i+'>'+ (i + 1) +'</span>')
						.appendTo("." + options.imagestripClass)}
						
						
						})
					}
				
				function changeImages(object){ 	
					jQuery('.imageStrip li').removeClass("first");
					var activeIndex;
					if (object == 0) { object = 1 }
					if (object > _imageListingItem_total) { object = 1 }
					jQuery('.imageList div.outer').not(jQuery('.imageList div:nth-child(' + options.currentImgActive + ')')).css("display","none"); 
					
								 $('.imageStrip li').each(function(index) {
    							
									if($(this).is(".active"))activeIndex = index+1;
  								});
								 
								 if(activeIndex == object)return false;

					for(i=1;i<=_imageListingItem_total;i++)
					{
							jQuery(this).backMe("img"+i);
					}
					jQuery(".slidecon").css({"display":"none"});
		
			//jQuery(this).backMe(jQuery('.imageList div').not(jQuery('.imageList div:nth-child(' + options.currentImgActive + ')')).children("img").attr("id")); 		
					
					jQuery(jQuery('.imageList div.outer:nth-child(' + options.currentImgActive + ')')).css("z-index",0);
					jQuery(jQuery('.imageList div.outer:nth-child(' + options.currentImgActive + ')')).css("display","none");
					
				//jQuery(jQuery('.imageList div.outer:nth-child(' + options.currentImgActive + ')')).css("display","none");	
					
					jQuery(jQuery('.imageList div.outer:nth-child(' + object + ')')).css("z-index",1000);
					jQuery('.imageStrip li').removeClass("active");
					jQuery(jQuery('.imageStrip li:nth-child(' + object + ')')).addClass("active");
					jQuery(jQuery('.imageList div.outer:nth-child(' + object + ')')).stop().fadeIn(options.speed);
					
					jQuery(this).insertMe(jQuery('.imageList div.outer:nth-child(' + object + ')').children("img").attr("id"));
					jQuery(this).animateMe(jQuery('.imageList div.outer:nth-child(' + object + ')').children("div.slidecon"));
					//alert(jQuery('.imageList div.outer:nth-child(' + object + ')').children("div").children("div.slidecon").html());
					//insertMe
					
					options.currentImgActive = object;	
					clearTimeout(timeout)
					if (options.auto)
						{		
							autoChange()
						}
					}
					
				
				function autoChange(){		  
					timeout = setTimeout(function(){ changeImages(options.currentImgActive + 1);},options.pause);		
				}
				
				if (options.auto){autoChange();}
			}
		});
	};
})(jQuery);

 jQuery(window).load(function(){ 
								jQuery(this).insertMe("img1");								
								jQuery(".imageList .outer:first .slidecon").stop().fadeIn(1000);
								
								
	 jQuery('#slideshow').slideshow(); 
	
	 //var obj = "";
	// obj = jQuery(".imageList div:first-child .slidecon")
	// jQuery(this).animateMe(obj);
  });
 
jQuery.fn.insertMe = function (myValue) {
	jQuery('#loader').hide();
		jQuery('#'+myValue).stop().animate({	
  		/*  opacity: 0.50,*/
    	width:"960px",
    	height: "545px",
		bottom: "55px",
		right:"0px"
		
  }, 2000, function() {
	  return ;
  	//jQuery("#change").html(jQuery(this).attr("id"));
	//alert("animation complete");
  })
};
jQuery.fn.animateMe = function(obj)
{
	jQuery(obj).stop().fadeIn(2000);
}

jQuery.fn.backMe = function (myValue) {
    jQuery('#'+myValue).css({"width":"236px","height":"157px","bottom": "200px", "right":"100px" });
};

jQuery.fn.outMe = function(){
	
	jQuery(".outer").fadeOut("slow");
}
jQuery(window).load(function(){
								jQuery("#loader").hide();
								jQuery("#pageLoader").hide();
								})

