var MainSlider;//plugin(function($){	var Slider = function(obj, width, speed)	{		//constants		this.DIV = obj;		this.WIDTH = width;		this.SPEED = speed;				//call constractor		this.init();		};		Slider.prototype = {				SlidesNumber : 0,		CurrentSlide : 0,		SliderAnchor: window.location.hash,				//jump		jump: function(slidename)		{						var slidePos;			this.CurrentSlide = this.GetSlideIndexBySlideName(slidename);										slidePos = -1*this.WIDTH *this.CurrentSlide;									this.DIV.find("ul#SlideShowUl").css("left", slidePos);			},					//constractor		init: function()		{			var handler = this;						this.SlidesNumber = this.DIV.find("ul#SlideShowUl div.Slide").length;			this.DIV.find("ul#SlideShowUl").css("width", 539*this.SlidesNumber);						//click left arrow --------------------------			this.DIV.find("a#leftArrow").click(function()			{				var NextSlide, animateArgs, NextPos;				$("div#BuyHiddenWrapper").hide();				$("div.slideText2").removeClass().addClass("slideText2");								if(eval(handler.CurrentSlide) - 1 >= 0)				{										NextSlide = eval(handler.CurrentSlide) - 1;                    					NextPos = -1*handler.WIDTH *NextSlide;										animateArgs = {left:NextPos};  					handler.DIV.find("ul#SlideShowUl").animate(animateArgs, handler.SPEED);					handler.CurrentSlide = eval(handler.CurrentSlide) - 1; 					window.location.replace("#" + $("ul#SlideShowUl div.Slide:eq(" + handler.CurrentSlide + ") table.slideTbl").attr("slidename"));				}					return false;			});				//click right arrow --------------------------			this.DIV.find("a#rightArrow").click(function()			{				var NextSlide, animateArgs, NextPos;				$("div#BuyHiddenWrapper").hide();				$("div.slideText2").removeClass().addClass("slideText2");								//get next slide				if(eval(handler.CurrentSlide) + 1 < handler.SlidesNumber)				{   										NextSlide = eval(handler.CurrentSlide) + 1;					NextPos = -1*handler.WIDTH *NextSlide;										animateArgs = {left:NextPos};  										handler.DIV.find("ul#SlideShowUl").animate(animateArgs, handler.SPEED);					handler.CurrentSlide = eval(handler.CurrentSlide) + 1;					window.location.replace("#" + $("ul#SlideShowUl div.Slide:eq(" + handler.CurrentSlide + ") table.slideTbl").attr("slidename"));				}									return false;			});							//click bullets			$("div#AjaxLoaderLight ul.SliderList a.scrollerLink").click(function()			{				$("div#BuyHiddenWrapper").hide();				var slidname = $(this).attr("href").replace("#", "");				handler.jump(slidname);			});			//init first anchor (onload)			this.init_anchor();		},				//init anchor		init_anchor: function()		{			if(this.SliderAnchor == "" || this.SliderAnchor.replace("#", "")  == "")			{				return;			}			else			{								this.SliderAnchor = this.SliderAnchor.replace("#", "");										this.jump(this.SliderAnchor);			}		},						//		GetSlideIndexBySlideName: function(_slidename)		{			var slidename;			var slides = this.DIV.find("div.Slide table.slideTbl");			var counter = 0;			var index = 0;						slides.each(function()			{				slidename = $(this).attr("slidename");								if(slidename != undefined && slidename == _slidename)						index = counter;											counter ++;			});							return index;				}	}			$.fn.PluginsSlider = function(width, speed)	{		var slider = new Slider(this, width, speed);		return slider;	}})(jQuery);//call plugin$("document").ready(function(){	var cat;		//get category id	cat = $("ul#SlideShowUl li").attr("id").replace("Category", "");			//load th content with ajax	$.post("../html/ajax.aspx", {id:cat}, AjaxResponse, "html");		//load the bullets with ajax	$.post("../html/ajax_bullets.aspx", {id:cat}, AjaxBulletsResponse, "html"); 	});function AjaxResponse(html){	//debug	//alert(html);	$("body").click(function(event)	{				if(!$(event.target).is('#BuyHiddenWrapper'))		{				$("div#BuyHiddenWrapper").hide();				$("div.slideText2").removeClass().addClass("slideText2");		}	});				//set html		$("#SlideShowUl").html(html);		MainSlider = $("div#NewSlider").PluginsSlider(539, 1000);		//lightbox		$("table.slideTbl a[jrel='prettyPhoto']").prettyPhoto();		//buy menus	$("div#SlideShow div.Slide div.slideText2 a.BuyBtn").click(function(e)	{				var offset;				e.stopPropagation();				if($("div#BuyHiddenWrapper").is(":hidden"))		{			offset = $(this).offset(); //.parent().find("div.HiddenBuyMenu")				$("div#BuyHiddenWrapper").css("left", offset.left - 1);			$("div#BuyHiddenWrapper").css("top", offset.top + 17);			document.getElementById("BuyHiddenWrapper").innerHTML = $(this).parent().find("div.HiddenBuyMenu").html();			$("div#BuyHiddenWrapper").show();						//set buy button style			$(this).removeClass().parent().addClass("slideText2Active");			//$(this).parent().css("padding", "padding: 0px 0px 0px 0px;");		}			else		{			$("div#BuyHiddenWrapper").hide();						//set buy button style			$(this).parent().removeClass().addClass("slideText2");			//$(this).parent().css("padding", "padding: 1px 1px 1px 1px;");		}			return false;	});		}function AjaxBulletsResponse(html){	//debug	//alert(html);		//set html	$("#AjaxLoaderLight").html(html);}