
var nus={};nus.version="1.3.080225.1";nus.isIE=(navigator.userAgent.indexOf("MSIE")!=-1);nus.isIE6=(navigator.userAgent.indexOf("MSIE 6.0")!=-1);nus.isIE7=(navigator.userAgent.indexOf("MSIE 7.0")!=-1);nus.isFF=(navigator.userAgent.indexOf("Firefox")!=-1||navigator.userAgent.indexOf("BonEcho")!=-1||navigator.userAgent.indexOf("GranParadiso")!=-1);nus.isOpera=(navigator.userAgent.indexOf("Opera")!=-1);nus.isSafari=(navigator.userAgent.indexOf("Safari")!=-1);nus.isGecko=(navigator.userAgent.indexOf("Gecko")!=-1)&&navigator.userAgent.indexOf('KHTML')==-1;nus.isWebkit=(navigator.userAgent.indexOf("AppleWebKit/")!=-1);nus.browser={isExtensible:!!window.HTMLElement,checkCompatibility:function(jumpURL){try
{var browser_mismatch_error={msg:"Pagii is compatible with IE 6/7 or Firefox 2.0+ currently.\nOther browser versions are coming up.",URL:jumpURL};var version=0;if(nus.isIE){var list=navigator.userAgent.split(";");for(var i=0;i<list.length;i++){if(list[i].indexOf("MSIE")!=-1){version=list[i].split(" ").pop();break;}}
if(version<"6.0"){throw browser_mismatch_error;}
else if(version>="7.0"){nus.isIE7=true;}}
else if(nus.isFF){var list=navigator.userAgent.split(" ");for(var i=0,str;str=list[i];i++){if(str.indexOf("Firefox")!=-1){version=str.split("/").pop();break;}
else if(str.indexOf("GranParadiso")!=-1){version=str.split("/").pop();break;}}
if(version<"2.0"){throw browser_mismatch_error;}}
else{throw browser_mismatch_error;}
nus.browser.version=version;}
catch(error)
{alert(error.msg);document.location.href=error.URL;}}}
nus.docType={type:"XHTML",version:"1.0",mode:"Strict"};if(nus.isFF){}
nus.env={address:null,_imageURL:"",_iconURL:"",_init:function(){this.address=this.parseAddress(document.location.href);if(window.NOOVO_PATH==undefined){window.NOOVO_PATH="http://"+this.address.domain+"/"+this.address.path[0];}
this._imageURL=this.getURL("images");this._iconURL=this.getURL("images/icon");},parseAddress:function(url){var address={protocol:"http:",host:"",port:"",domain:"",hosturl:"",path:"",parameters:{}};var list=url.split("?");if(list.length>1){address.query=list[1];address.parameters=this.parseQuery(address.query);}
list=list[0].split("/");if(list[0]=="http:"||list[0]=="ftp:"){address.protocol=list[0];list.splice(0,1);if(list[0]==""){list.splice(0,1);}
address.domain=list[0];list.splice(0,1);}
else{address.domain=document.domain;}
var hostInfo=address.domain.split(":");address.host=hostInfo[0];if(!hostInfo[1]){address.port=80;}
else{address.port=parseInt(hostInfo[1]);}
address.hosturl=address.protocol+"//"+address.domain;address.path=list;address.fullpath="/"+list.join("/");return address;},parseQuery:function(query){var params={};var list=query.split("&");for(var i=0;i<list.length;i++){var temp=list[i].split("=");if(temp.length>1){params[temp[0]]=temp[1];}}
return params;},getURL:function(){var path=NOOVO_PATH;for(var i=0;i<arguments.length;i++){path+="/"+arguments[i];}
return path;},getImageURL:function(){var path=nus.env._imageURL;for(var i=0;i<arguments.length;i++){path+="/"+arguments[i];}
return path;},getIconURL:function(){var path=nus.env._iconURL;for(var i=0;i<arguments.length;i++){path+="/"+arguments[i];}
return path;},getXHRProxyURL:function(url,contentType){contentType=contentType||"html";if(this.parseAddress(url).domain==this.address.domain){return url;}
return($URL("proxy.php?url=")+encodeURIComponent(url)+"&content_type="+contentType);}};nus.env._init();var $URL=nus.env.getURL;var $ImageURL=nus.env.getImageURL;var $IconURL=nus.env.getIconURL;var $urlencode=function(url,param){return url+encodeURI(param);}
var $getXHRProxyURL=function(url,contentType){return nus.env.getXHRProxyURL(url,contentType);}
nus.cookie={UNLIMIT_DATE:"Fri, 31 Dec 2050 23:59:59 GMT;",set:function(name,value,date,path,domain,secure){if(date&&typeof date=="number"){var d=new Date();d.setTime(d.getTime()+(date*24*60*60*1000));date=d.toGMTString();}
document.cookie=name+"="+value+";"+(date?" expires="+date+";":"")
+(path?"path="+path:"")+(domain?"; domain="+domain:"")+(secure?"; secure":"");},get:function(name){var index=document.cookie.lastIndexOf(name+'=');if(index==-1)return null;var value=document.cookie.substring(index+name.length+1).split(";");return unescape(value[0]);},remove:function(name){this.set(name,"-",-1);}}
nus.session={setProperty:function(name,value,isPermanent){nus.cookie.set(name,value,isPermanent?10000:null,"/",nus.env.address.host);},getProperty:function(name){return nus.cookie.get(name)||"";}}
function _dummyFunc(){}
function _addProperty(obj,arg){for(var name in arg){obj[name]=arg[name];}
return obj;}
function _copyProperty(dest,src){for(property in src){dest[property]=src[property];}
return dest;}
function _addPrototype(obj,arg){var proto=obj.prototype;for(name in arg){proto[name]=arg[name];}
return obj;}
function _getBinding(obj,func){return(function(){func.apply(obj,arguments);});}
var $callback=_getBinding;var $execCallback=function(callback,args){if(callback.constructor==String){if(args){callback=callback.format.apply(callback,args);}
eval(callback);}
else{callback.apply(args);}}
var $CONTINUE=function(){throw $CONTINUE;}
var $BREAK=function(){throw $BREAK;}
_addPrototype(Array,{forEach:function(func,params){var result=[];var count=this.length;if(func.constructor==String){func=new Function("e","indexof_e",func);}
for(var i=0;i<count;i++){try{result[i]=func(this[i],i,params);}
catch(error){if(error==$CONTINUE){continue;}
else if(error==$BREAK){break;}
else{if(nus.isDebugging)debugger;throw error;}}}
return result;},map:function(func,params){var r=this.forEach(func,params);this.splice(0,this.length,r);return r;},filter:function(cond,max_count){var result=[];max_count=max_count||this.length;if(cond.constructor==String){this.forEach(function(e){if(eval(cond)){result.push(e);if(result.length>=max_count){$BREAK();}}})}
else{this.forEach(function(e){if(cond(e)){result.push(e);if(result.length>=max_count){$BREAK();}}})}
return result;},find:function(cond){var result=undefined;if(cond.constructor==String){this.forEach(function(e){if(eval(cond)){result=e;$BREAK();}})}
else{this.forEach(function(e){if(cond(e)){result=e;$BREAK();}})}
return result;},findIndex:function(cond){var result_index=-1;if(cond.constructor==String){this.forEach(function(e,index){if(eval(cond)){result_index=index;$BREAK();}})}
else{this.forEach(function(e,index){if(cond(e)){result_index=index;$BREAK();}})}
return result_index;},indexOf:function(value){var result=null;var count=this.length;for(var i=0;i<count;i++){if(value==this[i]){return i;}}
return-1;},getLast:function(){if(this.length==0){return null;}
return this[this.length-1];},add:function(param){if(param.constructor!=String&&param.length){for(var i=0,len=param.length;i<len;i++){this.push(param[i]);}}
else{this.push(param);}
return this;},insert:function(val,order){if(order<0)order=this.length+order;if(order>=this.length)order=this.length-1;this.splice(order,0,val);return this;},remove:function(val){for(var i=0;i<this.length;i++){if(val==this[i]){this.splice(i,1);return this;}}
return this;},removeByIndex:function(index,count){if(index<0){index=this.length+index;}
this.splice(index,count||1);return this;},removeBy:function(cond){var index=this.findIndex(cond);if(index==-1)return this;this.splice(index,1);return this;},replace:function(cond,val){var index=this.findIndex(cond);if(index>=0){this[index]=val;}
return this;},removeList:function(list){if(list.constructor==String||list.constructor==Function){list=this.filter(list);}
for(var i=0;i<list.length;i++){var val=list[i];for(var j=0;j<this.length;j++){if(val==this[j]){this.splice(j,1);break;}}}},clear:function(){this.length=0;},copy:function(){var temp=[];for(var i=0;i<this.length;i++){var e=this[i];if(typeof(e)=="object"){if(e instanceof Array){temp.push(e.copy());}
else{temp.push(e);}}
else{temp.push(e);}}
return temp;},from:function(v){if(!(typeof(v)=="string")&&v.length!=undefined){for(var i=0;i<v.length;i++){this.push(v[i]);}}
else{this.push(v);}
return this;},fromObject:function(obj){for(var name in obj){this.push(obj[name]);}},compact:function(){var r=[];for(var i=0;i<this.length;i++){if(this[i]){r.push(this[i]);}}
return r;},getIterator:function(){return new _Iterator(this);},pickRandom:function(){return this[parseInt(Math.random()*(this.length-1))];},toHTML:function(){var html=this.join("");if(arguments.length>0){html=html.formatN.apply(html,arguments);}
return html;},toJSON:function(){var temp=[];for(var i=0;i<this.length;i++){temp.push(nus.json.obj_to_str(this[i]));}
return"["+temp.join(", ")+"]";}});function safeCastToArray(v){var array=null;if(v instanceof Array){array=[].concat(v);}
else{array=[].from(v);}
return array;}
function Range(start,end){var a=[];for(var i=start;i<=end;i++){a.push(i);}
return a;}
var $A=safeCastToArray;var $R=Range;var _Iterator=function(param){this._data=param.concat();}
_addPrototype(_Iterator,{_data:null,_currentIndex:0,begin:function(){return this._data[0];},end:function(){return this._data[this._data.length-1];},next:function(step){step=step||1;this._currentIndex=(this._currentIndex+step)%this._data.length;var val=this._data[this._currentIndex];return val;},prev:function(step){step=step||1;this._currentIndex-=step;if(this._currentIndex<0){this._currentIndex=this._data.length+this._currentIndex;}
var val=this._data[this._currentIndex];return val;},current:function(){return this._data[this._currentIndex];},setCurrent:function(index){if(index<0||index>=this._data.length){throw"invalid range";}
this._currentIndex=index;},length:function(){return this._data.length;}});_addPrototype(String,{include:function(s){return(this.indexOf(s)!=-1);},remove:function(s){return this.replace(new RegExp(s,"g"),"");},format:function(){var params=arguments;var toReturn=this;for(var i=0;i<params.length;i++){var regex=new RegExp("\\{"+i+"\\}","g");toReturn=toReturn.replace(regex,params[i]);}
return toReturn;},formatN:function(){var params=arguments[0];var toReturn=this;for(var name in params){var regex=new RegExp("\\{"+name+"\\}","g");toReturn=toReturn.replace(regex,function(){return params[name]});}
return toReturn;},trimLeft:function(){return this.replace(/^\s*/,"");},trimRight:function(){return this.replace(/\s*$/,"");},trim:function(){return this.trimRight().trimLeft();},stripComments:function(){return this.replace(/<!--+((\n|\r|.)*?)--+>/gm,'');},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'').stripComments();},stripScripts:function(){return this.replace(new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script.*?>)','img'),'');},stripStyle:function(){return this.replace(new RegExp('(?:<style.*?>)((\n|\r|.)*?)(?:<\/style.*?>)','img'),'');},stripSpecialChars:function(){var re=/\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;return this.replace(re,"");},stripEvents:function(){var s=this;while(s.search(/<[^<]*?\son\w+\s*?=[^<]*?>/i)>=0){s=s.replace(/(\s)+on\w+\s*?=\s*?[\"\']?.*?[\"\']?(\s|>)+?/i,"$1$2");}
return s;},encodeSpecialChars:function(){return escape(escape(this));},decodeSpecialChars:function(){return unescape(unescape(this));},encodeURI:function(){var s=encodeURI(this);var re=/(`|\'|\"|\+)/g;return s.replace(re,this._escaped_code);},_escaped_code:function($0,$1,$3){return"%"+$1.charCodeAt(0).toString(16);},decodeURI:function(){return decodeURI(this);},toInnerHTML:function(){return this.replace(/\r\n/g,"<br/>").replace(/[\n|\r]/g,"<br/>");},toInnerText:function(){return this.replace(new RegExp("<br[/]?>","gi"),"\r\n");},capitalize:function(){return this.replace(/(^[a-z])/g,this.capitalize_convert);},camelize:function(){return this.replace(/(-([a-z]))/g,this.capitalize_convert);},capitalize_convert:function($0,$1){return $0.toUpperCase();},toJSON:function(){return'"'+this.replace(/[\x00-\x1f\\"]/g,nus.json.$replaceChars)+'"';}});_addPrototype(Number,{toHex:function(){var hex=this.toString(16);if(this<16){hex="0"+hex;}
return hex;},toStringfy:function(cipher){var str=this.toString();if(!cipher)return str;for(var i=str.length;i<cipher;i++){str="0"+str;}
return str;}});var ONE_HOUR=3600*1000;_addProperty(Date,{MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ONE_MINUTE:60000,ONE_HOUR:3600*1000,ONE_DAY:3600*1000*24,ONE_MONTH:3600*1000*30,localize:function(date){if(!date||date=="")return"";var result="";var utc=date.split("-");var local_date=new Date(Date.UTC(parseInt(utc[0],10),parseInt(utc[1]-1,10),parseInt(utc[2],10),parseInt(utc[3],10),parseInt(utc[4],10),parseInt(utc[5],10)));var now=new Date;var gap=now.getTime()-local_date.getTime();if(gap<3*Date.ONE_DAY){if(gap<=Date.ONE_MINUTE){result="seconds ago";}else if(gap<Date.ONE_HOUR){result=Math.floor(gap/Date.ONE_MINUTE)+" minutes ago";}else if(gap<Date.ONE_DAY){result=parseInt(gap/Date.ONE_HOUR)+" hours ago";}else{result=Math.round(gap/Date.ONE_DAY)+" days ago";}}
else{result=Date.format(local_date);}
return result;},localizeMax:function(date,maxDay){if(!date||date=="")return"";var result="";var utc=date.split("-");var local_date=new Date(Date.UTC(parseInt(utc[0],10),parseInt(utc[1]-1,10),parseInt(utc[2],10),parseInt(utc[3],10),parseInt(utc[4],10),parseInt(utc[5],10)));var now=new Date;var gap=now.getTime()-local_date.getTime();if(gap<maxDay*Date.ONE_DAY){if(gap<=Date.ONE_MINUTE){result="a few seconds";}else if(gap<Date.ONE_HOUR){result=Math.floor(gap/Date.ONE_MINUTE)+" minutes ago";}else if(gap<Date.ONE_DAY){result=parseInt(gap/Date.ONE_HOUR)+" hours ago";}else{result=Math.round(gap/Date.ONE_DAY)+" days ago";}}
else{result=Date.shortFormat(local_date);}
return result;},prettyDate:function(time){var utc=time.split("-");var date=new Date(Date.UTC(parseInt(utc[0],10),parseInt(utc[1]-1,10),parseInt(utc[2],10),parseInt(utc[3],10),parseInt(utc[4],10),parseInt(utc[5],10)));var diff=(Date.getTime()-date.getTime())/1000,day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0||day_diff>=31)
return Date.format(date);;return day_diff==0&&(diff<60&&"just now"||diff<120&&"1 minute ago"||diff<3600&&Math.floor(diff/60)+" minutes ago"||diff<7200&&"1 hour ago"||diff<86400&&Math.floor(diff/3600)+" hours ago")||day_diff==1&&"Yesterday"||day_diff<7&&day_diff+" days ago"||day_diff<31&&Math.ceil(day_diff/7)+" weeks ago";},getAge:function(year,month,day){var today=new Date;var age=today.getFullYear()-parseInt(year);month=parseInt(month||0);if(month){if(today.getMonth()<month){age--;}
else if(today.getMonth()<month){day=parseInt(day||0);if(day){if(today.getDate()<day){age--;}}}}
return age;},getTime:function(){var d=new Date;return d.getTime();},shortFormat:function(date){date=date||new Date;var result=this.MONTHS_SHORT[date.getMonth()]+" "+date.getDate()+" "+date.getFullYear();return result;},format:function(date){date=date||new Date;var result=this.MONTHS_SHORT[date.getMonth()]+" "+date.getDate()+" "+date.getFullYear()+", "
+date.getHours().toStringfy(2)+":"+date.getMinutes().toStringfy(2);return result;}});function Rect(l,t,r,b){if(arguments.length==4)
this.setRect(l,t,r,b);}
_addPrototype(Rect,{left:0,top:0,right:0,bottom:0,setRect:function(l,t,r,b){this.left=l;this.right=r;this.top=t;this.bottom=b;},getWidth:function(){return this.right-this.left;},getHeight:function(){return this.bottom-this.top;},ptInRect:function(x,y){if(x>=this.left&&x<=this.right&&y>=this.top&&y<=this.bottom)
return true;return false;},rectInRect:function(rc){if(this.left<=rc.left&&this.right>=rc.right&&this.top<=rc.top&&this.bottom>=rc.bottom)
return true;return false;},offset:function(dx,dy){this.left+=dx;this.right+=dx;this.top+=dy;this.bottom+=dy;},normalize:function(){var l=this.left,r=this.right;var t=this.top,b=this.bottom;this.left=Math.min(l,r);this.right=Math.max(l,r);this.top=Math.min(t,b);this.bottom=Math.max(t,b);},resizeRect:function(l,t,r,b){if(l){this.left+=l;}
if(t){this.top+=t;}
if(r){this.right+=r;}
if(b){this.bottom+=b;}}});var $typeof=function(e){if(typeof e=="object"){if(e==null){return null;}
else if(e instanceof Array){return"array";}
else{return"object";}}
return typeof(e);}
var $=function(e){if(e.constructor==String){e=document.getElementById(e);}
else if(e instanceof Array){for(var i=0;i<e.length;i++){e[i]=document.getElementById(e[i]);}}
return e;}
var $findByClass=function(e,className){if(e.constructor==String){e=$(e);}
var childs=e.childNodes;for(var i=0;i<childs.length;i++){if(childs[i].className&&childs[i].className.indexOf(className)!=-1){return childs[i];}}
return null;}
var $childByClass=function(e,className){if(e.constructor==String){e=$(e);}
var result=[];var childs=e.childNodes;for(var i=0;i<childs.length;i++){if(childs[i].className&&childs[i].className.indexOf(className)!=-1){result.push(childs[i]);}}
return result;}
var $node=function(){var node=$(arguments[0]);if(arguments.length==1){return node.childNodes[0];}
for(var i=1,arg;i<arguments.length;i++){arg=arguments[i];if(typeof arg=="string"){node=$findByClass(node,arg);}
else{var index=arg;if(index<0){index=node.childNodes.length+index;}
node=node.childNodes[index];}
if(!node){return null;}}
return node;}
var $_hasClassName=function(className,findingName){var names=className.split(" ");return names.indexOf(findingName)!=-1;}
var $hasClassName=function(e,findingName){e=$(e);return $_hasClassName(e.className,findingName);}
var $addClassName=function(e,addingName){e=$(e);if(!$_hasClassName(e.className,addingName)){e.className+=" "+addingName;}}
var $removeClassName=function(e,removingName){e=$(e);var names=e.className.split(" ");var index=names.indexOf(removingName);if(index>=0){names.splice(index,1);}
e.className=names.join(" ");}
var $toggleClassName=function(e,className){if(e.constructor==String){e=$(e);}
if(!$_hasClassName(e.className,className)){e.className+=" "+className;}
else{e.className=e.className.remove(className);}}
var $childs=function(id){var childs=$A($(id).childNodes);if(!nus.isIE){childs=childs.filter("e.nodeType == 1");}
return childs;}
var $tags=function(tagName,context){if(!context){context=document;}
else if(context.constructor==String){context=$(context);}
return context.getElementsByTagName(tagName);}
var $tag_array=function(tagName,context){return($A($tags(tagName,context)));}
var $T=$tag_array;var $makeHTML=function(){var arg_list=arguments;if(arguments.length==1&&arguments[0]instanceof Array){arg_list=arguments[0];}
var html=[];for(var i=0;i<arg_list.length;i+=3){html.push("<"+arg_list[i]);if(arg_list[i+1]){var arg=arg_list[i+1];if(arg.constructor==String){html.push(arg)}
else{var str=[" "];for(var name in arg){str.push(name+"='"+arg[name]+"' ");}
html.push(str.join(""));}}
html.push(">");if(arg_list[i+2]){var arg=arg_list[i+2];if(arg instanceof Array){html.push($makeHTML(arg));}
else{html.push(arg);}}
html.push("</"+arg_list[i]+">");}
return html.toHTML();}
var $replaceHTML=function(el,html){var old_el=$(el);old_el.insertAdjacentHTML("afterEnd",html);var new_el=old_el.nextSibling;old_el.removeNode(true);return new_el;};var $_setStyle=function(el,styles){el=$(el);var el_style=el.style;for(var name in styles){el_style[name]=styles[name];}
return el;}
var $setStyle=function(el,styles){var result=el;if($typeof(el)=="array"){var result=[];for(var i=0;i<el.length;i++){result.push(_copyProperty($(el[i]).style,styles));}}
else{_copyProperty($(el).style,styles);}
return result;}
var $setProperty=function(el,props){var result=el;if($typeof(el)!="array"){var result=[];for(var i=0;i<el.length;i++){result.push(_addProperty($(el[i]),props));}}
else{_addProperty($(el),props);}
return result;}
var $setPropertyRule=function(rule_list){var result=[];for(var name in rule_list){var el=$(name);_addProperty(el,rule_list[name]);result.push(e);}
return result;}
nus.json={$specialChars:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},$replaceChars:function(chr){return nus.json.$specialChars[chr]||'\\u00'+Math.floor(chr.charCodeAt()/16).toString(16)+(chr.charCodeAt()%16).toString(16);},obj_to_str:function(o){if(o==null){return'null';}
else if(o.toJSON){return o.toJSON();}
else if(o.constructor==String)
{return'"'+o.replace(/[\x00-\x1f\\"]/g,nus.json.$replaceChars)+'"';}
else if(typeof(o)=="object")
{if(o instanceof Array){var temp=[];for(var i=0;i<o.length;i++){temp.push(this.obj_to_str(o[i]));}
return"["+temp.join(", ")+"]";}
else{return(this.json_to_str(o));}}
else{return o.toString();}},json_to_str:function(o){var temp=[];for(var n in o){var t=o[n];try
{temp.push("\""+n+"\":"+this.obj_to_str(t));}
catch(error)
{}}
return"{"+temp.join(", ")+"}";},str_to_json:function(str,secure){return str.toJSON.apply(str,arguments);}}
nus.ENUM={};nus.ENUM.BUTTON={};if(nus.isIE){nus.ENUM.BUTTON.LBUTTON=1;nus.ENUM.BUTTON.RBUTTON=2;nus.ENUM.BUTTON.MBUTTON=4;}else{nus.ENUM.BUTTON.LBUTTON=0;nus.ENUM.BUTTON.RBUTTON=1;nus.ENUM.BUTTON.MBUTTON=2;}
var $RETURN_FALSE=function(){return false;}
nus.createHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){return null;}}}
return null;}
nus.loadFile=function(url){var request=nus.createHttpRequest();request.open("GET",url,false);request.send(null);if(request.status>=400){return null;}
return request.responseText;}
nus.loadScript=function(url){var script=nus.loadFile(url);if(!script){throw"Fail to load script : "+url;}
var dj_global=this;try
{if(window.execScript){window.execScript(script);}
else{dj_global.eval?dj_global.eval(script):eval(script);}}
catch(error)
{alert("Fail to load script ["+url+"] : \n"+error);}}
nus.require=function(package_name,package_path){var pkg_list=package_name.split(".");if(pkg_list.getLast()!="*"){nus.unimplemented("nus.require","subpackage loading");return;}
pkg_list.pop();if(eval(pkg_list.join(".")+"!=undefined")){return;}
if(!package_path){if(pkg_list[0]=="nus"){package_path="nus/n"+pkg_list.getLast()+".js";}
else{package_path=pkg_list.join("/")+".js";}
package_path=$URL(package_path);}
nus.loadScript(package_path);}
nus.includeScript=function(url,package_name){try
{if(package_name&&eval(package_name+"!=undefined")){return false;}}
catch(e)
{}
var e=document.createElement("SCRIPT");e.charset="UTF-8";e.type="text/javascript";e.src=url;var head=document.getElementsByTagName("head")[0];head.appendChild(e);return true;}
var __getNonTextNode=function(node){try{while(node&&node.nodeType!=1){node=node.parentNode;}}
catch(ex){node=null;}
return node;}
nus.browser._fixFeature=function(w){if(nus.browser.isExtensible&&!HTMLElement.prototype.insertAdjacentElement){HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){switch(where){case'beforeBegin':this.parentNode.insertBefore(parsedNode,this)
break;case'afterBegin':this.insertBefore(parsedNode,this.firstChild);break;case'beforeEnd':this.appendChild(parsedNode);break;case'afterEnd':if(this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);else
this.parentNode.appendChild(parsedNode);break;}}}
if(nus.browser.isExtensible&&!HTMLElement.prototype.insertAdjacentHTML){HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr){var r=this.ownerDocument.createRange();r.setStartBefore(this);var parsedHTML=r.createContextualFragment(htmlStr);this.insertAdjacentElement(where,parsedHTML)}}
if(nus.browser.isExtensible&&!HTMLElement.prototype.insertAdjacentText){HTMLElement.prototype.insertAdjacentText=function(where,txtStr){var parsedText=document.createTextNode(txtStr)
this.insertAdjacentElement(where,parsedText)}}
if(nus.browser.isExtensible&&!HTMLElement.prototype.removeNode){HTMLElement.prototype.removeNode=function(){if(!this.parentNode){nus.dom.rootElement.appendChild(this);}
this.parentNode.removeChild(this);}}
if(nus.browser.isExtensible&&!HTMLElement.prototype.parentElement){HTMLElement.prototype.__defineGetter__('parentElement',function(){return this.parentNode;});}
if(nus.browser.isExtensible&&!HTMLElement.prototype.innerText){HTMLElement.prototype.__defineGetter__('innerText',function(){return this.textContent;});HTMLElement.prototype.__defineSetter__('innerText',function(){this.textContent=arguments[0];});}
if(!nus.isIE&&document.implementation.hasFeature("XPath","3.0")){XMLDocument.prototype.selectNodes=function(cXPathString,xNode){if(!xNode){xNode=this;}
var oNSResolver=this.createNSResolver(this.documentElement);var aItems=this.evaluate(cXPathString,xNode,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var aResult=[];for(var i=0;i<aItems.snapshotLength;i++){aResult[i]=aItems.snapshotItem(i);}
return aResult;}
Element.prototype.selectNodes=function(cXPathString){if(this.ownerDocument.selectNodes){return this.ownerDocument.selectNodes(cXPathString,this);}else{throw new Error(0,"For XML Elements Only");}}}
if(!window.attachEvent){window.attachEvent=HTMLDocument.prototype.attachEvent=HTMLElement.prototype.attachEvent=function(eventName,eventHandler){this.addEventListener(eventName.slice(2),eventHandler,false);}
window.detachEvent=HTMLDocument.prototype.detachEvent=HTMLElement.prototype.detachEvent=function(eventName,eventHandler){this.removeEventListener(eventName.slice(2),eventHandler,false);}}
if(nus.browser.isExtensible){HTMLElement.prototype.contains=function(element){for(var i=0;i<this.childNodes.length;i++){var currentElement=this.childNodes[i];if(currentElement==element){return true;}
if((currentElement.nodeType==1)&&currentElement.contains(element)){return true;}}
return false;}}
if(nus.isGecko||nus.isWebkit){Event.prototype.__defineGetter__('srcElement',function(){var elm=this.explicitOriginalTarget;if(!elm.tagName){elm=this.originalTarget||this.currentTarget;}
return elm;});function GetLocation(el){var c={x:0,y:0};while(el){c.x+=el.offsetLeft;c.y+=el.offsetTop;el=el.offsetParent;}
return c;}
Event.prototype.__defineGetter__('offsetX',function(){return window.pageXOffset+this.clientX-GetLocation(this.srcElement).x;});Event.prototype.__defineGetter__('offsetY',function(){return window.pageYOffset+this.clientY-GetLocation(this.srcElement).y;});Event.prototype.__defineGetter__('fromElement',function(){var n;if(this.type=='mouseover'){n=this.relatedTarget;}
else if(this.type=='mouseout'){n=this.target;}
return __getNonTextNode(n);});Event.prototype.__defineGetter__("toElement",function(){var n;if(this.type=='mouseout'){n=this.relatedTarget;}
else if(this.type=='mouseover'){n=this.target;}
return __getNonTextNode(n);});}
if(!document.createStyleSheet){document.createStyleSheet=function(){var style=document.createElement("STYLE");var head=document.getElementsByTagName("head");if(!head||head.length==0){head=document.createElement("head");document.body.insertAdjacentElement("beforeBegin",head);head=document.getElementsByTagName("head");}
head[0].insertAdjacentElement("beforeEnd",style);return style;}}
if(nus.isIE6){try
{document.execCommand('BackgroundImageCache',false,true);}
catch(e)
{}}}
nus.browser._fixFeature();nus.lang={_nextClassUID:0,_nextObjectId:0,getNextClassUID:function(){return"UID_"+(this._nextClassUID++);},getNextObjectId:function(){return"NObjectID_"+(this._nextObjectId++);},addProperty:_addProperty,copyProperty:_copyProperty,addPrototype:_addPrototype,getBinding:_getBinding,execCallback:$execCallback,dummyFunc:_dummyFunc,postCommand:function(obj,cmd,param){param=param||null;window.setTimeout(obj.ID+".onCommand('"+cmd+"','"+param+"')",10);},delegateCall:function(code,delay){delay=delay||1000;window.setTimeout(code,delay);}};nus.unimplemented=function(func,detail){alert("unimplememented : "+func+" - "+detail);}
nus.lang.error={throwError:function(msg){if(nus.debug){nus.debug.log(msg);}
throw new Error(0,msg);}};nus.util={isNumeric:function(code){return(code>='0'&&code<='9');},isAlpha:function(code){return(code>='A'&&code<='Z')||(code>='a'&&code<'z');},getFlashVersion:function(){try{try{var axo=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{axo.AllowScriptAccess='always';}
catch(e){return'6,0,0';}}catch(e){}
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g,',').match(/^,?(.+),?$/)[1];}catch(e){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1];}}catch(e){}}
return'0,0,0';}}
nus.util.Timer=function(callback,interval,starting){this._callback=callback;this._interval=interval;if(starting==undefined){starting=true;}
if(starting){this.start();}}
nus.lang.addPrototype(nus.util.Timer,{_callback:null,_interval:null,_timerID:0,start:function(){if(this._timerID!=0)return;var proxy=nus.lang.getBinding(this,this._onTimer);this._timerID=window.setInterval(proxy,this._interval);},stop:function(){if(this._timerID==0){return;}
window.clearInterval(this._timerID);this._timerID=0;},_onTimer:function(){if(typeof this._callback=='string')
eval(this._callback);else
this._callback(this);}});nus.util.Timeout=function(callback,interval){this._callback=callback;this._interval=interval;var proxy=nus.lang.getBinding(this,this._onTimeout);this._timerID=window.setTimeout(proxy,this._interval);}
nus.lang.addPrototype(nus.util.Timeout,{_callback:null,_interval:null,_timerID:0,cancel:function(){if(this._timerID){window.clearTimeout(this._timerID);}
this._timerID=0;},_onTimeout:function(){if(typeof this._callback=='string')
eval(this._callback);else
this._callback(this);}});nus.lang.Class=function(){}
nus.lang.addProperty(nus.lang.Class,{_classTypeName:"nus.lang.Class",addPrototypes:function(){var count=arguments.length;for(var i=0;i<count;i++){nus.lang.addPrototype(this,arguments[i]);}},addProperties:function(){var count=arguments.length;for(var i=0;i<count;i++){if(arguments[i]){nus.lang.addProperty(this,arguments[i]);}}},extend:function(){var _newClass;_newClass=function(){if(arguments.length>0&&arguments[0]=="__interface_only"){return;}
this.__constructor.apply(this,arguments);}
var classUID=nus.lang.getNextClassUID()
nus.lang.addProperty(_newClass,{classUID:classUID,superClass:this,createInstance:nus.lang.Class.createInstance,superCall:nus.lang.Class.superCall,extend:nus.lang.Class.extend,addPrototypes:nus.lang.Class.addPrototypes,addProperties:nus.lang.Class.addProperties});_newClass.prototype=new this("__interface_only");_newClass.prototype._classTypeName=null;_newClass.addPrototypes.apply(_newClass,arguments);if(_newClass.prototype._init){if(this.prototype._init){_newClass.prototype._init.baseMethod=this.prototype._init;}}
else if(this.prototype._init){_newClass.prototype._init=this.prototype._init;}
_newClass.prototype.__init=_newClass.prototype._init;_newClass.addPrototypes({classUID:classUID,classType:_newClass,superClass:this});_newClass._classTypeName=_newClass.prototype._classTypeName;return _newClass;},createInstance:function(){var obj=new this("__interface_only");if(obj){obj.addProperties.apply(obj,arguments);obj.__constructor();}
return obj;},superCall:function(obj,func,arg){var f;if(obj.classUID==this.classUID&&this.superCall.caller!=this.prototype[func]){if(!this.prototype[func]){nus.lang.error.throwError("Super class is not override.");}
f=this.prototype[func];}else{if(this.superClass.prototype[func]){f=this.superClass.prototype[func];}else{nus.lang.error.throwError("Super class has not this method.");}}
var ret;if(arg){ret=f.apply(obj,arg);}
else{ret=f.apply(obj);}
return ret;}});nus.lang.Class.addPrototypes({ID:null,_classTypeName:nus.lang.Class._classTypeName,__constructor:function(){this.create();if(this._init){if(this._init.baseMethod){}
if(this.__init&&this._init!=this.__init){this.__init.apply(this,arguments);}
this._init.apply(this,arguments);}},create:function(){if(this.ID==null){this.ID=nus.lang.getNextObjectId();}
if(window[this.ID]!=null){nus.lang.error.throwError("ID ("+this.ID+") is already exist.");}
window[this.ID]=this;},destroy:function(){window[this.ID]=null;},toString:function(){return this._classTypeName+":"+this.ID;},getClass:function(){return this.classType;},getSuperClass:function(){return this.superClass;},getPrototype:function(){return this.getClass().prototype;},addProperties:function(){var count=arguments.length;for(var i=0;i<count;i++){nus.lang.addProperty(this,arguments[i]);}},getProperties:function(){var _prototype=this.getClass().prototype;var prop={};for(var name in this){var val=this[name];if(val==_prototype[name])continue;prop[name]=val;}
return prop;},superCall:function(func,arg){var caller=this.superCall.caller;var f;if(!caller.baseClass){if(caller!=this.getClass().prototype[func]){caller.baseClass=this.getClass();}
else{caller.baseClass=this.getClass().superClass;}}
f=caller.baseClass.prototype[func];if(!f.baseClass){f.baseClass=caller.baseClass.superClass;}
var ret;if(arg){ret=f.apply(this,arg);}
else{ret=f.apply(this);}
return ret;},binding:function(func){var _this=this;return(function(){func.apply(_this,arguments);});},forEach:function(array,func){var count=array.length;var isEval=(typeof func=="string");for(var i=0;i<count;i++){var e=array[i];var indexof_e=i;try{if(isEval){eval(func);}
else{func.call(this,e,indexof_e);}}
catch(error){if(error==$CONTINUE){continue;}
else if(error==$BREAK){break;}
else{throw error;}}}}});nus.dom={_init:function(){this.updateSystemMetrics();window.attachEvent("onresize",$callback(this,this.updateSystemMetrics));this.rootElement=document.createElement("div");this.rootElement.style.visibility="hidden";},rootElement:null,createElement:function(sHTML,parentElement){var newElement=null;try
{if(parentElement){parentElement.insertAdjacentHTML("beforeEnd",sHTML);newElement=parentElement.childNodes[parentElement.childNodes.length-1];}
else{this.rootElement.innerHTML=sHTML;newElement=this.rootElement.childNodes[0];}}
catch(e)
{nus.lang.error.throwError(sHTML);}
return newElement;},removeElement:function(elm){elm=$(elm);if(!elm)return;elm.removeNode(true);},swapElement:function(e1,e2){if(e1.swapNode){e1.swapNode(e2);}
else{var sibling=e1.previousSibling;var parent=e1.parentNode;e2.insertAdjacentElement("beforeBegin",e1);if(!sibling){parentNode.insertAdjacentElement("afterBegin",e2);}
else{sibling.insertAdjacentElement("beforeBegin",e2);}}},normalZIndex:1000000,toolboxZIndex:5000000,toolbarZIndex:7000000,dialogZIndex:8000000,popupZIndex:9000000,highestZIndex:9900000,focusZIndex:2000000,focusObject:null,setFocus:function(obj){if(this.focusObject!=null){this.focusObject.killFocus(obj);}
this.focusObject=obj;if(this.focusObject!=null){this.focusZIndex+=100;this.focusObject.setZIndex(this.focusZIndex);}},move:function(elm,x,y){elm.style.left=x+"px";elm.style.top=y+"px";return elm;},moveBy:function(elm,dx,dy){elm.style.left=elm.offsetLeft+dx+"px";elm.style.top=elm.offsetTop+dy+"px";return elm;},moveCenter:function(elm,isFixed){elm=$(elm);var rc=nus.dom.getObjectRect(elm);if(elm.parentNode==document.body){var size=nus.dom.getPageSize();x=(size.w-rc.getWidth())/2;y=(size.h-rc.getHeight())/2;}
else{x=(elm.parentNode.offsetWidth-rc.getWidth())/2;y=(elm.parentNode.offsetHeight-rc.getHeight())/2;}
var pos={x:0,y:0};if(isFixed&&!nus.isIE6){elm.style.position="fixed";}
else{pos=nus.dom.getScrollPos();}
nus.dom.move(elm,x+pos.x,y+pos.y);return elm;},resize:function(elm,w,h){elm.style.width=w+"px";elm.style.height=h+"px";return elm;},resizeBy:function(elm,dw,dh){elm.style.width=elm.offsetWidth+dw+"px";elm.style.height=elm.offsetHeight+dh+"px";return elm;},setOpacity:function(elm,opacity){opacity=Math.max(Math.min(100,opacity),0);if(nus.isIE){try
{if(opacity==100){if(elm.filters&&elm.filters.Alpha){elm.filters.Alpha.Opacity=opacity;elm.filters.Alpha.enabled=false;}}
else{if(!elm.filters.Alpha){var filter;filter=elm.style.filter;filter+=" Alpha(opacity="+opacity+")";elm.style.filter=filter;}
else{elm.filters.Alpha.Opacity=opacity;elm.filters.Alpha.enabled=true;}}}
catch(e)
{}}
else{elm.style.opacity=(opacity==100)?"":opacity/100;}
return elm;},getOpacity:function(elm){if(nus.isIE){return elm.filters.Alpha?elm.filters.Alpha.opacity:100;}
else if(elm.style.opacity){var s=elm.style.opacity;return parseFloat(s)*100;}
return 100;},systemOffset:null,updateSystemMetrics:function(){this.systemOffset=this._getSystemOffset(window);},_getSystemOffset:function(win){if(!win.document.body){return null;}
var point={x:0,y:0};if(nus.isIE){if(win.document.body.getBoundingClientRect){var trc=win.document.body.getBoundingClientRect();var org=this.getScrollPos();point.x=trc.left-(win.document.body.offsetLeft-win.document.body.clientLeft)+org.x;point.y=trc.top-(win.document.body.offsetTop-win.document.body.clientTop)+org.y;}}
return point;},getSystemOffset:function(win){win=win||window;if(win==window){if(!this.systemOffset){this.updateSystemMetrics();}
return this.systemOffset;}
return this._getSystemOffset(win);},getObjectRect:(function(){if(nus.isIE){return function(element,win){win=win||window;var pos=this.getSystemOffset();var orgX=pos.x;var orgY=pos.y;var trc=element.getBoundingClientRect();var oRect=new Rect(trc.left,trc.top,trc.right,trc.bottom);var pos=this.getScrollPos();oRect.offset(pos.x-orgX,pos.y-orgY);return oRect;}}
else if(document.getBoxObjectFor){return function(element,win){win=win||window;var oBox=win.document.getBoxObjectFor(element);var oRect=new Rect(oBox.x,oBox.y,oBox.x+oBox.width,oBox.y+oBox.height);return oRect;}}
else{return function(element,win){win=win||window;var pos=[element.offsetLeft,element.offsetTop];var parent=element.offsetParent;if(parent!=element){while(parent){pos[0]+=parent.offsetLeft;pos[1]+=parent.offsetTop;parent=parent.offsetParent;}}
pos[1]-=document.body.offsetTop;var oRect=new Rect(pos[0],pos[1],pos[0]+element.offsetWidth,pos[1]+element.offsetHeight);return oRect;}}})(),setObjectRect:function(element,x,y,w,h){element.style.left=x+"px";element.style.top=y+"px";element.style.width=w+"px";element.style.height=h+"px";},getScrollPos:(function(){var dd=document.documentElement,db=document.body;if(dd&&dd.scrollTop!=undefined){return function(){return{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};}}else if(db){return function(){return{x:document.body.scrollLeft,y:document.body.scrollTop};}}else{return function(){return{x:0,y:0};}}})(),setScrollPos:(function(){var dd=document.documentElement,db=document.body;if(dd&&dd.scrollTop!=undefined){return function(x,y){document.documentElement.scrollLeft=x;document.documentElement.scrollTop=y;}}else if(db){return function(x,y){document.body.scrollLeft=x;document.body.scrollTop=y;}}})(),getScrollSize:(function(){var dd=document.documentElement,db=document.body;if(dd&&dd.scrollWidth!=undefined){return function(){return{w:document.documentElement.scrollWidth,h:document.documentElement.scrollHeight};}}else if(db){return function(){return{w:document.body.scrollWidth,h:document.body.scrollHeight};}}})(),getPageSize:function(){var dd=document.documentElement,db=document.body;var w=document.body.clientWidth;var h=document.body.clientHeight;if(typeof(window.innerWidth)=='number'){w=window.innerWidth;h=window.innerHeight;}
else if(dd){if(dd.clinetWidth){w=dd.clientWidth;h=dd.clientHeight;}
else if(dd.offsetWidth){w=dd.offsetWidth;h=dd.offsetHeight;}}
return{w:w,h:h};},getPageWidth:function(){var dd=document.documentElement,db=document.body;var w=document.body.clientWidth;if(typeof(window.innerWidth)=='number'){w=window.innerWidth;}
else if(dd){if(dd.clinetWidth){w=dd.clientWidth;}
else if(dd.offsetWidth){w=dd.offsetWidth;}}
return w;},getPageHeight:function(){var dd=document.documentElement,db=document.body;var h=document.body.clientHeight;if(typeof(window.innerHeight)=='number'){h=window.innerHeight;}
else if(dd){if(dd.clientHeight){h=dd.clientHeight;}
else if(dd.offsetHeight){h=dd.offsetHeight;}}
return h;},scrollIntoView:function(elm){var rc=nus.dom.getObjectRect($(elm));var y=this.getScrollPos().y;var h=this.getPageHeight();if(y>rc.top){this.setScrollPos(this.getScrollPos().x,rc.top+h*0.2);}
if(y+h<rc.bottom){this.setScrollPos(this.getScrollPos().x,rc.bottom-h*0.8);}},getFrameWindowPos:function(win){var pos={x:0,y:0};var iframe=$tag_array("IFRAME").find(function(e){return e.contentWindow==win;});if(iframe){var rc=nus.dom.getObjectRect(iframe);pos.x=rc.left;pos.y=rc.top;}
return pos;},popupDivs:{},showPopup:function(obj,onClickFunc,hasSpotFocus,hasNoIframe){if(!nus.isIE6){hasNoIframe=true;}
nus.dom.popupZIndex+=100;if(obj.tagName){obj.style.zIndex=nus.dom.popupZIndex;}
else{obj.setZIndex(nus.dom.popupZIndex);}
var scroll_size=nus.dom.getScrollSize();var page_width=Math.max(nus.dom.getPageWidth(),scroll_size.w);var page_height=Math.max(nus.dom.getPageHeight(),scroll_size.h);var org=nus.dom.getScrollPos();var style="position:absolute;left:0px;top:0px;"+"width:100%;height:"+page_height+"px;";var captureDiv=null;if(!hasNoIframe){captureDiv=nus.dom.createElement("<div style='"+style+"display:none;' ><iframe frameborder='no' style='"+style+"'></iframe>"
+"<div style='"+style+"' onmousedown='"+onClickFunc
+";' oncontextmenu='return false;'></div></div>",document.body);}
else{captureDiv=nus.dom.createElement("<div style='"+style+"display:none;background-color:#ffffff;' "+" onmousedown='"+onClickFunc+";' oncontextmenu='return false;'></div>",document.body);}
if(!hasSpotFocus){nus.dom.setOpacity(captureDiv,1);}
else{if(!hasNoIframe){captureDiv.childNodes[1].style.backgroundColor="#202020";nus.dom.setOpacity(captureDiv.childNodes[0],10);nus.dom.setOpacity(captureDiv.childNodes[1],70);}
else{captureDiv.style.backgroundColor="#202020";nus.dom.setOpacity(captureDiv,70);}}
captureDiv.style.zIndex=nus.dom.popupZIndex-1;captureDiv.style.display="block";var uid;if(!obj.ID){uid=obj._popup_id=nus.dom.popupZIndex.toString();}
else{uid=obj.ID;}
this.popupDivs[uid]=captureDiv;nus.dom.isModalPopup=true;},hidePopup:function(obj){var uid=obj.ID||obj._popup_id;this.popupDivs[uid].removeNode(true);delete this.popupDivs[uid];nus.dom.isModalPopup=false;},clearAllPopup:function(){for(var uid in this.popupDivs){this.popupDivs[uid].removeNode(true);}
this.popupDivs={};nus.dom.isModalPopup=false;},createPopup:function(){if(nus.isIE){return window.createPopup();}
var obj=new Object();obj.document=document.createDocumentFragment();obj.document.body=obj.document.appendChild(document.createElement("div"));obj.document.close=obj.document.open=function(){};obj.document.write=function(v)
{obj.document.body.innerHTML+=v;}
obj.show=function(x,y,width,height,offset)
{if(!offset)offset=document.body;x+=offset.offsetX;y+=offset.offsetY;obj.document.body.style.cssText="z-index:90000000;position:absolute;margin:0px;padding:0px;"+"top:"+y+"px;left:"+x+"px;width:"+width+"px;height:"+height+"px;background:white;";var r=document.body.appendChild(obj.document.body);document.addEventListener("mousedown",doHide,true)
r.onclicktemp=obj.document.onclick;r.onclick=doClick
function doHide(ev)
{if(!obj.document.body.contains(ev.target))
{ev.cancelBubble=true;ev.returnValue=false;r.removeNode();}
document.removeEventListener("mousedown",doHide,true);}
function doClick(ev)
{if(this.onclicktemp)
this.onclicktemp()
r.removeNode();}}
return obj;},createTable:function(data){var result=[];for(var i=0;i<data.length;i++){var elm=data[i];var html="<";var inner="";for(var name in elm){switch(name){case'inner':inner=elm[name];break;case'tag':html+=elm[name]+" ";break;default:if(typeof elm[name]=='string')html+=name+"=\""+elm[name]+"\" ";else html+=name+"="+elm[name]+" ";break;}}
html+=">";html+=inner;switch(elm.tag){case"table":result.push(html,"</table>");break;case"tr":result.splice(result.length-1,0,html,"</tr>");break;case"td":result.splice(result.length-2,0,html,"</td>");break;}}
var table=nus.dom.createElement(result.join(""));return table;},createSimpleTable:function(column,row){var html=["<table cellpadding='0' cellspacing='0' border='0'>"];for(var i=0;i<row;i++){html.push("<tr>");for(var j=0;j<column;j++){html.push("<td></td>");}}
html.push("</table>");return nus.dom.createElement(html.toHTML());},makeHTML:function(dod){var html=[];var children=null;var innerHTML="";var tag="";var attr=[];for(name in dod){switch(name){case"_":break;case"_attr":break;case"_html":html.push(dod[name]);break;case"_children":html.push(dod[name].forEach(this.makeHTML).join(""));break;default:attr.push(name+"=\""+dod[name]+"\"");break;}}
var tag=dod["_"];var r="<"+tag
if(dod._attr){r+=" "+dod._attr+" ";}
r+=attr.join(" ")+">";r+=html.join("");r+="</"+tag+">";return r;},buildDOM:function(dod,parentElement){var html=this.makeHTML(dod);return nus.dom.createElement(html,parentElement);},makeFlash:function(src,id,w,h,wmode){var html="<embed src="+src+" quality=high wmode="+wmode
+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed>";var flash=this.createElement(html);return flash;},DOMReady:function(f){if(/(?!.*?compatible|.*?webkit)^mozilla|opera/i.test(navigator.userAgent)){document.addEventListener("DOMContentLoaded",f,false);}
else{window.setTimeout(f,0);}}};nus.dom._init();nus.dom.css={_rules:null,loadStyleSheet:function(url){document.write("<link rel='stylesheet' type='text/css' charset='UTF-8' href='"+url+"'/>")},getStyleSheet:function(index){index=index||0;if(document.styleSheets.length==0){document.createStyleSheet();index=0;}
var sheet=document.styleSheets[index];return sheet;},addCSS:function(name,cssText,index){index=index||document.styleSheets.length-1;var mysheet=nus.dom.css.getStyleSheet(index);if(mysheet.insertRule){mysheet.insertRule(name+" {"+cssText+";}",0)}else if(mysheet.addRule){mysheet.addRule(name,cssText);}},declareCSS:function(cssText){var blocks=cssText.split('}');var declare;for(var i=0;declare=blocks[i];i++){var parsed=declare.split('{');if(parsed.length<2)continue;var selectors=parsed[0].split(',');cssText=parsed[1];if(!cssText)continue;for(var j=0;j<selectors.length;j++){this.addCSS(selectors[j],cssText);}}},getRules:function(refreshCache){if(this._rules==null||refreshCache){this._rules={};var ds=document.styleSheets;for(var i=0,len=ds.length;i<len;i++){try{var ss=ds[i];var ssRules=ss.cssRules||ss.rules;for(var j=ssRules.length-1;j>=0;--j){this._rules[ssRules[j].selectorText]=ssRules[j];}}catch(e){}}}
return this._rules;},getRule:function(selector,refreshCache){var rs=this.getRules(refreshCache);if(!(selector instanceof Array)){return rs[selector];}
for(var i=0;i<selector.length;i++){if(rs[selector[i]]){return rs[selector[i]];}}
return null;},updateRule:function(selector,property,value){if(!(selector instanceof Array)){var rule=this.getRule(selector);if(rule){rule.style[property.camelize()]=value;return true;}}else{for(var i=0;i<selector.length;i++){if(this.updateRule(selector[i],property,value)){return true;}}}
return false;},addLink:function(url,id){var link=document.createElement("LINK");link.rel="stylesheet";if(id){link.id=id;}
link.type="text/css";link.charset="UTF-8";link.href=url;var head=document.getElementsByTagName("head");head[0].insertAdjacentElement("beforeEnd",link);return link;},pngLoader:function(src){var css;if(nus.isIE6){css="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src=\'"+src+"\');";}
else{css="background-image:url("+src+");";}
return css;}};nus.html={LANGUAGE:"en",ENCODING:"UTF-8"};nus.event=function(){}
nus.lang.addProperty(nus.event,{_lastEventPos:null,_dragStartPos:null,dragSrc:null,dragTarget:null,dragImage:null,isDragging:null,_orgZIndex:0,_eventMap:{},_eventMapKey:0,_init:function(){this.addListener(window,"onunload",this._clear,this);},_clear:function(){for(var name in this._eventMap){var info=this._eventMap[name];info.elm.detachEvent(info.evt,info.proxy);}
delete this._eventMap;},addListener:function(element,eventType,handler,instance){var info={elm:element,evt:eventType,h:handler,inst:instance||null,proxy:null};info.proxy=function(){info.h.apply(info.inst,arguments);}
try
{element.attachEvent(eventType,info.proxy);}
catch(e)
{throw("fail event listening : "+element.tagName||element+" "+eventType);}
this._eventMap[++this._eventMapKey]=info;return this._eventMapKey;},removeListener:function(element,key){var info=this._eventMap[key];if(!info)return;info.elm.detachEvent(info.evt,info.proxy);delete this._eventMap[key];},removeAllListener:function(element){for(var key in this._eventMap){var info=this._eventMap[key];if(info.elm==element){this.removeListener(info.elm,key);}}},fireEvent:function(obj,event_name,event){if(nus.isIE){obj.fireEvent(event_name,event);}else{var evt=document.createEvent("MouseEvents")
evt.initMouseEvent(event_name,true,true,window,0,event.screenX,event.screenY,event.clientX,event.clientY,event.ctrlKey,event.shiftKey,event.altKey,false,event.button,null);obj.dispatchEvent(evt);}},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},stopEvent:function(ev){ev=ev||window.event;this.stopPropagation(ev);this.preventDefault(ev);},setDragSrc:function(ev,object,startPos){this.dragSrc=object;this._dragStartPos=startPos;if(object.dragShape=="self"){this.dragTarget=object.getDragTarget(ev);}
else if(object.dragShape=="custom"){this.dragTarget=object.getDragTarget(ev);}
else if(object.dragShape=="copy"){this.dragTarget=object.clone();this.dragTarget.setVisible(true);this.dragTarget.setOpacity(80);}
else if(object.dragShape=="icon"){this.dragTarget=nus.dom.DivClass.createInstance({ID:"dragicon",left:startPos.x,top:startPos.y,opacity:80,zIndex:nus.dom.highestZIndex});this.dragTarget.setContents("<img src='{0}'>".format(object.dragIcon));}
this._orgZIndex=this.dragTarget.zIndex;this.isDragging=true;},clearDragSrc:function(){if(this.dragSrc==null)return;if(this.dragSrc.dragShape=="copy"){this.dragSrc.move(this.dragTarget.getLeft(),this.dragTarget.getTop());}
if(this.dragSrc.dragShape!="self"){if(this.dragSrc!=this.dragTarget){this.dragTarget.destroy();}}
this.dragTarget=null;this.dragSrc=null;this.isDragging=false;},calcDragPos:function(pos){var x=pos.x-this._dragStartPos.x;var y=pos.y-this._dragStartPos.y;if(this.dragSrc.dragShape=="self"){this.dragTarget.setPageOffset(x,y);}
else if(this.dragSrc.dragShape=="icon"){this.dragTarget.move(x+this._dragStartPos.x-4,y+this._dragStartPos.y-4);}
else{this.dragTarget.setPageOffset(x,y);}},onDrop:function(object,ev){var pos=nus.event.getEventPosition(ev)
var x=pos.x;var y=pos.y;var e=document.elementFromPoint(pos.x,pos.y);if(e==document.body){object.drop(document.body,x,y);}
else if(e.id!=undefined){while(e.id==null||e.id==""){e=e.parentNode;if(e==document.body)break;}
nus.unimplemented("onDrop","target object");}},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return t;},getEventPosition:function(ev){var x,y;if(ev.pageX||ev.pageY){x=ev.pageX;y=ev.pageY;}
else{var dp=nus.dom.getScrollPos();var offset=nus.dom.getSystemOffset();x=ev.clientX+dp.x-offset.x;y=ev.clientY+dp.y-offset.y;}
var cursor={x:x,y:y};return cursor;},onselectstart:function(){return true;}});nus.event._init();nus.dom.Element=nus.lang.Class.extend();nus.dom.Element.addProperties({_event_types:["onmousedown","onmouseup","onmousemove","onmouseover","onmouseout","onclick"]});nus.dom.Element.addPrototypes({_classTypeName:"nus.dom.Element",_dom_element:null,$:null,left:0,top:0,width:0,height:0,_clientRect:null,border:null,backgroundColor:null,opacity:100,overflow:"hidden",cursor:null,zIndex:nus.dom.normalZIndex,isVisible:true,isEnableFocus:false,isFocus:false,innerHTML:"",parentObject:null,canDrag:false,canDrop:false,canDropAccept:false,dropType:null,dropAcceptType:null,dragCursorType:"move",dragShape:"self",dragIcon:null,skinStyleName:null,styleClassName:null,_children:null,_siblings:null,_eventObserver:null,_event_keymap:null,_clickCancel:false,_isLButtonDown:false,_isRButtonDown:false,isDragging:false,_clickPos:null,_dragStartPos:null,_dragTimer:null,_isSelectable:false});nus.dom.Element.addPrototypes({_init:function(htmlElement){if(htmlElement){this.attach(htmlElement);}},attach:function(htmlElement){this._dom_element=this.$=htmlElement;this._event_keymap=[];this._setEvents();this.zIndex=htmlElement.style.zIndex;this.isVisbile=(htmlElement.style.visibility!="hidden");this.updateLayoutValue();},detach:function(){this._resetEvents();this._dom_element=null;this.$=null;this._children=null;this._siblings=null;},destroy:function(){this.onDestroy();},clone:function(){var prop=this.getProperties();prop["ID"]=null;prop["XmlHttp"]=null;prop["parentObject"]=null;prop.$=null;var obj=this.getClass().createInstance(prop);if(!obj.$){obj.attach(this.$.cloneNode(true));document.body.insertBefore(obj.$);}
return obj;},getDomElement:function(){return this._dom_element;},getChildElement:function(index){if(index>=this._dom_element.childNodes.length){return null;}
var oChild=this._dom_element.childNodes[index];return oChild;},onPrecreate:function(){},onCreate:function(){},onDestroy:function(){if(this._dom_element){this._resetEvents();if(this._children){for(var i=this._children.length-1;i>=0;i--){this._children[i].destroy();}}
if(this.parentObject){this.parentObject._removeChild(this);}
this._dom_element.removeNode(true);this._dom_element=null;this.$=null;}
window[this.ID]=null;},_makeChild:function(html){this._dom_element.insertAdjacentHTML("beforeEnd",html);var childs=this._dom_element.childNodes;var childElement=childs[childs.length-1];return childElement;},_addChild:function(obj){this._children=this._children||[];this._children.push(obj);},_removeChild:function(obj){this._children.remove(obj);},appendChild:function(child){if(child.tagName){this._dom_element.appendChild(child);}
else if(child._dom_element){child.setParent(this);}},setParent:function(objParent){if(this.parentObject!=null){this.parentObject._removeChild(this);}
this.parentObject=objParent;if(this.parentObject!=null){this.parentObject.getDomElement().appendChild(this._dom_element);this._addChild(this);}
else{document.body.appendChild(obj._dom_element);}
this.updateLayoutValue();},contains:function(child){for(var obj in this._children){if(obj==child){return true;}}
return false;},addSibling:function(obj){if(this._siblings==null){this._siblings=new Array;}
this._siblings.push(obj);},removeSibling:function(obj){this._siblings.remove(obj);},setSkinStyle:function(name){this.skinStyleName=name;this.updateSkin();},getStyleName:function(name){return this.skinStyleName+name;},updateSkin:function(){},setClassName:function(className){this.$.className=className;},addClassName:function(className){$addClassName(this.$,className);},removeClassName:function(className){$removeClassName(this.$,className);},hasClassName:function(className){return $hasClassName(this.$,className);},setStyle:function(styles){for(var name in styles){this.$.style[name]=styles[name];}},getStyle:function(name){return this._dom_element.style[name];},setOpacity:function(opacity){this.opacity=opacity;nus.dom.setOpacity(this._dom_element,opacity);},getOpacity:function(){return this.opacity;},setVisible:function(isVisible){if(isVisible){this._dom_element.style.visibility="inherit";this.updateLayoutValue();}else{this._dom_element.style.visibility="hidden";}
this.isVisible=isVisible;this.onShow(isVisible);},onShow:function(isVisible){},ptInClient:function(pos){this._clientRect=nus.dom.getObjectRect(this._dom_element);return this._clientRect.ptInRect(pos.x,pos.y);},_setEvents:function(){if(!nus.isIE){this._mousedown_event_key=nus.event.addListener(this._dom_element,"onmousedown",this._mousedown_Handler,this);}
if(this.onMouseDown!=nus.lang.dummyFunc)this.registerEvent("onmousedown");if(this.onMouseUp!=nus.lang.dummyFunc)this.registerEvent("onmouseup");if(this.onMouseMove!=nus.lang.dummyFunc)this.registerEvent("onmousemove");if(this.onMouseOver!=nus.lang.dummyFunc)this.registerEvent("onmouseover");if(this.onMouseOut!=nus.lang.dummyFunc)this.registerEvent("onmouseout");if(this.onClick!=nus.lang.dummyFunc)this.registerEvent("onclick");if(nus.isIE){this._mousedown_event_key=nus.event.addListener(this._dom_element,"onmousedown",this._mousedown_Handler,this);}},_resetEvents:function(){for(name in this._event_keymap){this.unregisterEvent(name);}
nus.event.removeListener(this._dom_element,this._mousedown_event_key);this._event_keymap=[];},registerEvent:function(evType,callback,inst){callback=callback||this._mouse_event_handler;inst=inst||this;if(nus.isFF){if(evType=="oncontextmenu"){this.$.oncontextmenu=$callback(inst||this,callback);return;}}
this._event_keymap[evType]=nus.event.addListener(this._dom_element,evType,callback,inst||this);},unregisterEvent:function(evType){if(nus.isFF){if(evType=="oncontextmenu"){this.$.oncontextmenu=null;return;}}
var key=this._event_keymap[evType];if(!key)return;nus.event.removeListener(this._dom_element,key);delete this._event_keymap[evType];},setCapture:function(){if(nus.isIE){this._mouseup_event_key=nus.event.addListener(this._dom_element,"onmouseup",this._mouseup_Handler,this);this._mousemove_event_key=nus.event.addListener(this._dom_element,"onmousemove",this._mousemove_Handler,this);this._dom_element.setCapture(true);}
else if(this._dom_element.addEventListener){if(!this._mouseup_capture_callback){this._mouseup_capture_callback=$callback(this,this._mouseup_Handler);this._mousemove_capture_callback=$callback(this,this._mousemove_Handler);this._checkmouse_capture_callback=$callback(this,this._check_mouse_handler);}
document.addEventListener("mouseup",this._mouseup_capture_callback,true);document.addEventListener("mousemove",this._mousemove_capture_callback,true);document.addEventListener("mouseout",this._checkmouse_capture_callback,true);}},releaseCapture:function(){if(nus.isIE){nus.event.removeListener(this._dom_element,this._mouseup_event_key);nus.event.removeListener(this._dom_element,this._mousemove_event_key);this._dom_element.releaseCapture();}
else if(this._dom_element.addEventListener){document.removeEventListener("mouseup",this._mouseup_capture_callback,true);document.removeEventListener("mousemove",this._mousemove_capture_callback,true);document.removeEventListener("mouseout",this._checkmouse_capture_callback,true);}},_check_mouse_handler:function(ev){if(this._isLButtonDown){if(ev.explicitOriginalTarget.tagName=="HTML"&&ev.fromElement.tagName=="HTML")
{this._mouseup_Handler(ev);}}},_mouse_event_handler:function(ev){ev=ev||window.event;if(this._eventObserver){this._eventObserver._mouse_event_handler(ev);return;}
switch(ev.type){case"mousemove":this.onMouseMove(ev);break;case"mouseover":this.onMouseOver(ev);break;case"mouseout":this.onMouseOut(ev);break;case"mousedown":this.onMouseDown(ev);break;case"mouseup":this.onMouseUp(ev);break;case"click":if(this._clickCancel){nus.event.stopEvent(ev);return;}
if(typeof this.onClick=="string"){eval(this.onClick);}
else{this.onClick(ev);}
break;case"scroll":this.releaseCapture();if(typeof this.onScroll=="string"){eval(this.onScroll);}
else{this.onScroll(ev);}
break;default:break;}},_mousedown_Handler:function(ev){if(!this.canDrag&&this.onMouseDown==nus.lang.dummyFunc){return;}
if(this._eventObserver){this._eventObserver._mousedown_Handler(ev);return;}
if(ev.button==nus.ENUM.BUTTON.LBUTTON){if(!this._isLButtonDown){var pos=nus.event.getEventPosition(ev);if(this.ptInClient(pos)){this._isLButtonDown=true;this._clickCancel=false;this._clickPos={x:pos.x-this._clientRect.left,y:pos.y-this._clientRect.top};this.setCapture();nus.event.stopEvent(ev);}}}else if(ev.button==nus.ENUM.BUTTON.RBUTTON){if(!this._isRButtonDown){this._isRButtonDown=true;this.setCapture();nus.event.stopEvent(ev);}}},_mouseup_Handler:function(ev){var isClicked=false;if(ev.button==nus.ENUM.BUTTON.LBUTTON){if(this._isLButtonDown){this._isLButtonDown=false;if(this.isDragging){this.onDragEnd(ev);this._clickCancel=true;}
else{if(this.ptInClient(nus.event.getEventPosition(ev))){isClicked=true;}}
this.releaseCapture();nus.event.stopEvent(ev);}}else if(ev.button==nus.ENUM.BUTTON.RBUTTON){if(this._isRButtonDown){this._isRButtonDown=false;this.releaseCapture(this);nus.event.stopEvent(ev);}}
if(!nus.isIE){if(this.onMouseUp){this.onMouseUp(ev);}}},_mousemove_Handler:function(ev){if(this._isLButtonDown){if(this.canDrag){if(this.isDragging){this.onDrag(ev);}
else{this.onDragStart(ev);}
nus.event.stopEvent(ev);}
else{if(!nus.isIE){if(this.onMouseMove){this.onMouseMove(ev);}}}}},_dragenter_Handler:function(ev){if(this.canDropAccept){nus.event.stopEvent(ev);return;}
this.onDragEnter(ev);},_dragover_Handler:function(ev){if(this.canDropAccept){nus.event.stopEvent(ev);return;}
this.onDragOver(ev);},_dragleave_Handler:function(ev){this.onDragLeave(ev);},_drop_Handler:function(ev){this.onAcceptDrop(ev);},onMouseDown:nus.lang.dummyFunc,onMouseUp:nus.lang.dummyFunc,onMouseMove:nus.lang.dummyFunc,onMouseOver:nus.lang.dummyFunc,onMouseOut:nus.lang.dummyFunc,onClick:nus.lang.dummyFunc,onScroll:nus.lang.dummyFunc,getDragTarget:function(ev){return this;},startDrag:function(ev,x,y){this.isDragging=true;this._dragStartPos={x:x,y:y};if(this.parentObject){this._dragStartPos.x+=this.parentObject.getPageLeft();this._dragStartPos.y+=this.parentObject.getPageTop();}
if(this.dragCursorType!=null){this._cursor_normal=this.$.style.cursor;this.$.style.cursor=this.dragCursorType;}
nus.event.setDragSrc(ev,this,this._dragStartPos);},endDrag:function(){this.isDragging=false;this._dragStartPos={x:0,y:0};if(this.dragCursorType!=null){this.$.style.cursor=this._cursor_normal||"";}
nus.event.clearDragSrc();if(this.canDrop){this.onDrop(ev);}},onDragStart:function(ev){var pos=nus.event.getEventPosition(ev);var cx=pos.x-this._clientRect.left-this._clickPos.x;var cy=pos.y-this._clientRect.top-this._clickPos.y;if(cx>5||cx<-5||cy>5||cy<-5){this.startDrag(ev,this._clickPos.x,this._clickPos.y);}
else{return;}},onDrag:function(ev){var pos=nus.event.getEventPosition(ev);nus.event.calcDragPos(pos);},onDragEnd:function(ev){this.endDrag();},onDragEnter:function(ev){},onDragLeave:function(ev){},onDragOver:function(ev){},onAcceptDrop:function(ev){},onDrop:function(ev){nus.event.onDrop(this,ev);},drop:function(object,x,y){},onSelectStart:function(){return false;},getLeft:function(){return this.left;},getTop:function(){return this.top;},setLeft:function(x){this.move(x,this.top);},setTop:function(y){this.move(this.left,y);},getPageLeft:function(){return this._clientRect.left;},getPageTop:function(){return this._clientRect.top;},getOffsetLeft:function(){return this._dom_element.offsetLeft;},getOffsetTop:function(){return this._dom_element.offsetTop;},screenToClient:function(pos){pos.x-=this._clientRect.left+this._dom_element.scrollLeft;pos.y-=this._clientRect.top+this._dom_element.scrollTop;return pos;},clientToScreen:function(pos){pos.x+=this._clientRect.left-this._dom_element.scrollLeft;pos.y+=this._clientRect.top-this._dom_element.scrollTop;return pos;},setPageOffset:function(x,y){if(this.$.parentElement!=document.body){var rc=nus.dom.getObjectRect(this.$.parentElement);x=x-rc.left;y=y-rc.top;}
this.move(x,y);},move:function(x,y){this.onMove(x,y);},moveBy:function(dx,dy){var oldX=this._dom_element.offsetLeft;var oldY=this._dom_element.offsetTop;this.move(oldX+dx,oldY+dy);},moveCenter:function(){var x,y;if(this.$.parentElement!=document.body){x=(this.$.parentElement.offsetWidth-this.width)/2;y=(this.$.parentElement.offsetWidth-this.height)/2;}
else{var org=nus.dom.getScrollPos();x=org.x+(nus.dom.getPageWidth()-this.width)/2;y=org.y+(nus.dom.getPageHeight()-this.height)/2;}
if(x<0)x=0;if(y<0)y=0;this.move(x,y);},onMove:function(x,y){if(this._siblings&&this._siblings.length){var oldX=this.left;var oldY=this.top;for(var i=0,e;e=this._siblings[i];i++){e.moveBy(x-oldX,y-oldY);}}
this._dom_element.style.left=x+"px";this._dom_element.style.top=y+"px";this.left=x;this.top=y;this.updateLayoutValue();},getWidth:function(){return this.width;},getHeight:function(){return this.height;},setWidth:function(w){this.resize(w,this.height);},setHeight:function(h){this.resize(this.width,h);},resize:function(w,h){this.onSize(w,h);},resizeBy:function(dw,dh){w=this._dom_element.offsetWidth;h=this._dom_element.offsetHeight;this.resize(w+dw,h+dh);},onSize:function(w,h){var dw=this.$.offsetWidth;var dh=this.$.offsetHeight;dw-=(this.$.clientWidth||parseInt(this.$.style.width)||dw);dh-=(this.$.clientHeight||parseInt(this.$.style.height)||dh);var cw=w-dw;var ch=h-dh;this.$.style.width=((cw>0)?cw:0)+"px";this.$.style.height=((ch>0)?ch:0)+"px";this.updateLayoutValue();},updateLayoutValue:function(){this.left=this._dom_element.offsetLeft;this.top=this._dom_element.offsetTop;this.width=this._dom_element.offsetWidth;this.height=this._dom_element.offsetHeight;this._clientRect=nus.dom.getObjectRect(this._dom_element);},getClientRect:function(){return this._clientRect;},getScrollSize:function(){return{w:this._dom_element.scrollWidth,h:this._dom_element.scrollHeight};},getScrollPos:function(){return{x:this.$.scrollLeft,y:this.$.scrollTop};},scroll:function(x,y){this._dom_element.scrollLeft=x;this._dom_element.scrollTop=y;},setZIndex:function(z){this._dom_element.style.zIndex=this.zIndex=z;},getZIndex:function(){this.zIndex=parseInt(this._dom_element.style.zIndex);return this.zIndex;},doDrag:function(x,y){this._isLButtonDown=true;this._clickPos={x:x,y:y};this.setCapture();this._dragStartPos={x:x,y:y};this.isDragging=true;nus.event.setDragSrc(null,this,this._dragStartPos);},enableDrag:function(canDrag){this.canDrag=canDrag;if(this.canDrag){this.setStyle({position:"absolute"});}},enableDrop:function(canDrop,dropType){this.canDrop=canDrop;if(dropType){this.dropType=dropType;}
else{this.dropType=null;}},enableDropAccept:function(canDropAccept,acceptType){this.canDropAccept=canDropAccept;if(acceptType){this.dropAcceptType=acceptType;}
else{this.dropAcceptType=null;}},setContents:function(html){this.$.innerHTML=html;this.updateLayoutValue();},getContents:function(){return this.$.innerHTML;},addHTML:function(html,where){where=where||"beforeEnd";this._dom_element.insertAdjacentHTML(where,html);this.updateLayoutValue();},$node:function(){if(arguments.length==0){return this.$.childNodes[0];}
var node=this.$;for(var i=0;i<arguments.length;i++){if(typeof arguments[i]=="string"){node=$findByClass(node,arguments[i]);}
else{var index=arguments[i];if(index<0){index=node.childNodes.length+index;}
node=node.childNodes[index];}
if(!node){return null;}}
return node;},enable:function(isEnable){this._dom_element.disabled=!isEnable;},setBgImage:function(url,repeat){this._dom_element.style.backgroundImage="url("+url+")";if(repeat){this._dom_element.style.backgroundRepeat=repeat;}}});nus.dom.Element.subclass=function(el){if(typeof el=='array'){return el.forEach(nus.dom.Element._subclass_);}
else{return this._subclass_(el);}}
nus.dom.Element._subclass_=function(el){if(typeof el=="string"){el=$(el);}
return new nus.dom.Element(el);}
nus.dom.DivClass=nus.dom.Element.extend({_classTypeName:"nus.dom.DivClass",initialStyle:"",create:function(){nus.lang.Class.prototype.create.apply(this,arguments);this.onPrecreate();this._makeFrame();this._setEvents();this.onCreate();this.updateLayoutValue();},_makeFrame:function(){var style="";if(this.left!=0)
style+="left:"+this.left+"px;";if(this.top!=0)
style+="top:"+this.top+"px;";if(this.width!=0)
style+="width:"+this.width+"px;";if(this.height!=0)
style+="height:"+this.height+"px;";if((nus.isGecko||nus.isWebkit)&&nus.docType.type!="XHTML"){style+=";-moz-box-sizing:border-box;";}
if(this.border!=null){style+="border:"+this.border;}
if(this.backgroundColor!=null){style+=";background-color:"+this.backgroundColor;}
if(this.cursor!=null){style+=";cursor:"+this.cursor;}
style+=";overflow:"+this.overflow;style+=";position:absolute;"+this.initialStyle;var strHTML="<DIV ID='"+this.ID;if(this.styleClassName!=null)
strHTML+="' class='"+this.styleClassName;strHTML+="' style='"+style+";'>"+this.innerHTML+"</DIV>";if(this.parentObject){this._dom_element=this.parentObject._makeChild(strHTML);if(this._dom_element){this.parentObject._addChild(this);}}else{document.body.insertAdjacentHTML("beforeEnd",strHTML);this._dom_element=document.getElementById(this.ID);}
this.$=this._dom_element;if(this.opacity!=100)this.setOpacity(this.opacity);this.setZIndex(this.zIndex);if(!this.isVisible)
this.setVisible(this.isVisible);if(!this._isSelectable){this._dom_element.onselectstart=this.onSelectStart;}
this._event_keymap=[];this.innerHTML=null;this.inititalStyle=null;return true;}});nus.dom.IframeClass=nus.dom.DivClass.extend({_classTypeName:"nus.dom.IframeClass",isLoading:false,scrolling:"auto",_makeFrame:function(){var style="left:"+this.left+"px;top:"+this.top+"px";if(this.width!=0)
style+=";width:"+this.width+"px";if(this.height!=0)
style+=";height:"+this.height+"px";style+=";position:absolute;"+this.initialStyle;if(this.border){style+="border:"+this.border+";";}
var strHTML="<iframe frameborder='no' onload='"+this.ID+"._onLoadComplete()' ID='"+this.ID+"' scrolling='"
+this.scrolling;if(this.styleClassName!=null)
strHTML+="' class='"+this.styleClassName;strHTML+="' style='"+style+";'></iframe>";if(this.parentObject){this._dom_element=this.parentObject._makeChild(strHTML);if(this._dom_element){this.parentObject._addChild(this);}}else{document.body.insertAdjacentHTML("beforeEnd",strHTML);this._dom_element=document.getElementById(this.ID);}
this.$=this._dom_element;if(!this._isSelectable){this._dom_element.onselectstart=nus.event.onselectstart;}
if(this.opacity!=100)this.setOpacity(this.opacity);this.setZIndex(this.zIndex);if(!this.isVisible)
this.setVisible(this.isVisible);if(this.contentURL){this.setContentURL(this.contentURL);}
this._event_keymap=[];return true;},onSize:function(w,h){nus.dom.IframeClass.superCall(this,"onSize",arguments);},setContentURL:function(url){this.isLoading=true;this.contentURL=url;this._dom_element.src=url;},getContentWindow:function(){return this._dom_element.contentWindow;},getContentDocument:function(){var doc=null;try
{doc=this._dom_element.contentWindow.document;}
catch(error)
{nus.debug.reportError(error);}
return doc;},setScrolling:function(flag){this._dom_element.scrolling=flag;},_onLoadComplete:function(){if(!this.isLoading){return;}
this.isLoading=false;this.onLoadComplete();},onLoadComplete:function(){}});nus.dom.IframeDialog=nus.dom.DivClass.extend();nus.dom.IframeDialog.addProperties({_dialog_list:[],register:function(dialog){this._dialog_list.push(dialog);},unregister:function(dialog){this._dialog_list.remove(dialog);},removeAll:function(){this._dialog_list.forEach("e.destroy()");}});nus.dom.IframeDialog.addPrototypes({_classTypeName:"nus.dom.IframeDialog",isLoading:false,scrolling:"no",isVisible:false,border:"solid 4px #c0c0c0",isAutoResize:true,hasVisualEffect:false,hasThrobber:true,_is_cross_domain:false,_makeFrame:function(){nus.dom.IframeDialog.register(this);if(this.hasThrobber){nus.ui.showThrobber();}
this.innerHTML="<iframe frameborder='no' onload='"+this.ID+"._onLoadComplete()' ID='"+this.ID+"_iframe' scrolling='"
+this.scrolling+"' style='width:100%;height:100%;' bgcolor='#ffffff'></iframe>";nus.dom.IframeDialog.superCall(this,"_makeFrame",arguments);this._iframe=this.$node(0);},onCreate:function(){nus.dom.showPopup(this,"",true);if(this.contentURL){this.setContentURL(this.contentURL);}},close:function(){if(this.hasVisualEffect){this._visual_effect=new nus.effect.Moving(this,this.left,-this.height,"easeIn",8);this._visual_effect.onComplete=function(){this.targetObject._visual_effect=null;this.targetObject.destroy();}}
else{this.destroy();}},onDestroy:function(){this.onCloseDialog();if(this._visual_effect){this._visual_effect.abort();this._visual_effect=null;}
if(this.isVisible){nus.dom.hidePopup(this);}
this.setContentWindowProperty("parentDialog",null);this._iframe=null;nus.dom.IframeDialog.unregister(this);nus.dom.IframeDialog.superCall(this,"onDestroy",arguments);},onLoadComplete:function(){try
{this.getContentWindow().parentDialog=this;}
catch(error)
{this._is_cross_domain=true;}
this.onInitDialog();if(this.isAutoResize){this.fitResize();}
if(this.hasVisualEffect){this.moveCenter(false);this.setTop(-this.height);this.setVisible(true);this._visual_effect=new nus.effect.Moving(this,this.left,0,"easeOut",6);this._visual_effect.onComplete=function(){this.targetObject._visual_effect=null;}}
else{this.moveCenter(true);this.setVisible(true);}},fitResize:function(){var doc=this.getContentDocument();if(!doc)return;var dd=doc.body;if(doc.documentElement){dd=doc.documentElement;}
this.resize(dd.scrollWidth,100);this.resize(dd.scrollWidth+10,dd.scrollHeight);},moveCenter:function(isFixed){nus.dom.moveCenter(this.$,isFixed);this.updateLayoutValue();},onCommand:function(cmd,result){switch(cmd){case"resize":this.fitResize();this.moveCenter();break;case"ok":this.close();break;case"cancel":this.close();break;}},setContentURL:function(url){this.isLoading=true;this.contentURL=url;this._iframe.src=url;},getContentWindow:function(){return this._iframe.contentWindow;},setContentWindowProperty:function(name,value){if(this._is_cross_domain){return;}
this.getContentWindow()[name]=value;},getContentDocument:function(){var doc=null;try
{doc=this._iframe.contentWindow.document;}
catch(error)
{}
return doc;},setScrolling:function(flag){this._iframe.scrolling=flag;},_onLoadComplete:function(){if(!this.isLoading){return;}
this.isLoading=false;this.onLoadComplete();if(this.hasThrobber){nus.ui.hideThrobber();}},startLoading:function(){},stopLoading:function(){},onInitDialog:function(){},onCloseDialog:function(){}});nus.dom.FormClass=nus.dom.Element.extend({_classTypeName:"nus.dom.FormClass",initialStyle:""});nus.dom.FormClass.addProperties({getCheckedValue:function(form,name){var elements=form[name];for(var i=0;i<elements.length;i++){if(elements[i].checked){return elements[i].value;}}
return null;}});nus.util.ImagePreloader={_imageIndex:0,_imageList:{},_hiddenDiv:null,load:function(url,callback,args,instance){if(!args)args=[];if(!instance)instance=window;if(!this._hiddenDiv){this._hiddenDiv=nus.dom.createElement("<div style='width:0px;height:0px;visibility:hidden;overflow:hidden;'></div>",document.body);}
var id="__pi_"+this._imageIndex++;this._imageList[id]={id:id,url:url,callback:callback,args:args,instance:instance};var image=nus.dom.createElement("<img id='"+id+"' style='visibility:hidden;'/>",this._hiddenDiv);image.onload=this._onLoadImage;image.onerror=this._onLoadError
image.src=url;return this._imageList[id];},cancel:function(id,src){if(src){for(name in this._imageList){if(this._imageList[name].src==src){id=name;break;}}}
if(!id)return;if($(id)){$(id).removeNode();}
if(this._imageList[id]){delete this._imageList[id];}},clear:function(){this._imageList={};if(this._hiddenDiv){this._hiddenDiv.innerHTML="";}},destroy:function(){this.clear();if(this._hiddenDiv){this._hiddenDiv.removeNode(true);delete this._hiddenDiv;}},_getImageInfo:function(id){var info=this._imageList[id];delete this._imageList[id];return info;},_onLoadImage:function(){this.onload=null;this.onerror=null;if(nus.isIE){this.naturalWidth=this.width;this.naturalHeight=this.height;}
var info=nus.util.ImagePreloader._getImageInfo(this.id);if(info.instance){info.callback.apply(info.instance,[this,true].concat(info.args));}
else{this.removeNode(true);}},_onLoadError:function(){this.onload=null;this.onerror=null;var info=nus.util.ImagePreloader._getImageInfo(this.id);if(info.instance){info.callback.apply(info.instance,[this,false].concat(info.args));}
else{this.removeNode(true);}}};nus.util.getFitImageBox=function(iw,ih,vw,vh){var wr=vw/iw;var hr=vh/ih;var ratio=(wr<hr)?wr:hr;if(ratio>1.0){ratio=1.0;}
var w=ratio*iw;var h=ratio*ih;return{x:(vw-w)/2,y:(vh-h)/2,w:w,h:h};}
nus.util.getFilledImageBox=function(iw,ih,vw,vh){var wr=vw/iw;var hr=vh/ih;var ratio=(wr>hr)?wr:hr;var w=ratio*iw;var h=ratio*ih;return{x:(vw-w)/2,y:(vh-h)/2,w:w,h:h};}
nus.util.getSquareImageBox=function(iw,ih,vw,vh){var wr=vw/iw;var hr=vh/ih;var ratio=(wr>hr)?wr:hr;if(ratio>1.0){ratio=1.0;}
var w=ratio*iw;var h=ratio*ih;return{x:(vw-w)/2,y:(vh-h)/2,w:w,h:h};}
nus.util.IMAGEBOX_FIT=1;nus.util.IMAGEBOX_FILLED=2;nus.util.IMAGEBOX_SQUARE=3;nus.util._IMAGEBOX_FUNCTIONS=[null,nus.util.getFitImageBox,nus.util.getFilledImageBox,nus.util.getSquareImageBox];nus.util.setImageBox=function(image,vw,vh,option){var iw=image.naturalWidth||image.width;var ih=image.naturalHeight||image.height;if(!vw||!vh){vw=image.parentElement.offsetWidth||parseInt(image.parentElement.style.width);vh=image.parentElement.offsetHeight||parseInt(image.parentElement.style.height);}
option=option||nus.util.IMAGEBOX_FIT;var box=nus.util._IMAGEBOX_FUNCTIONS[option](iw,ih,vw,vh);nus.dom.setObjectRect(image,box.x,box.y,box.w,box.h);}
nus.util.showImage=function(image,option){var src=image.src||image;;option=option||{type:"light_box"};if(option.type=="new_window"){window.open(src);return;}
nus.util.LightBox.show(src,option);}
nus.util.LightBox={isShowing:false,_frameDiv:null,_option:null,_preload:null,_init:function(){var html=["<div style='visibility:hidden;position:absolute;border:solid 10px #ffffff;background-color:#f0f0f0;'>","<img class='button' src='"+$URL("images/lightbox_left.gif"),"' style='position:absolute;display:none;cursor:pointer;' onclick='nus.util.LightBox.prev();'/>","<img  class='button' src='"+$URL("images/lightbox_right.gif"),"' style='position:absolute;display:none;cursor:pointer;' onclick='nus.util.LightBox.next();return false;'/>","<div class='comment_link' style='text-align:center;display:none;background-color:#ffffff;height:35px;'>","<a href='' style='font-size:16px;font-weight:bold;text-decoration:underline;'>More pics</a>","</div>","</div>"];this._frameDiv=nus.dom.createElement(html.toHTML(),document.body);this._frameDiv.onclick=nus.util.LightBox._onClick;},show:function(url,option){if(!this._frameDiv){this._init();}
this._option=option;if(this._option.commentLink){var link=$node(this._frameDiv,"comment_link",0);link.href=this._option.commentLink;$node(this._frameDiv,"comment_link").style.display="block";}
else{$node(this._frameDiv,"comment_link").style.display="none";}
var org=nus.dom.getScrollPos();var box=nus.util.getFitImageBox(200,200,nus.dom.getPageWidth(),nus.dom.getPageHeight());nus.dom.resize(this._frameDiv,box.w,box.h);nus.dom.moveCenter(this._frameDiv,true);this.showThrobber();this.isShowing=true;this._frameDiv.style.visibility="visible";nus.dom.showPopup(this._frameDiv,"nus.util.LightBox.hide()",true);this._preload=nus.util.ImagePreloader.load(url,this.onLoadComplete,null,nus.util.LightBox);},onLoadComplete:function(image,isSuccess){if(!this.isShowing){image.remodeNode(true);}
if(!isSuccess){image.removeNode(true);this.hide();return;}
this.hideThrobber();var show_effect=false;if($node(this._frameDiv,"light_box_photo")){$node(this._frameDiv,"light_box_photo").removeNode();show_effect=false;}
this._popupImage=image;var top_padding=this._option.commentLink?35:0;var box=nus.util.getFitImageBox(image.naturalWidth,image.naturalHeight+top_padding,nus.dom.getPageWidth()-150,nus.dom.getPageHeight()-100);if(show_effect){new nus.effect.Sizing(this._frameDiv,box.w,box.h,"backOut",6,nus.effect.ALIGN_CENTER).onComplete="nus.util.LightBox.onShowPhoto()";}
else{var org=nus.dom.getScrollPos();this._frameDiv.style.visibility="hidden";nus.dom.resize(this._frameDiv,box.w,box.h);nus.dom.moveCenter(this._frameDiv,true);this.onShowPhoto();this._frameDiv.style.visibility="inherit";}},onShowPhoto:function(){if(!this.isShowing)return;var top_padding=this._option.commentLink?35:0;this._popupImage.className="light_box_photo";this._popupImage.style.width=this._frameDiv.clientWidth+"px";this._popupImage.style.height=this._frameDiv.clientHeight-top_padding+"px";this._frameDiv.appendChild(this._popupImage);this._popupImage.style.visibility="inherit";this.showButtons();},_onClick:function(ev){ev=ev||window.event;nus.util.LightBox.onClick(ev);},onClick:function(ev){if(ev.srcElement.className=="button"){return;}
this.hide();},hide:function(){if(!this.isShowing)return;this.isShowing=false;this.hideThrobber();this.hideButtons();this._frameDiv.style.visibility="hidden";nus.dom.hidePopup(this._frameDiv);if(this._popupImage){this._popupImage.removeNode();this._popupImage=null;}
else{if(this._preload){nus.util.ImagePreloader.cancel(this._preload.id);}}
this._option=null;this._preload=null;},prev:function(){this.showThrobber();this.hideButtons();var image_url;if(this._option.iterator){image_url=this._option.iterator.prev();}
else if(this._option.prev){image_url=eval(this._option.prev);}
this._preload=nus.util.ImagePreloader.load(image_url,this.onLoadComplete,null,nus.util.LightBox);},next:function(){this.showThrobber();this.hideButtons();var image_url;if(this._option.iterator){image_url=this._option.iterator.next();}
else if(this._option.prev){image_url=eval(this._option.next);}
this._preload=nus.util.ImagePreloader.load(image_url,this.onLoadComplete,null,nus.util.LightBox);},showButtons:function(){if(this._option.iterator){var buttons=$childByClass(this._frameDiv,"button");nus.dom.move(buttons[0],-60,Math.floor(this._frameDiv.offsetHeight/2-25));nus.dom.move(buttons[1],this._frameDiv.offsetWidth,Math.floor(this._frameDiv.offsetHeight/2-25));buttons[0].style.display=buttons[1].style.display="block";}},hideButtons:function(){$childByClass(this._frameDiv,"button").forEach("e.style.display='none'");},showThrobber:function(){this._frameDiv.insertAdjacentHTML("beforeEnd","<img class='throbber' src='"+$URL("images/throbber_medium.gif")
+"' style='position:absolute;left:"+Math.floor(this._frameDiv.offsetWidth/2-20)+"px;top:"
+Math.floor(this._frameDiv.offsetHeight/2-20)+"px;'/>");},hideThrobber:function(){var throbber=$findByClass(this._frameDiv,"throbber")
if(throbber){throbber.removeNode();}}}
nus.util.ColorSpace={validateColorValue:function(color){color.match(new RegExp("(#[0-9a-fA-F]{3-6})","gi"));color=RegExp.$1;if(!color||color==""){color="";}
return color;},rgb2color:function(color){if(color.substr(0,3)=="rgb"){var result=color.match(new RegExp("([0-9]{1,3})","gi"));color="#"+parseInt(result[0]).toHex()+parseInt(result[1]).toHex()+parseInt(result[2]).toHex();}
else if(color.substr(0,1)=="#"){}
else{color="";}
return color;},str2color:function(color){if(color.substr(0,3)=="rgb"){var s=color.substr(4,color.length-5);var rgb=s.split(",");rgb[0]=parseInt(rgb[0]);rgb[1]=parseInt(rgb[1]);rgb[2]=parseInt(rgb[2]);return rgb;}
var color_val=parseInt(color.substr(1),16);var rgb=[(color_val&0xff0000)>>16,(color_val&0x00ff00)>>8,color_val&0xff];return rgb;},color2rgba:function(color,opacity){if(color.substr(0,3)=="rgb"){var s=color.substr(3);s="rgba"+s.substr(0,s.length-1)+","+(opacity/100)+")";return s;}
var color_val=parseInt(color.substr(1),16);return"rgba("+((color_val&0xff0000)>>16)+","+((color_val&0x00ff00)>>8)+","+(color_val&0xff)+","+(opacity/100)+")";},rgb2hsv:function(R,G,B){if(arguments.length<3){if(typeof R=="string"){R=nus.util.ColorSpace.str2color(R);}
B=R[2];G=R[1];R=R[0];}
var H=0,S=0,V=0;var var_R=(R/255);var var_G=(G/255);var var_B=(B/255);var var_Min=Math.min(var_R,var_G,var_B);var var_Max=Math.max(var_R,var_G,var_B);var del_Max=var_Max-var_Min;V=var_Max;if(del_Max==0)
{H=0
S=0}
else
{S=del_Max/var_Max
var del_R=(((var_Max-var_R)/6)+(del_Max/2))/del_Max;var del_G=(((var_Max-var_G)/6)+(del_Max/2))/del_Max;var del_B=(((var_Max-var_B)/6)+(del_Max/2))/del_Max;if(var_R==var_Max)H=del_B-del_G;else if(var_G==var_Max)H=(1/3)+del_R-del_B;else if(var_B==var_Max)H=(2/3)+del_G-del_R;if(H<0)H+=1;if(H>1)H-=1;}
return[H,S,V];},hsv2rgb:function(H,S,V){if(arguments.length<3){S=H[1];V=H[2];H=H[0];}
var R,G,B;if(S==0)
{R=V*255;G=V*255;B=V*255;}
else
{var var_r,var_g,var_b;var var_h=H*6;if(var_h==6)var_h=0;var var_i=Math.floor(var_h);var var_1=V*(1-S);var var_2=V*(1-S*(var_h-var_i));var var_3=V*(1-S*(1-(var_h-var_i)));if(var_i==0){var_r=V;var_g=var_3;var_b=var_1}
else if(var_i==1){var_r=var_2;var_g=V;var_b=var_1}
else if(var_i==2){var_r=var_1;var_g=V;var_b=var_3}
else if(var_i==3){var_r=var_1;var_g=var_2;var_b=V}
else if(var_i==4){var_r=var_3;var_g=var_1;var_b=V}
else{var_r=V;var_g=var_1;var_b=var_2}
R=var_r*255;G=var_g*255;B=var_b*255;}
return[Math.round(R),Math.round(G),Math.round(B)];}}
nus.util.TimeSpan=function(){this._start=new Date;}
_addPrototype(nus.util.TimeSpan,{_start:null,ellapsed:function(){var e=new Date;var s=this._start;var diff=e.getMinutes()*60000+e.getSeconds()*1000+e.getMilliseconds()-
(s.getMinutes()*60000+s.getSeconds()*1000+s.getMilliseconds());return diff;}});nus.Tracker={register:function(category,type,detail){if(window.urchinTracker&&!nus.isDebugging){var tracked_url="/Events/"+category+"/"+(type||"")+(detail||"");urchinTracker(tracked_url.replace(" ","_"));}
else{}}}
nus.setDebugMode=function(){nus.require("nus.debug.*");nus.isDebugging=true;}
var $log=function(){if(window.console){window.console.log.apply(arguments);}}