//v1.60
undefined=window.undefined;
function isArray(o){return o !=null && typeof o=="object" && o instanceof Array}
oldBrowser = (navigator.appName == "Microsoft Internet Explorer") && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
ScriptFragment = !oldBrowser?'<script[^>]*>([\\S\\s]*?)<\/script[^>]*>':'<script[^>]*>([\\S\\s]*)<\/script[^>]*>';
var Try={these:function(){var r;for(var i=0,l=arguments.length;i<l;i++){var f=arguments[i];try{r=f();break;}catch (e){ }}return r}};
if (document.execCommand)try{document.execCommand('BackgroundImageCache', false, true)}catch(e){};
Object.extend=function(d,s){for(var p in s){d[p]=s[p];}return d}
Object.extend(Object,{
	clone:function(o){return Object.extend({ },o)},
	keys:function(o){var k=[];for(var p in o)k.push(p);return k},
	values:function(o){var v=[];for(var p in o)v.push(this[p]);return v},
	map:function(f,c){var r=[];f=f?f.bind(c):function(x){return x};this.each(function(v,i){r.push(f(v,i));});return r},
	_each:function(f){for(var i=0,l=this.length;i<l;i++)f(this[i])},
	each:function(f,c){var i=0;f=f.bind(c);try{this._each(function(v){f(v,i++);});}catch(e){if(e!={ })throw e;}return this},
	isElement:function(o){return o && o.nodeType==1},
	toHTML:function(o){return o && o.toHTML?o.toHTML():o==null?'':String(o);}
});
// Events
function addEvent(e,t,h){if(e.addEventListener)e.addEventListener(t,h,false);else{if(!h.$$g)h.$$g=addEvent.g++;if(!e.events)e.events={};var hs=e.events[t];if(!hs){hs=e.events[t]={};if(e['on'+t])hs[0]=e['on'+t];}hs[h.$$g]=h;e['on'+t]=handleEvent;}}
addEvent.g=1;
function removeEvent(e,t,h){if(e.removeEventListener)e.removeEventListener(t,h,false);else if(e.events && e.events[t] && h.$$g)delete e.events[t][h.$$g];}
function handleEvent(event){event=event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);if(!this.events)return false;var r=true,hs=this.events[event.type];for(var i in hs){this.$$hE=hs[i];if(this.$$hE(event)===false)r=false;}return r}
function fixEvent(event){event.preventDefault=fixEvent.preventDefault;event.stopPropagation=fixEvent.stopPropagation;return event}
fixEvent.preventDefault=function(){this.returnValue=false}
fixEvent.stopPropagation=function(){this.cancelBubble=true}
function stopEvent(event){event.preventDefault();event.stopPropagation();event.stopped=true;return false}
if(!window.addEventListener){document.onreadystatechange=function(){if(window.onload && window.onload!=handleEvent){addEvent(window,"load",window.onload);window.onload=handleEvent}}}
// String
Object.extend(String.prototype,{
	strip:function(){return this.replace(/^[ \s\xA0]+/g,'').replace(/[ \s\xA0]+$/g,'')},
	stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'')},
	stripScripts:function(){return this.replace(/[\r\n]/g,'').replace(new RegExp(ScriptFragment,'ig'),'')},
	extractScripts:function(){var ma=new RegExp(ScriptFragment,'ig'),mo=new RegExp(ScriptFragment,'i'),a=this.replace(/[\r\n]/g,'').match(ma) || [],r=[];for(var i=0,l=a.length;i<l;i++)r.push((a[i].match(mo) || ['',''])[1]);if (r.length==1)r[0]=r[0].replace(/<[\/]*script[^>]*>/ig,'');return r},
	evalScripts:function(){var a=this.extractScripts();for(var i=0,l=a.length;i<l;i++)try{eval(a[i])}catch(e){}},
	replace:function(){var n=String.prototype.replace;return ('123'.replace(/\d/g,function(m){return '['+m+']'}) == '[1][2][3]')?n:function(p,r){if(typeof r != "function")return this.split(p).join(r);if(p instanceof RegExp){var i,m,v=new Array(),g=/\/[gmi]*g[gmi]*$/.test(String(p));while(m=p.exec(this)){m.leftContext=RegExp.leftContext;m.rightContext=RegExp.rightContext;v.push(this.substring(i,m.index));i=p.lastIndex || 0;v.push(r.apply(null,m));if(!g)break;}v.push(this.substr(i));return v.join('');}else{var i=this.indexOf(p);return this.substring(0,i)+r(p,i,this)+this.substr(i+p.length);}}}()
});
Object.extend(String.prototype,{//add
	myspl:function(){return this.replace(/\-([^\s])/g,'-<i> </i>$1')}
});
// Aray
Object.extend(Array,{
	from:function(a,i){var r=new Array(),l=a.length;for(var j=i || 0;j<l;j++)r.push(a[j]);return r}
});
Object.extend(Array.prototype,Object);
Object.extend(Array.prototype,{
	pop:function(){var v,l;if(l=this.length){v=this[l-1];this.length--}return v},
	push:function(){for(var i=0,l=this.length;i<arguments.length;i++,l++)this[l]=arguments[i];return this.length},
	shift:function(){for(var i=0,r=this[0],l=this.length;i<l-1;i++)this[i]=this[i+1];this.length--;return r},
	unshift:function(){var l=arguments.length;if(l)for(var i=l+this.length-1;i>=0;i--)this[i]=i<l?arguments[i]:this[i-l];return this.length},
	splice:function(o,c){if(o==undefined)return;var i,j,r=[],a=arguments,l=a.length,t=this.length,c=l>1?a[1]||0:t;if(c<0)c=0;if(o<0&&(o+=t)<0)o=0;for(i=o||0,j=i+c;i<t;i++,j++,c--){if(c>0)r.push(this[i]);if(j<t)this[i]=this[j]}this.length=t-=r.length;if(l>2){o=a[0];c=l-2;if(o<0&&(o+=t)<0)o=0;else if(o>t)o=t;for(i=t-1,j=i+c;i>=o;i--,j--)this[j]=this[i];while(c)this[i+c]=a[2+--c]}return r},
	slice:function(s,e){var a=arguments.length,t=this.length;if(!a)return this;if(!s||(s<0&&(s+=t)<0))s=0;if(a==1)e=t;else if(e<0)e=t+e;if(s>=e)return [];e-=s;for(var r=[];e--&&s<t;s++)r.push(this[s]);return r},
	exists:function(e){for(var i=0,l=this.length;i<l;i++)if(e==this[i])return true;return false},
	first:function(){return this[0]},
	last:function(i){return this[this.length-1-(i||0)]},
	clear:function(){this.length=0;return this}
});
Object.extend(Array.prototype,{//fix
	unshift:function(){var n=Array.prototype.unshift;return ([].unshift(3)==1)?n:function(){n.apply(this,arguments);return this.length}}(),
	splice:function(){var n=Array.prototype.splice;return ([1,2,3,4,5].splice(3).length == 2)?n:function(){var p=arguments;if(p.length<2)p[1]=this.length;return n.apply(this,p)}}(),
	slice:function(){var n=Array.prototype.slice;return ([1,777].slice(-1)==777)?n:function(){if(arguments[0]<0)arguments[0]+=this.length;return n.apply(this,arguments)}}()
});
if (typeof(Array.prototype.forEach) == "function") Array.prototype._each = Array.prototype.forEach;
// Function
if (!Function.prototype.apply)Function.prototype.apply=function(o,p){var r,a=new Array();if(p)for(var i=0,l=p.length;i<l;i++)a.push('p['+i+']');if (typeof o=='number' || typeof o=='string' || typeof o=='boolean' || o===null || o===undefined)o=Object(o);if(o && o!==window){o.__apply__=this;r=eval('o.__apply__('+a.join(",")+')');try{delete o.__apply__}catch(e){o.__apply__=undefined}}else r=eval('this('+a.join(",")+')');return r};
if (!Function.prototype.bind)Function.prototype.bind=function(o){var _t=this;if(arguments.length <= 1)return function(){return _t.apply(o,arguments)};var p=Array.from(arguments,1);return function(){return _t.apply(o,p.concat(Array.from(arguments)))}};
if (!Function.prototype.call)Function.prototype.call=function(o,a){o.base=this;return o.base(a)};
// RegExp
Object.extend(RegExp.prototype,{
	exec:function(){var n=RegExp.prototype.exec;return (/./.lastIndex != undefined)?n:function(s){if(this.lastIndex>s.length){this.lastIndex=0;return;}if(!this.lastIndex)this.lastIndex=0;s=String(s);var r=n.call(this,s.substr(this.lastIndex));if(r){r.index+=this.lastIndex;r.input=s;RegExp.leftContext=s.substring(0,r.index);this.lastIndex=r.index+r[0].length;RegExp.rightContext=s.substr(this.lastIndex);RegExp.lastMatch=r[0];RegExp.lastParen=r.length>1?r.last():'';}else this.lastIndex=0;return r}}()
});
RegExp.prototype.match = RegExp.prototype.test;
RegExp.escape=function(s){return String(s).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1')};
// Element
function $(e){if(typeof e =='string')e=document.getElementById(e);return e}
function insertHTML(e,h,p){//p: before, top, bottom, after
	e=$(e);
	p=p?p.toLowerCase():'bottom';
	h=Object.toHTML(h);
	function _getC(t,h){
		var tags={
			TABLE:	['<table>','</table>',1],
			TBODY:	['<table><tbody>','</tbody></table>',2],
			TR:		['<table><tbody><tr>','</tr></tbody></table>',3],
			TD:		['<table><tbody><tr><td>','</td></tr></tbody></table>',4],
			SELECT:	['<select>','</select>',1]
		};
		Object.extend(tags, { THEAD: tags.TBODY, TFOOT: tags.TBODY, TH: tags.TD });
		var d=document.createElement('DIV'),t=tags[t];
		if(t){d.innerHTML=t[0]+h+t[1];for(var i=0;i<t[2];i++)d=d.firstChild;}else d.innerHTML=h;
		return d.childNodes;
	}
	function _insC(p,n,e){
		switch(p){
			case 'before':return e.parentNode.insertBefore(n,e);
			case 'top':return e.insertBefore(n,e.firstChild);
			case 'after':if(e.nextSibling)return e.parentNode.insertBefore(n,e.nextSibling);
		}
		return e.appendChild(n); // && bottom
	}
	var t = ((p == 'before' || p == 'after') ? e.parentNode : e).tagName.toUpperCase();
	var c = Array.from(_getC(t, h.stripScripts()));
	if (p == 'top' || p == 'after')c=c.reverse();
	c.each(function(a){_insC(p,a,e)});
	window.setTimeout(function(){h.evalScripts()}, 10);
	return e;
}
function hasClassName(e,n){if(!(e=$(e)))return false;var cn=e.className;if(!cn||cn.length==0)return false;if(cn.toUpperCase()==n.toUpperCase() || cn.match(new RegExp("(^|\\s)"+n+"(\\s|$)", "i")))return true;return false}
function addClassName(e,n){if(!(e=$(e)))return;if(hasClassName(e,n))return e;e.className=e.className+" "+n;return e}
function removeClassName(e,n){if(!(e=$(e)))return;if(!hasClassName(e,n))return e;e.className=e.className.replace(new RegExp("(^|\\s)"+n+"(\\s|$)","gi"),' ').strip();return e}
if(document.getElementsByClassName) {
	getElementsByClass = function(e,n){if(arguments.length==1){n=e;e=document.body;}return ($(e)||document).getElementsByClassName(n);}
} else {
	getElementsByClass = function(e,n){if(arguments.length==1){n=e;e=document.body;}var c,es=[];if(!(e=$(e)))return es;var et=e.getElementsByTagName('*');if(!et.length && e.all)et=e.all;for(var i=0,l=et.length;i<l;i++){c=et[i];if(hasClassName(c,n))es[es.length]=c;}return es}
}
function getLT(e){if(!(e=$(e)))return {l:0,t:0};var vT=0,vL=0;do{vT+=e.offsetTop||0;vL+=e.offsetLeft||0;if(getStyle(e,'position')=='absolute')break;e=e.offsetParent;if(e&&(e.tagName=='BODY'))break;}while (e);return {l:vL,t:vT}}
function getWH(e){if(!(e=$(e)))return {w:0,h:0};var d=getStyle(e,'display'),es=e.style;if(d !='none' && d !=null)return {w:e.offsetWidth,h:e.offsetHeight};var oV=es.visibility,oP=es.position,oD=es.display;es.visibility='hidden';es.position='absolute';es.display='block';var oW=e.clientWidth,oH=e.clientHeight;es.display=oD;es.position=oP;es.visibility=oV;return {w:oW,h:oH}}
function setHide(e){if(e=$(e))e.style.display='none'}
function setShow(e){if(e=$(e))e.style.display=''}
function getStyle(e,s){if(e.style[s])return e.style[s];var dv=document.defaultView;if(dv && dv.getComputedStyle)return dv.getComputedStyle(e,null).getPropertyValue(s);return e.currentStyle && e.currentStyle[s.replace(/\-(\w)/g, function(m,p){return p.toUpperCase()})] || e.style[s];}
function $v(e){if(!(e=$(e)) || !e.name)return null;switch(e.tagName.toLowerCase()){case 'select':if(!e.multiple){var i=e.selectedIndex;if(i>=0){var opt=e.options[i];return opt.value || opt.text;}}else{if(!e.length)break;var v=new Array();for(var i=0,l=e.length;i<l;i++){var opt=e.options[i];v.push(opt.value || opt.text);}return v;}return null;default:if(e.type && /checkbox|radio/.test(e.type.toLowerCase())){if(e.checked)return e.value;}else return e.value;}return null}
// Cookie
function getCookie(n){var c=document.cookie.split(";");for(var i=0,l=c.length;i<l;i++){var v=c[i].split("=");if(n==v[0].replace(" ",""))return unescape(v[1]);}return null}
function setCookie(n,v){var a=setCookie.arguments,l=setCookie.arguments.length;var e=(l>2)?a[2]:null,p=(l>3)?a[3]:null,d=(l>4)?a[4]:null,s=(l>5)?a[5]:false;document.cookie=n+"="+escape(v)+((e==null)?"":("; expires="+e.toGMTString()))+((p==null)?"":("; path="+p))+((d==null)?"":("; domain="+d))+((s==true)?"; secure":"");}
// Ajax
function Ajax(o){
	var def_o={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''},transport=getTransport();
	function init(o){
		this.o=def_o;Object.extend(this.o,o || {});this.responseText='';this.statusText='';this.transport=transport;
		this.request=function(url,o){Object.extend(this.o,o || {});if(!this.transport){(this.o['onError'] || this.o['onFailure'] || function(){})();return false;}this.method=this.o.method;var p=this.o.parameters;if(this.method=='get')url+=((url.indexOf('?')>-1)?'&':'?')+p;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))p+='&_=';try{this.transport.open(this.method.toUpperCase(),url,this.o.asynchronous);this.transport.onreadystatechange=this.onStateChange.bind(this);setRequestHeaders(this.transport,this.o);this.body=this.method == 'post'?(this.o.postBody || p):null;this.transport.send(this.body);if(!this.o.asynchronous && this.transport.overrideMimeType)this.onStateChange();}catch(e){return false;}return true;}
		this.onStateChange=function(){if(this.transport.readyState==4){try{(this.o['on'+(success(this.transport)?'Success':'Failure')] || function(){})(this.transport);this.transport.onreadystatechange=function(){};this.statusText=this.transport.statusText;this.responseText=this.transport.responseText;}catch(e){}}}
	}
	function getTransport(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')}) || false;}
	function success(t){var r=0;try{r=t.status || 0;}catch(e){r=0;}return !r || (r>=200 && r<300);}
	function setRequestHeaders(t,o){var h={'X-Requested-With':'XMLHttpRequest','Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(o.method=='post'){h['Content-type']=o.contentType+(o.encoding?'; charset='+o.encoding:'');if(t.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d\d\d\d)/) || [0,2005])[1]<2005)h['Connection']='close';}for(var n in h)t.setRequestHeader(n,h[n]);}
	return new init(o);
}

