// ******************************
//	自定义显示标签
// ******************************
function showTtile(){
	
	strText = (arguments[0])?arguments[0] : "...";
	strWidth = (arguments[1])? arguments[1] : "";
	strHeight = (arguments[2])? arguments[2] : 5;
	
	// if your not going to use transitions or filters in any of the tips set this to 0
	var FiltersEnabled = 1 
		
	// Text[...]=[title,text]
	Text=["", strText]

	// Style[...]=[TitleColor,TextColor,TitleBgColor,TextBgColor,TitleBgImag,TextBgImag,TitleTextAlign,TextTextAlign, TitleFontFace, TextFontFace, TipPosition, StickyStyle, TitleFontSize, TextFontSize, Width, Height, BorderSize, PadTextArea, CoordinateX , CoordinateY, TransitionNumber, TransitionDuration, TransparencyLevel ,ShadowType, ShadowColor]
	Style=["","#333333","#999999","","","img/title.jpg","","","Arial","Arial","","","","",strWidth,strHeight,1,2,10,10,"","","","",""]
	
	stm(Text,Style)
}
// ******************************
//	根据不同浏览器，返回不同长度显示方式（非IE：100px）
// ******************************
function getPX(i) {
	
	if (getOs() == "MSIE") {
		return i;
	} else {
		return i + "px";
	}
	
}

// ******************************
//	返回浏览器
// ******************************
function getOs(){ 
	
	var OsObject = ""; 
	if(navigator.userAgent.indexOf("MSIE")>0) { 
		return "MSIE"; 
	} 
	if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
		return "Firefox"; 
	} 
	if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
		return "Safari"; 
	} 
	if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
		return "Camino"; 
	} 
	if(isMozilla=navigator.userAgent.indexOf("Gecko")>0){ 
		return "Gecko"; 
	} 
   
}

// ******************************
//	返回 OffsetTop 值（针对FF对改属性的BUG处理）
// ******************************
function getAbsoluteOffsetTop(obj) {
	var y = obj.offsetTop;
	while (obj = obj.offsetParent) y += obj.offsetTop;
	if(getOs() == "MSIE"){
		return y;
	}else{
		return y + "px";
	}
}

// ******************************
//	返回 OffsetLeft 值（针对FF对改属性的BUG处理）
// ******************************
function getAbsoluteOffsetLeft(obj) {
	var x = obj.offsetLeft;
	while (obj = obj.offsetParent) x += obj.offsetLeft;
	if(getOs() == "MSIE"){
		return x;
	}else{
		return x + "px";
	}
}

// ******************************
//	返回 EVENT 对象（同时兼容ie和ff的写法）
// ******************************
function getEvent() { 
	if(document.all) return window.event;
	func = getEvent.caller;
	while (func!=null) { 
		var arg0 = func.arguments[0];
		if (arg0) {
			if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){ 
				return arg0;
			}
		}
		func = func.caller;
	}
	return null;
}

function showXML(obj, url, pars){
	
	var rnd = parseInt(Math.random() * 100000000000);
	
	pars += "&" + rnd;
	
	var myAjax = new Ajax.Updater(
								{success: obj},
								url,
								{method: "get", parameters: pars}
	);

}


/*************************
**	控制滚动条 上 / 下	**
*************************/
var flag = false;
function upup(name){
	if (flag) {
		obj = $(name);
		obj.scrollTop = obj.scrollTop - 1;
		setTimeout("upup('" + name + "')", 10);
	}
}
function downdown(name){
	if (flag) {
		obj = $(name);
		obj.scrollTop = obj.scrollTop + 1;
		setTimeout("downdown('" + name + "')", 10);
	}
}
function endend(){
	flag = false;
}
function startstart(){
	flag = true;
}

function showPic(path){
	
	f = false;
	var index = Math.random();
	if (path == "1") {
		f = parseInt(index * 4, 10);
	} else if (path == "14") {
		f = parseInt(index * 3, 10);
	} else if (path == "39") {
		f = parseInt(index * 3, 10);
	} else if (path == "82") {
		f = parseInt(index * 3, 10);
	} else if (path == "80") {
		f = parseInt(index * 4, 10);
	} else if (path == "58") {
		f = parseInt(index * 2, 10);
	} else if (path == "90") {
		f = parseInt(index * 3, 10);
	} else if (path == "28") {
		f = parseInt(index * 3, 10);
	} else if (path == "78") {
		f = parseInt(index * 3, 10);
	}
	
	$("img").src = "img/webedit/" + path + "/" + f + ".jpg";
	
}