// JavaScript Document



function KrisnaSlider(objid,gsfw,gsfh,fq,src_left_arrow,src_right_arrow,padding_arrow)

{

		var gallery_strip_frame_w = gsfw;

		var gallery_strip_frame_h = gsfh;

		var frame_qty = fq;

		var gallery_strip_w = gallery_strip_frame_w * frame_qty;

		

		$("#"+objid).css("width",gsfw+"px");

		$("#"+objid).before('<div class="prev"><img src="'+src_left_arrow+'" alt="" /></div>');

		$("#"+objid).after('<div class="next"><img src="'+src_right_arrow+'" alt="" /></div>');

		$("#"+objid).next().css("width","25px");

		$("#"+objid).next().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().css("width","25px");

		$("#"+objid).prev().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().find("img").css("padding-top",padding_arrow+"px");

		$("#"+objid).next().find("img").css("padding-top",padding_arrow+"px");



		if(fq<=1)

			$("#"+objid).next().find("img").hide();

			

		$("#"+objid).prev().find("img").hide();

		$("#"+objid+" > ul").width(gallery_strip_w);

		

		$("#"+objid).next().find("img").click(function(){

			$("#"+objid).prev().find("img").fadeIn(500);	

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin <= (-(frame_qty-1)*gallery_strip_frame_w))

				return;

			set_margin = parseInt(int_margin) - gallery_strip_frame_w;

			if(set_margin <= -((frame_qty-1)*gallery_strip_frame_w))

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});

		$("#"+objid).prev().find("img").click(function(){

			$("#"+objid).next().find("img").fadeIn(500);					  

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin >= 0)

				return;

			set_margin = parseInt(int_margin) + gallery_strip_frame_w;

			if(set_margin >= 0)

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});	

}



function KrisnaSlider2(objid,gsfw,gsfh,fq,src_left_arrow,src_right_arrow,padding_arrow,px_geser)

{

		var gallery_strip_frame_w = gsfw;

		var gallery_strip_frame_h = gsfh;

		var frame_qty = fq;

		var gallery_strip_w = gallery_strip_frame_w * frame_qty;

		

		$("#"+objid).css("width",gsfw+"px");

		$("#"+objid).before('<div class="prev"><img src="'+src_left_arrow+'" alt="" /></div>');

		$("#"+objid).after('<div class="next"><img src="'+src_right_arrow+'" alt="" /></div>');

		$("#"+objid).next().css("width","25px");

		$("#"+objid).next().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().css("width","25px");

		$("#"+objid).prev().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().find("img").css("padding-top",padding_arrow+"px");

		$("#"+objid).next().find("img").css("padding-top",padding_arrow+"px");



		if(fq<=1)

			$("#"+objid).next().find("img").hide();

			

		$("#"+objid).prev().find("img").hide();

		$("#"+objid+" > ul").width(gallery_strip_w);

		

		$("#"+objid).next().find("img").click(function(){

			$("#"+objid).prev().find("img").fadeIn(500);	

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin <= (-(frame_qty-1)*gallery_strip_frame_w))

				return;

			//set_margin = parseInt(int_margin) - gallery_strip_frame_w;

			set_margin = parseInt(int_margin) - px_geser;

			if(set_margin <= -((frame_qty-1)*gallery_strip_frame_w))

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});

		$("#"+objid).prev().find("img").click(function(){

			$("#"+objid).next().find("img").fadeIn(500);					  

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin >= 0)

				return;

			//set_margin = parseInt(int_margin) + gallery_strip_frame_w;

			set_margin = parseInt(int_margin) + px_geser;

			if(set_margin >= 0)

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});	

}

function KrisnaSlider20(objid,gsfw,gsfh,fq,src_left_arrow,src_right_arrow,padding_arrow,px_geser)

