//self.status='欢迎光临“++++ BBCBBT饰品SPACE +++”--http://www.BBCBBT.com'
/*
function ProTotal(objA,objB,num,$){
	V=document.getElementById(objA).value
	pro_num=document.getElementById(num).options[document.getElementById(num).selectedIndex].value
	
	wV=V*pro_num
	//alert(pro_num)
	document.getElementById(objB).innerHTML=$+wV
	
}
*/
function setImage(id,style){
	if(id&&style){
		obj=getObj(id)
		obj.style.background=style;
	}	
}

function getObj(obj){return document.getElementById(obj)}
function getName(obj){return document.getElementsByName(obj)}

function ProTotal(Price,Total,num,Other,$){
	
	V=document.getElementById(Price).value
	//alert(V)
	
	
	pro_num=document.getElementById(num)
	//alert(num)
	order_num=pro_num[pro_num.selectedIndex].value
	
	OtherO=document.getElementById(Other)
	if(OtherO){
		OtherV=parseInt(OtherO.value)
		//alert(OtherV))
		if(isNaN(OtherV)){
		OtherV=""
		}
	}
	
	wV=(V*order_num)+OtherV
	//alert(pro_num)
	document.getElementById(Total).innerHTML=$+wV
	
}

//+++++++++
function checkfile(){ 
	if (document.form.name.value=="" || document.form.minipic.value=="" || document.form.pic.value=="")
		{alert("请注意，带＊号的不允许为空！");return stop_m();};
}

//+++++++++


function AutoHeight(ObjA,ObjB){ 
	var maxHth; 
	var H1=document.getElementById(ObjA).scrollHeight; 
	var H2=document.getElementById(ObjB).scrollHeight; 
	maxHth=Math.max(H1,H2); 
	document.getElementById(ObjA).style.height=maxHth+"px"; 
	document.getElementById(ObjB).style.height=maxHth+"px"; 
} 
//AutoHeight("main_left","main_right"); 

function Current(id)
{	
	a_obj=document.getElementById("menu").getElementsByTagName("a")
	for(var i=0;i<a_obj.length;i++){
		a_obj[i].className=""
	}
	//b_obj=a_obj.length-1-id
	//alert(b_obj)
	//a_obj[b_obj].className="menu_cur";
	
	//b_obj=a_obj.length-1-id
	//alert(b_obj)
	getName(id)[0].className="menu_cur";
}

function LinkClass(TypeRadio,TypeName,ShowId){
	//alert("")
	if(TypeRadio!="" && TypeName!=""){
		TypeRadio=getName(TypeRadio)
		//alert(TypeRadio.length)
		for(var i=0;i<TypeRadio.length;i++){
			t_value=TypeRadio[i].value
			if(ShowId==t_value){
				//getObj(TypeTitle+t_value)
				getObj(TypeName+t_value).style.display="block";
			}else{
				getObj(TypeName+t_value).style.display="none";
			}
		}
	}
}

function TypeClass(TypeRadio,TypeTitle,TypeName,ShowId){
	if(TypeRadio!="" && TypeName!=""){
		//alert(TypeRadio)
		TypeRadio=getName(TypeRadio)
		for(var i=0;i<TypeRadio.length;i++){
			t_value=TypeRadio[i].value
			if(ShowId==t_value){
				//getObj(TypeTitle+t_value)
				getObj(TypeName+t_value).style.display="block";
			}else{
				getObj(TypeName+t_value).style.display="none";
			}
		}
	}
}

function ShowObj(id){
	obj=document.getElementById(id).style
	//alert(document.getElementById(id).className)
	if(obj.display!="none"){
		obj.display="none"
	}else{
		obj.display=""
	}
}

function TypeShow(id,num){
	
	if (id&&num){
		obj=document.getElementById(id+num)
		obj.className="type_show"
		//alert(obj.href)
	}
}

function OutObj(d){
	
	obj=document.getElementById("type_"+d)
	obj.className="type"
	//obj.style.display="block";
}

function ShowPro(objA,obj,url){
	A=document.getElementById(objA)
	id=A.value
	//id=A.options[A.selectedIndex].value
	
	document.getElementById(obj).src=url+id
}


function ImgShow(obj1,imgObj,src,style1,obj2,obj3,style2,noStyle){
	
	objA=document.getElementById(obj1)
	//objA.className=style1
	
	document.getElementById(imgObj).src=src
	document.documentElement.scrollTop=160
	//objB=document.getElementById(obj2).getElementsByTagName("a")
	//for(i=0;i<objB.length;i++){
		//alert(objB[i].innerHTML)
		//objB[i].className=noStyle
	//}
	
	//document.getElementById(obj3).className=style2
	/*objC=document.getElementById(obj3)
	if(objC.className != style2){
		//objC.className+=" "+style2
		objC.className=style2
		//alert("ok")
	}else{
		objC.className=style2	
		//alert("ok")
	}*/

	
}

//++++++++++
function FloatMenu(content){//飘浮菜单
	if (document.body.offsetWidth>800&&content!=""){//隐藏及修改800*600下无法正常显示的部分
		var theFloaters  = new floaters();
		theFloaters.addItem('float_menu',content);
		theFloaters.play();
	}
}
	
//++++++++
 var delta=0.15
 var openid
 var collection;
 function floaters() {
  this.items = [];
 // this.addItem = function(id,x,y,content){
   // document.write('<DIV id="'+id+'" style="left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
	//+++++++++
  this.addItem = function(id,content){
    document.write('<div id="'+id+'">'+content+'</div>');
	//+++++++++
     var newItem = {};
     newItem.object   = document.getElementById(id);

objA=document.getElementById(id)
	 var t=objA.offsetTop;  
	 var l=objA.offsetLeft;  
	 while(objA=objA.offsetParent) 
	 {  
	  t+=objA.offsetTop;  
	  l+=objA.offsetLeft;
	 }  

    newItem.x    = l;
    newItem.y    = t;
	//alert(newItem.y)
	//+++++++++++

     this.items[this.items.length]  = newItem;
      }
  this.play = function()
      {
     collection    = this.items
     setInterval('play()',10);
      }
  }
  function play(){
   for(var i=0;i<collection.length;i++){
	   
		var followObj  = collection[i].object;
		
		var followObj_x  = collection[i].x;
		var followObj_y  = collection[i].y;
		 
		 if(followObj.offsetLeft!=(document.documentElement.scrollLeft+followObj_x)) {
			 var dx=(document.documentElement.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
			 dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
			 
			 page_width=followObj.offsetLeft+dx
			 followObj.style.left=page_width+"px";
			 followObj.title="当前x轴："+followObj.offsetLeft+dx
		 }

		if(followObj.offsetTop!=(document.documentElement.scrollTop+followObj_y)) {
			 var dy=(document.documentElement.scrollTop+followObj_y-followObj.offsetTop)*delta;
			 dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
			 
			 page_height=followObj.offsetTop+dy
			 followObj.style.top=page_height+"px";
			 followObj.title="当前y轴："+page_height;
			
		 }
		 
   }
  } 
//++++++++
