//js document
$(document).ready(function(){	
	$('#slider_it').nivoSlider();
	showmenu(".click",".menu",".catelist",".floatdiv","mhover","hovercate");//显示menu菜单 by 2011-07-26
	showcate(".menu",".catelist",".floatdiv","mhover","hovercate");//显示menu二级菜单 by 2011-07-26
	lg("#attrib-52","value","TT.MM.YYYY","clas");	//20110711 wang 在婚纱日期文本框中添加一个默认日期
	rollX(".roll_0");/* 首页订单滚动 */
	rollX(".roll_1");/* 首页订单滚动 */
	tabFun(".roll_ol","roll_cur",".roll")/* 首页订单滚动选项卡 */
});
function showmenu(title,menu,cate,floatdiv,mhover,hovercate){//show menu by 2011-07-26
	$(title).hover(function(){
		$(menu).show();
		showcate(menu,cate,floatdiv,mhover,hovercate);
	},function(){
		$(menu).hide();
	})
}
function showcate(menu,cate,floatdiv,mhover,hovercate){//show cate by 2011-07-26
	$(menu).find(cate).each(function(i){
		$(this).hover(function(){
			$(this).addClass(hovercate);
			$(this).find(floatdiv).each(function(j){
				$(this).addClass(mhover);
			})
		},function(){
			$(this).removeClass(hovercate);
			$(this).find(floatdiv).each(function(k){
				$(this).removeClass(mhover);
			})
		})
	})
}
function rollText_new(num){
	if(num==1){
		document.getElementById("rollTextMenu1").style.display="none";
		document.getElementById("rollTextMenu2").style.display="block";
	}else{
		document.getElementById("rollTextMenu2").style.display="none";
		document.getElementById("rollTextMenu1").style.display="block";
	}                    
}
function check_nl_subscribe_form(){
	return $('#nl_subscribe_form').valid();
}

//20110711 wang 在婚纱日期文本框中添加一个默认日期
function lg(wx,vae,d,clas){
	$(wx).attr(vae,d);
	$(wx).blur(function(){
		if (this.value == ''){
			this.value = d;
		}
	});
	$(wx).focus(function(){
		if (this.value == d){
			this.value = '';
			$(this).addClass(clas);
		}
	});
}

function rollX(lg){//滚动名单
	var _wrap=$(lg);
	var _interval=3000;
	var _moving;
	_wrap.hover(function(){
		clearInterval(_moving);
	},function(){
		_moving=setInterval(function(){
			var _field=_wrap.find('li:first');
			var _h=_field.height();
			_field.animate({marginTop:-_h+'px'},2000,function(){
				_field.css('marginTop','15px').appendTo(_wrap);
			})
		},_interval)
	}).trigger('mouseleave');
}
function tabFun(tagname,tagbg,tabcont){//选项卡
	$(tagname).children("li").each(function(i){
		$(this).click(function(){
			$(this).siblings().removeClass(tagbg);
			$(this).addClass(tagbg);
			for (j=0; j<$(tabcont).children("ul").length; j++){
				if(j==i){
					$(tabcont).children("ul").hide();
					$(tabcont+"_"+j).show();
				}
			}
		})
	})
}
$('#small_tb').hover(function(){
       $('#small_tb').css('cursor','pointer');
       $('#dayun').slideDown("200");
});

$('#dayun').hover(function(){},function(){
       $('#dayun').css('cursor','pointer');
       $('#dayun').slideUp("200");
});

$('#hai_note').css('color','red');
$('#hai_note').live('mouseover',function(){
		  $('#hai_note').css('cursor','pointer');
		});
$('#hai_note').live('click',function(){									 
if($('#hai_info').css('display') == 'none')
{
   $('#hai_info').show(1000);
   $('#hai_note').html('Cerrar');
}
else if($('#hai_info').css('display') == 'block'){
	$('#hai_note').html('En savoir plus');
	$('#hai_info').hide("slow");
	}
});