{

		var gallery_strip_frame_w = gsfw;

		var gallery_strip_frame_h = gsfh;

		var frame_qty = fq;

		var gallery_strip_w = px_geser * frame_qty;

		

		$("#"+objid).css("width",gsfw+"px");

		$("#"+objid).before('<div class="prev"><img src="'+src_left_arrow+'" alt="" /></div>');

		$("#"+objid).after('<div class="next"><img src="'+src_right_arrow+'" alt="" /></div>');

		$("#"+objid).next().css("width","25px");

		$("#"+objid).next().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().css("width","25px");

		$("#"+objid).prev().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().find("img").css("padding-top",padding_arrow+"px");

		$("#"+objid).next().find("img").css("padding-top",padding_arrow+"px");



		if(fq<=1)

			$("#"+objid).next().find("img").hide();

			

		$("#"+objid).prev().find("img").hide();

		$("#"+objid+" > ul").width(gallery_strip_w);

		

		$("#"+objid).next().find("img").click(function(){

			$("#"+objid).prev().find("img").fadeIn(500);	

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin <= (-(frame_qty-3)*px_geser))

				return;

			//set_margin = parseInt(int_margin) - gallery_strip_frame_w;

			set_margin = parseInt(int_margin) - px_geser;

			if(set_margin <= -((frame_qty-3)*px_geser))

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});

		$("#"+objid).prev().find("img").click(function(){

			$("#"+objid).next().find("img").fadeIn(500);					  

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin >= 0)

				return;

			//set_margin = parseInt(int_margin) + gallery_strip_frame_w;

			set_margin = parseInt(int_margin) + px_geser;

			if(set_margin >= 0)

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});	

}



function KrisnaSlider3(objid,gsfw,gsfh,fq,src_left_arrow,src_right_arrow,padding_arrow,px_geser,n_image,i_limit)

{

		var gallery_strip_frame_w = gsfw;

		var gallery_strip_frame_h = gsfh;

		var frame_qty = fq;

		var gallery_strip_w = gallery_strip_frame_w * frame_qty;

		

		$("#"+objid).css("width",gsfw+"px");

		$("#"+objid).before('<div class="prev"><img src="'+src_left_arrow+'" alt="" /></div>');

		$("#"+objid).after('<div class="next"><img src="'+src_right_arrow+'" alt="" /></div>');

		$("#"+objid).next().css("width","25px");

		$("#"+objid).next().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().css("width","25px");

		$("#"+objid).prev().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().find("img").css("padding-top",padding_arrow+"px");

		$("#"+objid).next().find("img").css("padding-top",padding_arrow+"px");



		if(fq<=1)

			$("#"+objid).next().find("img").hide();

			

		$("#"+objid).prev().find("img").hide();

		$("#"+objid+" > ul").width(gallery_strip_w);

		

		$("#"+objid).next().find("img").click(function(){

			$("#"+objid).prev().find("img").fadeIn(500);	

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin <= -((n_image-i_limit)*px_geser))

				return;

			//set_margin = parseInt(int_margin) - gallery_strip_frame_w;

			set_margin = parseInt(int_margin) - px_geser;

			if(set_margin <= -((n_image-i_limit)*px_geser))

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});

		$("#"+objid).prev().find("img").click(function(){

			$("#"+objid).next().find("img").fadeIn(500);					  

			margin = $("#"+objid+" > ul").css("margin-left");

			int_margin = margin.replace("px","");

			if(int_margin >= 0)

				return;

			//set_margin = parseInt(int_margin) + gallery_strip_frame_w;

			set_margin = parseInt(int_margin) + px_geser;

			if(set_margin >= 0)

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginLeft: set_margin }, 

				600

			);				

		});	

}



function KrisnaVerticalSlider(objid,gsfw,gsfh,fq,src_up_arrow,src_down_arrow,padding_arrow)

