function scroll(direction){
	if(direction=='prev'){
		$("#product-nav > div").each(function(){
			if($(this).hasClass("dot")){
				if($(this).hasClass("active")){
					array = $(this).attr("id").split("-");
					$(this).removeClass("active");
					if(array[1]==1){
						next = 3;
					} else {
						next = parseFloat(array[1]) - 1;
					}
					$("#dot-"+next).addClass("active");
					$("#banner-"+array[1]).fadeOut("slow");
					$("#banner-"+next).fadeIn("slow");
					return false;
				}
			}
		});
	}
	if(direction=='next'){
		$("#product-nav > div").each(function(){
			if($(this).hasClass("dot")){
				if($(this).hasClass("active")){
					array = $(this).attr("id").split("-");
					$(this).removeClass("active");
					if(array[1]==3){
						next = 1;
					} else {
						next = parseFloat(array[1]) + 1;
					}
					$("#dot-"+next).addClass("active");
					$("#banner-"+array[1]).fadeOut("slow");
					$("#banner-"+next).fadeIn("slow");
					return false;
				}
			}
		});
	}
	if(direction>0){
		$("#product-nav > div").each(function(){
			if($(this).hasClass("dot")){
				if($(this).hasClass("active")){
					$(this).removeClass("active");
				}
			}
		});
		$("#banner-images > div").each(function(){
			if($(this).hasClass("active")){
				$(this).removeClass("active");
				$(this).fadeOut("slow");
			}
		});
		$("#dot-"+direction).addClass("active");
		$("#banner-"+direction).addClass("active");
		$("#banner-"+direction).fadeIn("slow");
		return false;
	}
}

function closeModal(){
	$.modal.close();
}

function openModal(id){
	$('#'+id).modal({
		overlay:80,
		overlayCss: {backgroundColor:"#fff"},
		overlayClose:true
	});
}