// 2011 9.01 运输方式，点击弹出内容
$('#cus_note').live('click',function(){
if($('#cus_info').css('display') == 'none')
	{
		$('#cus_info').show("slow");
		$('#cus_note').html('[Schließen]');
	}
else if($('#cus_info').css('display') == 'block'){
		$('#cus_note').html('[Mehr]');
		$('#cus_info').hide("slow");
	}
});


$('#wen_note').live('click',function(){
if($('#wen_info').css('display') == 'none')
	{
		$('#wen_info').show("slow");
		$('#wen_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="13">');
	}
else if($('#wen_info').css('display') == 'block'){
		$('#wen_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="13">');
		$('#wen_info').hide("slow");
	}
});


$('#wen_j_note').live('click',function(){
if($('#wen_j_info').css('display') == 'none')
	{
		$('#wen_j_info').show("slow");
		$('#wen_j_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
	}
else if($('#wen_j_info').css('display') == 'block'){
		$('#wen_j_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
		$('#wen_j_info').hide("slow");
	}
});


$('#wen_o_note').live('click',function(){
if($('#wen_o_info').css('display') == 'none')
	{
		$('#wen_o_info').show("slow");
		$('#wen_o_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="13" height="13">');
	}
else if($('#wen_o_info').css('display') == 'block'){
		$('#wen_o_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="13" height="13">');
		$('#wen_o_info').hide("slow");
	}
});


$('#wen_t_note').live('click',function(){
if($('#wen_t_info').css('display') == 'none')
	{
		$('#wen_t_info').show("slow");
		$('#wen_t_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
	}
else if($('#wen_t_info').css('display') == 'block'){
		$('#wen_t_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
		$('#wen_t_info').hide("slow");
	}
});

$('#wen_hk_note').live('click',function(){
if($('#wen_hk_info').css('display') == 'none')
	{
		$('#wen_hk_info').show("slow");
		$('#wen_hk_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
	}
else if($('#wen_hk_info').css('display') == 'block'){
		$('#wen_hk_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
		$('#wen_hk_info').hide("slow");
	}
});

$('#wen_ems_note').live('click',function(){
if($('#wen_ems_info').css('display') == 'none')
	{
		$('#wen_ems_info').show("slow");
		$('#wen_ems_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
	}
else if($('#wen_ems_info').css('display') == 'block'){
		$('#wen_ems_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
		$('#wen_ems_info').hide("slow");
	}
});

$('#wen_zh_f_note').live('click',function(){
if($('#wen_zh_f_info').css('display') == 'none')
	{
		$('#wen_zh_f_info').show("slow");
		$('#wen_zh_f_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
	}
else if($('#wen_zh_f_info').css('display') == 'block'){
		$('#wen_zh_f_note').html('<img src="includes/templates/blackcool/images/stock_inquiry.png" alt="" width="12" height="12">');
		$('#wen_zh_f_info').hide("slow");
	}
});
//add du 2011.9.1 star
function showbtmtable(){
	$('#btnuptable').toggle("slow"); 
}
function newslettersub(){
	 var email = document.getElementById("email");
	 var re = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/g);
	 if(email.value==""){ 
		alert("Bitte Ihre Emailadresse eingeben!");
	 	email.focus(); 
		return false; 
	} 
	if(!re.test(email.value)){ 
		alert("Bitte Ihre Emailadresse eingeben!");
		email.focus();
	 	return false; 
	}
	document.subscribe.submit(); 
}
//add du 2011.9.1 end

//zhengcongzhen 20110916 begin
function GetJsData(url, callback) {  
    var scripts = document.createElement('script');  
    document.body.appendChild(scripts);  
  
    scripts.onload = function() {  
       // isok();  
       // document.body.removeChild(this);  
    };  
    scripts.onreadystatechange = function() {  
        if (this.readyState == "loaded") {  
        //    isok();  
        //    document.body.removeChild(this);  
        }  
    };  
    scripts.charset = "utf-8";  
    scripts.src = url;  
}
//zhengcongzhen 20110916 end

//<!--back 20110706 hezhen-->
$(document).ready(function(){
        
		$('#top_left').hover(
            function(){ $('#top_right').show(); },
            function(){ $('#top_right').hide();}

);
//<!--back 20110706 hezhen-->		
});  

//zhengcongzhen 20110916 begin
/**IE6 png格式图片透明背景处理**/
function correctPNG(){
	for(var i=0; i<document.images.length; i++){
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}
if(window.attachEvent){window.attachEvent("onload", correctPNG);}
//zhengcongzhen 20110916 end

//zhengcongzhen 20111006 begin
/*Flat level directory dynamic banner*/
/*
 * jQuery Nivo Slider v2.3
 * http://nivo.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */

(function(b){var a=function(j,q){var g=b.extend({},b.fn.nivoSlider.defaults,q);var m={currentSlide:0,currentImage:"",totalSlides:0,randAnim:"",running:false,paused:false,stop:false};var d=b(j);d.data("nivo:vars",m);d.css("position","relative");d.addClass("nivoSlider");var e=d.children();e.each(function(){var t=b(this);var s="";if(!t.is("img")){if(t.is("a")){t.addClass("nivo-imageLink");s=t}t=t.find("img:first")}var r=t.width();if(r==0){r=t.attr("width")}var i=t.height();if(i==0){i=t.attr("height")}if(r>d.width()){d.width(r)}if(i>d.height()){d.height(i)}if(s!=""){s.css("display","none")}t.css("display","none");m.totalSlides++});if(g.startSlide>0){if(g.startSlide>=m.totalSlides){g.startSlide=m.totalSlides-1}m.currentSlide=g.startSlide}if(b(e[m.currentSlide]).is("img")){m.currentImage=b(e[m.currentSlide])}else{m.currentImage=b(e[m.currentSlide]).find("img:first")}if(b(e[m.currentSlide]).is("a")){b(e[m.currentSlide]).css("display","block")}d.css("background","url("+m.currentImage.attr("src")+") no-repeat");for(var k=0;k<g.slices;k++){var o=Math.round(d.width()/g.slices);if(k==g.slices-1){d.append(b('<div class="nivo-slice"></div>').css({left:(o*k)+"px",width:(d.width()-(o*k))+"px"}))}else{d.append(b('<div class="nivo-slice"></div>').css({left:(o*k)+"px",width:o+"px"}))}}d.append(b('<div class="nivo-caption"><p></p></div>').css({display:"none",opacity:g.captionOpacity}));if(m.currentImage.attr("title")!=""){var n=m.currentImage.attr("title");if(n.substr(0,1)=="#"){n=b(n).html()}b(".nivo-caption p",d).html(n);b(".nivo-caption",d).fadeIn(g.animSpeed)}var c=0;if(!g.manualAdvance&&e.length>1){c=setInterval(function(){p(d,e,g,false)},g.pauseTime)}if(g.directionNav){d.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');if(g.directionNavHide){b(".nivo-directionNav",d).hide();d.hover(function(){b(".nivo-directionNav",d).show()},function(){b(".nivo-directionNav",d).hide()})}b("a.nivo-prevNav",d).live("click",function(){if(m.running){return false}clearInterval(c);c="";m.currentSlide-=2;p(d,e,g,"prev")});b("a.nivo-nextNav",d).live("click",function(){if(m.running){return false}clearInterval(c);c="";p(d,e,g,"next")})}if(g.controlNav){var l=b('<div class="nivo-controlNav"></div>');d.append(l);for(var k=0;k<e.length;k++){if(g.controlNavThumbs){var f=e.eq(k);if(!f.is("img")){f=f.find("img:first")}if(g.controlNavThumbsFromRel){l.append('<a class="nivo-control" rel="'+k+'"><img src="'+f.attr("rel")+'" alt="" /></a>')}else{l.append('<a class="nivo-control" rel="'+k+'"><img src="'+f.attr("src").replace(g.controlNavThumbsSearch,g.controlNavThumbsReplace)+'" alt="" /></a>')}}else{l.append('<a class="nivo-control" rel="'+k+'">'+(k+1)+"</a>")}}b(".nivo-controlNav a:eq("+m.currentSlide+")",d).addClass("active");b(".nivo-controlNav a",d).live("click",function(){if(m.running){return false}if(b(this).hasClass("active")){return false}clearInterval(c);c="";d.css("background","url("+m.currentImage.attr("src")+") no-repeat");m.currentSlide=b(this).attr("rel")-1;p(d,e,g,"control")})}if(g.keyboardNav){b(window).keypress(function(i){if(i.keyCode=="37"){if(m.running){return false}clearInterval(c);c="";m.currentSlide-=2;p(d,e,g,"prev")}if(i.keyCode=="39"){if(m.running){return false}clearInterval(c);c="";p(d,e,g,"next")}})}if(g.pauseOnHover){d.hover(function(){m.paused=true;clearInterval(c);c=""},function(){m.paused=false;if(c==""&&!g.manualAdvance){c=setInterval(function(){p(d,e,g,false)},g.pauseTime)}})}d.bind("nivo:animFinished",function(){m.running=false;b(e).each(function(){if(b(this).is("a")){b(this).css("display","none")}});if(b(e[m.currentSlide]).is("a")){b(e[m.currentSlide]).css("display","block")}if(c==""&&!m.paused&&!g.manualAdvance){c=setInterval(function(){p(d,e,g,false)},g.pauseTime)}g.afterChange.call(this)});var p=function(r,s,u,x){var y=r.data("nivo:vars");if(y&&(y.currentSlide==y.totalSlides-1)){u.lastSlide.call(this)}if((!y||y.stop)&&!x){return false}u.beforeChange.call(this);if(!x){r.css("background","url("+y.currentImage.attr("src")+") no-repeat")}else{if(x=="prev"){r.css("background","url("+y.currentImage.attr("src")+") no-repeat")}if(x=="next"){r.css("background","url("+y.currentImage.attr("src")+") no-repeat")}}y.currentSlide++;if(y.currentSlide==y.totalSlides){y.currentSlide=0;u.slideshowEnd.call(this)}if(y.currentSlide<0){y.currentSlide=(y.totalSlides-1)}if(b(s[y.currentSlide]).is("img")){y.currentImage=b(s[y.currentSlide])}else{y.currentImage=b(s[y.currentSlide]).find("img:first")}if(u.controlNav){b(".nivo-controlNav a",r).removeClass("active");b(".nivo-controlNav a:eq("+y.currentSlide+")",r).addClass("active")}if(y.currentImage.attr("title")!=""){var z=y.currentImage.attr("title");if(z.substr(0,1)=="#"){z=b(z).html()}if(b(".nivo-caption",r).css("display")=="block"){b(".nivo-caption p",r).fadeOut(u.animSpeed,function(){b(this).html(z);b(this).fadeIn(u.animSpeed)})}else{b(".nivo-caption p",r).html(z)}b(".nivo-caption",r).fadeIn(u.animSpeed)}else{b(".nivo-caption",r).fadeOut(u.animSpeed)}var w=0;b(".nivo-slice",r).each(function(){var i=Math.round(r.width()/u.slices);b(this).css({height:"0px",opacity:"0",background:"url("+y.currentImage.attr("src")+") no-repeat -"+((i+(w*i))-i)+"px 0%"});w++});if(u.effect=="random"){var A=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade");y.randAnim=A[Math.floor(Math.random()*(A.length+1))];if(y.randAnim==undefined){y.randAnim="fade"}}if(u.effect.indexOf(",")!=-1){var A=u.effect.split(",");y.randAnim=b.trim(A[Math.floor(Math.random()*A.length)])}y.running=true;if(u.effect=="sliceDown"||u.effect=="sliceDownRight"||y.randAnim=="sliceDownRight"||u.effect=="sliceDownLeft"||y.randAnim=="sliceDownLeft"){var t=0;var w=0;var C=b(".nivo-slice",r);if(u.effect=="sliceDownLeft"||y.randAnim=="sliceDownLeft"){C=b(".nivo-slice",r)._reverse()}C.each(function(){var i=b(this);i.css("top","0px");if(w==u.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},u.animSpeed,"",function(){r.trigger("nivo:animFinished")})},(100+t))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},u.animSpeed)},(100+t))}t+=50;w++})}else{if(u.effect=="sliceUp"||u.effect=="sliceUpRight"||y.randAnim=="sliceUpRight"||u.effect=="sliceUpLeft"||y.randAnim=="sliceUpLeft"){var t=0;var w=0;var C=b(".nivo-slice",r);if(u.effect=="sliceUpLeft"||y.randAnim=="sliceUpLeft"){C=b(".nivo-slice",r)._reverse()}C.each(function(){var i=b(this);i.css("bottom","0px");if(w==u.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},u.animSpeed,"",function(){r.trigger("nivo:animFinished")})},(100+t))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},u.animSpeed)},(100+t))}t+=50;w++})}else{if(u.effect=="sliceUpDown"||u.effect=="sliceUpDownRight"||y.randAnim=="sliceUpDown"||u.effect=="sliceUpDownLeft"||y.randAnim=="sliceUpDownLeft"){var t=0;var w=0;var B=0;var C=b(".nivo-slice",r);if(u.effect=="sliceUpDownLeft"||y.randAnim=="sliceUpDownLeft"){C=b(".nivo-slice",r)._reverse()}C.each(function(){var i=b(this);if(w==0){i.css("top","0px");w++}else{i.css("bottom","0px");w=0}if(B==u.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},u.animSpeed,"",function(){r.trigger("nivo:animFinished")})},(100+t))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},u.animSpeed)},(100+t))}t+=50;B++})}else{if(u.effect=="fold"||y.randAnim=="fold"){var t=0;var w=0;b(".nivo-slice",r).each(function(){var i=b(this);var v=i.width();i.css({top:"0px",height:"100%",width:"0px"});if(w==u.slices-1){setTimeout(function(){i.animate({width:v,opacity:"1.0"},u.animSpeed,"",function(){r.trigger("nivo:animFinished")})},(100+t))}else{setTimeout(function(){i.animate({width:v,opacity:"1.0"},u.animSpeed)},(100+t))}t+=50;w++})}else{if(u.effect=="fade"||y.randAnim=="fade"){var w=0;b(".nivo-slice",r).each(function(){b(this).css("height","100%");if(w==u.slices-1){b(this).animate({opacity:"1.0"},(u.animSpeed*2),"",function(){r.trigger("nivo:animFinished")})}else{b(this).animate({opacity:"1.0"},(u.animSpeed*2))}w++})}}}}}};var h=function(i){if(this.console&&typeof console.log!="undefined"){console.log(i)}};this.stop=function(){if(!b(j).data("nivo:vars").stop){b(j).data("nivo:vars").stop=true;h("Stop Slider")}};this.start=function(){if(b(j).data("nivo:vars").stop){b(j).data("nivo:vars").stop=false;h("Start Slider")}};g.afterLoad.call(this)};b.fn.nivoSlider=function(c){return this.each(function(){var d=b(this);if(d.data("nivoslider")){return}var e=new a(this,c);d.data("nivoslider",e)})};b.fn.nivoSlider.defaults={effect:"random",slices:15,animSpeed:500,pauseTime:3000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};b.fn._reverse=[].reverse})(jQuery);
//zhengcongzhen 20111006 end

//zhengcongzhen 20111109 begin
$(document).ready(function(){
	$('.topseller_head ul li').live('hover',function(){
		$('.bestseller ul').eq($('.topseller_head ul li').index(this)).show().siblings().hide();
		$(this).addClass('hot_select');
		$(this).siblings().removeClass('hot_select');
		// alert($(this).html());
	});
});
//zhengcongzhen 20111109 end

//zhengcongzhen 20111021 begin
$(document).ready(function()
{
	if(getCookie('ItDoor')==null)
	{
		$('#glide_div').slideToggle(2000);
		setTimeout('down_draw()',5000);
	}	
});
function down_draw()
{
	$('#glide_div').slideToggle(2000);register('song');
}
function setCookie(name, value, expire) 
{
	window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function getCookie(Name) 
{
	var search = Name + "=";
	if (window.document.cookie.length > 0) { // if there are any cookies
	offset = window.document.cookie.indexOf(search);
	if (offset != -1) { // if cookie exists
	offset += search.length; // set index of beginning of value
	end = window.document.cookie.indexOf(";", offset) // set index of end of cookie value
	if (end == -1)
	end = window.document.cookie.length;
	return unescape(window.document.cookie.substring(offset, end));
	}
	}
	return null;
}

function register(name) 
{
	setCookie("ItDoor", name, null);
}
//zhengcongzhen 20111021 end

// add by liuyuan 20111129 guanligouwu start
function slideBar (name, max, speed, breite, leftbutton, rightbutton) {
    this.zbarposition = 0;
    this.zbarspeed = speed;
    this.zslidebar = document.getElementById(name);
    this.zleftbutton = document.getElementById(leftbutton);
    this.zrightbutton = document.getElementById(rightbutton);
    this.zslidebar.style.width = breite + 'px';
    this.zbarmin = 0;
    this.zbarmax = -(this.zslidebar.scrollWidth - max);
    this.zaktiv;
    this.tabsliderspeed = 50;
    this.tabslidersteps = 100;

    this.SetTabsliderspeed = function (newTabsliderspeed)
    {
        this.tabsliderspeed = newTabsliderspeed;
    }

    this.SetTabslidersteps = function (newTabslidersteps)
    {
        this.tabslidersteps = newTabslidersteps;
    }

    if (navigator.appName.indexOf("Explorer") != -1) {
        this.zbarspeed = this.zbarspeed * 3;
    } else if (navigator.appName.indexOf("Netscape") != -1) {
        this.zbarspeed = this.zbarspeed * 3;
    }

    this.ztabslideLeft = function (slide) {
        if (slide == 0 || slide == 'NaN' || slide == 'undefined' || slide == undefined) {
            slide = 300;
        }

        slide = slide - this.tabslidersteps;
        steps = this.tabslidersteps;
        if (slide < 0) {
            steps = (steps + slide);
        } else {
            if (slide <= 135) {
                steps = 35;
                slide = slide + this.tabslidersteps - 35;
            } else if (slide <= 205) {
                steps = 50;
                slide = slide + this.tabslidersteps - 50;
            } else if (slide <= 290) {
                steps = 75;
                slide = slide + this.tabslidersteps - 75;
            } else if (slide >= 590) {
                steps = 35;
                slide = slide + this.tabslidersteps - 35;
            } else if (slide >= 535) {
                steps = 50;
                slide = slide + this.tabslidersteps - 50;
            } else if (slide >= 465) {
                steps = 75;
                slide = slide + this.tabslidersteps - 75;
            }
        }
        this.zbarposition = this.zbarposition - steps;
        if (this.zbarposition <= this.zbarmax) {
            this.zbarposition = this.zbarmax;
            slide = 0;
            this.endArrowRight();
        }
        this.zslidebar.style.left =  this.zbarposition + 'px';

        if (slide > 0) {
            oThis = this;
            var scroller = function() {
                oThis.ztabslideLeft(slide)
            }
            setTimeout(scroller, this.tabsliderspeed);
        }
        this.startArrowLeft();
    }
    this.ztabslideRight = function (slide) {
        if (slide == 0 || slide == 'NaN' || slide == 'undefined' || slide == undefined) {
            slide = 300;
        }
        slide = slide - this.tabslidersteps;
        steps = this.tabslidersteps;
        if (slide < 0) {
            steps = (steps + slide);
        } else {
            if (slide <= 135) {
                steps = 35;
                slide = slide + this.tabslidersteps - 35;
            } else if (slide <= 205) {
                steps = 50;
                slide = slide + this.tabslidersteps - 50;
            } else if (slide <= 290) {
                steps = 75;
                slide = slide + this.tabslidersteps - 75;
            } else if (slide >= 590) {
                steps = 35;
                slide = slide + this.tabslidersteps - 35;
            } else if (slide >= 535) {
                steps = 50;
                slide = slide + this.tabslidersteps - 50;
            } else if (slide >= 465) {
                steps = 75;
                slide = slide + this.tabslidersteps - 75;
            }
        }
        this.zbarposition = this.zbarposition + steps;
        if (this.zbarposition >= this.zbarmin) {
            this.zbarposition = 0;
            slide = 0;
            this.endArrowLeft();
        }
        this.zslidebar.style.left =  this.zbarposition + 'px';
        if (slide > 0) {
            oThis = this;
            var scroller = function() {
                oThis.ztabslideRight(slide)
            }
            setTimeout(scroller, this.tabsliderspeed);
        }

        this.startArrowRight();
    }
    this.setzslideLeft = function  () {

        this.zslideLeft();
        var that = this;
        this.zaktiv = window.setInterval(function() {
            that.zslideLeft();
        }, this.zbarspeed);
    }
    this.zslideLeft = function () {
        if (this.zbarposition <= this.zbarmax) {
            this.zbarposition = this.zbarmax;
            this.endArrowRight();
            this.startArrowLeft();
        } else {
            if (navigator.appName.indexOf("Explorer") != -1) {
                if (navigator.userAgent.indexOf("IE 8") != -1)
                {
                    this.zbarposition = this.zbarposition - 5;
                }
                else
                {
                    this.zbarposition = this.zbarposition - 2;
                }
            } else if (navigator.appName.indexOf("Netscape") != -1) {
                this.zbarposition = this.zbarposition - 5;
            } else {
                this.zbarposition = this.zbarposition - 1;
            }
            this.startArrowLeft();
        }
        this.zslidebar.style.left =  this.zbarposition + 'px';
    }
    this.setzslideRight = function () {

        this.zslideRight();
        var that = this;
        this.zaktiv = window.setInterval(function() {
            that.zslideRight();
        }, this.zbarspeed);
    }
    this.zslideRight = function () {
        if (this.zbarposition >= this.zbarmin) {
            this.zbarposition = 0;
            this.endArrowLeft();
            this.startArrowRight();
        } else {
            if (navigator.appName.indexOf("Explorer") != -1) {
                if (navigator.userAgent.indexOf("IE 8") != -1)
                {
                    this.zbarposition = this.zbarposition + 5;
                }
                else
                {
                    this.zbarposition = this.zbarposition + 2;
                }
            } else if (navigator.appName.indexOf("Netscape") != -1) {
                this.zbarposition = this.zbarposition + 5;
            } else {
                this.zbarposition = this.zbarposition + 1;
            }
            this.startArrowRight();
        }
        this.zslidebar.style.left =  this.zbarposition + 'px';
    }
    this.zstopSlide = function () {
        window.clearInterval(this.zaktiv);
    }
    this.endArrowLeft = function () {
        if (navigator.appName.indexOf("Explorer") != -1) {
            this.zleftbutton.firstChild.style.filter = "Alpha(opacity=30)";
        } else {
            this.zleftbutton.style.opacity = 0.3;
        }
    }
    this.startArrowLeft = function() {
        if (navigator.appName.indexOf("Explorer") != -1) {
            this.zleftbutton.firstChild.style.filter="Alpha(opacity=100)";
        } else {
            this.zleftbutton.style.opacity = 1;
        }
    }
    this.endArrowRight = function () {
        if (navigator.appName.indexOf("Explorer") != -1) {
            this.zrightbutton.firstChild.style.filter="Alpha(opacity=30)";
        } else {
            this.zrightbutton.style.opacity = 0.3;
        }
    }
    this.startArrowRight = function() {
        if (navigator.appName.indexOf("Explorer") != -1) {
            this.zrightbutton.firstChild.style.filter="Alpha(opacity=100)";
        } else {
            this.zrightbutton.style.opacity = 1;
        }
    }
    this.init = function () {
        this.zleftbutton.style.display = 'block';
        this.zrightbutton.style.display = 'block';
        this.endArrowLeft();
    }
}

/* product_listing start */
function buttom_select(pid,action){
    $id='#buttom_select_'+pid;
    $pname=$('#buttom_select_'+pid).siblings().children(".right_a").text();
    $price=$('#buttom_select_'+pid).siblings().find(".right_text1").children(".productSpecialPrice").text();
    $price=$price.split('€');
    $list_li=$("<li id='buttom_select_"+pid+"'><div class='del_goods'><img src='includes/templates/blackcool/images/btn_mini_delete.gif' onclick=\"buttom_select("+pid+",'delete')\" /></div><div class='text1'>" + $pname+"</div><div class='text2'>€"+$price[1]+"</div><input type='hidden' value='1' name='products_id["+pid+"]' /></li>") ;

    if(action=="add"){
        $("#buttom_select_"+pid).html("<img src='includes/templates/blackcool/images/btn_artikel_loeschen.gif' onclick=\"buttom_select('"+pid+"','delete')\" />");

        if($(".sa_view").hide() && $(".sa_view_goods>ul>li").length==0){
            $(".sa_view").show()

            $(".sa_view_goods>ul").append($list_li);
        }else{
            if($(".sa_view").show()&&$(".sa_view_goods>ul>li").length!=0){
                $(".sa_view_goods>ul").append($list_li);
            }
        }
        $("#sa_amount").text($("#sa_amount").html()-0+1);
        $("#sa_sum").text((parseFloat($("#sa_sum").html())+parseFloat($price[1])).toFixed(2));
    }else{
        if(action=="delete")
        {
            $("#buttom_select_"+pid).html("<img src='includes/templates/blackcool/images/btn_artikel_auswaehlen.gif' onclick=\"buttom_select("+pid+",'add')\" />");
            $(".sa_view_goods>ul").children('li'+$id).remove();
            if($(".sa_view_goods>ul>li").length==0)
            {
                $(".sa_view").hide();
            }
            else
            {
                if($(".sa_view_goods").show()&&$(".sa_view_goods>ul>li").length!=0)
                {
                    $(".sa_view_goods>ul").children('li'+$id).remove();
                }
            }
        }
        $("#sa_amount").text($("#sa_amount").html()-1);
        $("#sa_sum").text((parseFloat($("#sa_sum").html())-parseFloat($price[1])).toFixed(2));
    }
    if($(".sa_view_goods>ul>li").length==0){

        $("#sa_button").html("<img src='includes/templates/blackcool/images/btn_artikel_in_den_warenkorb_grey.gif' />")
    }else{

        $("#sa_button").html("<input type=\"image\" id=\"addAboveAll\" src='includes/templates/blackcool/images/btn_artikel_in_den_warenkorb.gif' id=\"addAboveAll\"/>")
    }
    $(".text_buttom").click(function(){
        $(".sa_view").hide();
        return false;
    });
    $("#sa_amount").mousemove(function(){
        $(".sa_view").show();
        return false;
    });
}

function autoLoadClass(products_id,languages)
{
    $("#tab_0").addClass('aktiv');
    $("#sliderbar_tab0").show().siblings().hide();
    $(".passiv").click(function() {

        $(this).addClass("aktiv").siblings().removeClass("aktiv")
        $index=$('.passiv').index(this);
        if($('#vpslidebar_top_accessories_'+$index).html().replace(/(^\s*)/, "")=='')
        {
            var data='ddd='+$index+'&products_id='+products_id+'&languages='+languages;
            $.ajax({
                type:"POST",// Get method or post method
                async: false,// asynchonic
                cache: false,// read data from cache or not
                url: "ajax_relatived_list.php",// server script pathurl
                // ?products_id="+id+"&cart_quantity="+qty+"&arid="+arid
                dataType:"text",// the data type of return(xml,html or text)
                data:data,
                success:function(text){
                    var dd=eval('['+text+']');
                    var content=dd[0].content;
                    $('#vpslidebar_top_accessories_'+$index).html(content);
                }
            })
        }
        $(".navbar_show>div").eq($index).show().siblings().hide();
    });
}
// add by liuyuan 20111129 guanligouwu end 