{

		var gallery_strip_frame_w = gsfw;

		var gallery_strip_frame_h = gsfh;

		var frame_qty = fq;

		var gallery_strip_h = gallery_strip_frame_h * frame_qty;

		

		$("#"+objid).css("width",gsfw+"px");

		$("#"+objid).before('<div class="prev"><img src="'+src_up_arrow+'" alt="" /></div>');

		$("#"+objid).after('<div class="next"><img src="'+src_down_arrow+'" alt="" /></div>');

		

		/*

		$("#"+objid).next().css("width","25px");

		$("#"+objid).next().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().css("width","25px");

		$("#"+objid).prev().css("height",gallery_strip_frame_h+"px");

		*/

		

		$("#"+objid).prev().find("img").css("padding-top",padding_arrow+"px");

		$("#"+objid).next().find("img").css("padding-top",padding_arrow+"px");



		if(fq<=1)

			$("#"+objid).next().find("img").hide();

			

		$("#"+objid).prev().find("img").hide();

		$("#"+objid+" > ul").height(gallery_strip_h);



		$("#"+objid).next().find("img").click(function(){

			$("#"+objid).prev().find("img").fadeIn(500);	

			margin = $("#"+objid+" > ul").css("margin-top");

			int_margin = margin.replace("px","");

			if(int_margin <= (-(frame_qty-1)*gallery_strip_frame_h))

				return;

			set_margin = parseInt(int_margin) - gallery_strip_frame_h;

			if(set_margin <= -((frame_qty-1)*gallery_strip_frame_h))

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginTop: set_margin }, 

				600

			);				

		});

		$("#"+objid).prev().find("img").click(function(){

			$("#"+objid).next().find("img").fadeIn(500);					  

			margin = $("#"+objid+" > ul").css("margin-top");

			int_margin = margin.replace("px","");

			if(int_margin >= 0)

				return;

			set_margin = parseInt(int_margin) + gallery_strip_frame_h;

			if(set_margin >= 0)

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginTop: set_margin }, 

				600

			);				

		});	

}



function KrisnaVerticalSlider2(objid,gsfw,gsfh,fq,src_up_arrow,src_down_arrow,padding_arrow,px_geser)

{

		var gallery_strip_frame_w = gsfw;

		var gallery_strip_frame_h = gsfh;

		var frame_qty = fq;

		var gallery_strip_h = gallery_strip_frame_h * frame_qty;

		

		$("#"+objid).css("width",gsfw+"px");

		$("#"+objid).before('<div class="prev"><img src="'+src_up_arrow+'" alt="" /></div>');

		$("#"+objid).after('<div class="next"><img src="'+src_down_arrow+'" alt="" /></div>');

		

		/*

		$("#"+objid).next().css("width","25px");

		$("#"+objid).next().css("height",gallery_strip_frame_h+"px");

		$("#"+objid).prev().css("width","25px");

		$("#"+objid).prev().css("height",gallery_strip_frame_h+"px");

		*/

		

		$("#"+objid).prev().find("img").css("padding-top",padding_arrow+"px");

		$("#"+objid).next().find("img").css("padding-top",padding_arrow+"px");



		if(fq<=1)

			$("#"+objid).next().find("img").hide();

			

		$("#"+objid).prev().find("img").hide();

		$("#"+objid+" > ul").height(gallery_strip_h);



		$("#"+objid).next().find("img").click(function(){

			$("#"+objid).prev().find("img").fadeIn(500);	

			margin = $("#"+objid+" > ul").css("margin-top");

			int_margin = margin.replace("px","");

			if(int_margin <= (-(frame_qty-1)*gallery_strip_frame_h))

				return;

			set_margin = parseInt(int_margin) - px_geser;

			if(set_margin <= -((frame_qty-1)*gallery_strip_frame_h))

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginTop: set_margin }, 

				600

			);				

		});

		$("#"+objid).prev().find("img").click(function(){

			$("#"+objid).next().find("img").fadeIn(500);					  

			margin = $("#"+objid+" > ul").css("margin-top");

			int_margin = margin.replace("px","");

			if(int_margin >= 0)

				return;

			set_margin = parseInt(int_margin) + px_geser;

			if(set_margin >= 0)

				$(this).fadeOut(200);

			$("#"+objid+" > ul").animate(

				{ marginTop: set_margin }, 

				600

			);				

		});	

}


