
//滑动门tabs
function tabs(a,b){
	if(!$(a)){ return false;}
	var nav = $('#'+a+' ul').children();
	var content = $('#'+a+' div div');
	!b?b=0:b=b;b>$(nav).length?b =0:b=b;
	$(nav).each(function(i){
		$(this).removeClass();				 	
		$(this).bind("mouseover", function(){						   
			$(nav).removeClass();				 		   
			$(this).addClass("SelectTab");
			$(content).hide();
			$(content[i]).show();
		});  
	});
	$(content).each(function(i){
		$(this).hide();
	});
	//显示标题1初始显示内容１
	$(nav[b]).addClass("SelectTab");
	$(content[b]).show();
}
//========================================================================
//定义list前面背景移动效果
//========================================================================
var leftnavX = -10;
var arrowX = -10;
function aimArrow(theId){
	var dy=theId.style.backgroundPosition;
	var theObj = theId.id
 	anArrow(theObj);
}
function anArrow(id){
	var theObj =document.getElementById(id);
 		if (arrowX < 17) { 
			arrowX = arrowX+2;
			theObj.style.backgroundPosition = arrowX+"px -2px ";
			setTimeout("anArrow('"+id+"')",1);
		} else if (arrowX == 18) { 
			theObj.style.backgroundPosition = "10px -2px";
			arrowX = -10;
		}
}

//==============================
//getdetail(action,productid,object)
//==============================
function getdetail(action,PId,theObj){
	for (i=1; i<=6; i++) {
			//隐藏所有
			if (document.getElementById("TabContent"+i)){
				document.getElementById("TabContent"+i).className="sheetContent";
				//$("#TabContent"+i).hide() ;
			}else{
			}
		}
		//显示当前数据
	 	document.getElementById(theObj).className="sheetContent_show";
		var actionUrl=SiteRoot+"ajax.asp?action="+action+"&ProductId="+PId;
		var isinnser=document.getElementById(theObj).innerHTML;
		if (isinnser.length>100){
			//alert("已经提取过了");
		}else{
			AjaxUpdate(actionUrl,theObj);
		}
 		document.getElementById("refurbish").href="javascript:AjaxUpdate('"+actionUrl+"','"+theObj+"');"
		//$("#"+theObj).show("slow"); 
}


var template={
	get_tpl:function(obj){
		if(obj){
			return $(obj).html();
		}else{
			return $(document.body).html();
		}
	},
	set_var :function(varname,value){
		 
		 
	}
};
template.set_var('sdf','sdf')
MatchDemo()
function MatchDemo()   
{   
var r, re; // 声明变量。   
var s = "The rain in Spain falls mainly in the plain";   
re = new RegExp("ain","g"); // 创建正则表达式对象。   
r = s.match(re); // 在字符串 s 中查找匹配。   
return(r);    
}   
 //*************************************************************************
//定义打开大图
//========================================================================
function openEnLarge(url,width,height){
  	if(url!=null){
		window.open(url, 'new', 'height='+height+',width='+width+',top=300,left=100'); 
	}
  }
  