var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_2,_3){
for(var _4 in _3){
_2[_4]=_3[_4];
}
return _2;
};
Object.extend(Object,{inspect:function(_5){
try{
if(_5===undefined){
return "undefined";
}
if(_5===null){
return "null";
}
return _5.inspect?_5.inspect():_5.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_6){
var _7=[];
for(var _8 in _6){
_7.push(_8);
}
return _7;
},values:function(_9){
var _a=[];
for(var _b in _9){
_a.push(_9[_b]);
}
return _a;
},clone:function(_c){
return Object.extend({},_c);
}});
Function.prototype.bind=function(){
var _d=this,args=$A(arguments),object=args.shift();
return function(){
return _d.apply(object,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_e){
var _f=this,args=$A(arguments),_e=args.shift();
return function(_10){
return _f.apply(_e,[(_10||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _11=this.toString(16);
if(this<16){
return "0"+_11;
}
return _11;
},succ:function(){
return this+1;
},times:function(_12){
$R(0,this,true).each(_12);
return this;
}});
var Try={these:function(){
var _13;
for(var i=0,length=arguments.length;i<length;i++){
var _15=arguments[i];
try{
_13=_15();
break;
}
catch(e){
}
}
return _13;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_16,_17){
this.callback=_16;
this.frequency=_17;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
String.interpret=function(_18){
return _18==null?"":String(_18);
};
Object.extend(String.prototype,{gsub:function(_19,_1a){
var _1b="",source=this,match;
_1a=arguments.callee.prepareReplacement(_1a);
while(source.length>0){
if(match=source.match(_19)){
_1b+=source.slice(0,match.index);
_1b+=String.interpret(_1a(match));
source=source.slice(match.index+match[0].length);
}else{
_1b+=source,source="";
}
}
return _1b;
},sub:function(_1c,_1d,_1e){
_1d=this.gsub.prepareReplacement(_1d);
_1e=_1e===undefined?1:_1e;
return this.gsub(_1c,function(_1f){
if(--_1e<0){
return _1f[0];
}
return _1d(_1f);
});
},scan:function(_20,_21){
this.gsub(_20,_21);
return this;
},truncate:function(_22,_23){
_22=_22||30;
_23=_23===undefined?"...":_23;
return this.length>_22?this.slice(0,_22-_23.length)+_23:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _24=new RegExp(Prototype.ScriptFragment,"img");
var _25=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_24)||[]).map(function(_26){
return (_26.match(_25)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_27){
return eval(_27);
});
},escapeHTML:function(){
var div=document.createElement("div");
var _29=document.createTextNode(this);
div.appendChild(_29);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_2b,_2c){
return _2b+_2c.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_2d){
var _2e=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_2e){
return {};
}
return _2e[1].split(_2d||"&").inject({},function(_2f,_30){
if((_30=_30.split("="))[0]){
var _31=decodeURIComponent(_30[0]);
var _32=_30[1]?decodeURIComponent(_30[1]):undefined;
if(_2f[_31]!==undefined){
if(_2f[_31].constructor!=Array){
_2f[_31]=[_2f[_31]];
}
if(_32){
_2f[_31].push(_32);
}
}else{
_2f[_31]=_32;
}
}
return _2f;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},camelize:function(){
var _33=this.split("-"),len=_33.length;
if(len==1){
return _33[0];
}
var _34=this.charAt(0)=="-"?_33[0].charAt(0).toUpperCase()+_33[0].substring(1):_33[0];
for(var i=1;i<len;i++){
_34+=_33[i].charAt(0).toUpperCase()+_33[i].substring(1);
}
return _34;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
},inspect:function(_36){
var _37=this.replace(/\\/g,"\\\\");
if(_36){
return "\""+_37.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_37.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_38){
if(typeof _38=="function"){
return _38;
}
var _39=new Template(_38);
return function(_3a){
return _39.evaluate(_3a);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_3b,_3c){
this.template=_3b.toString();
this.pattern=_3c||Template.Pattern;
},evaluate:function(_3d){
return this.template.gsub(this.pattern,function(_3e){
var _3f=_3e[1];
if(_3f=="\\"){
return _3e[2];
}
return _3f+String.interpret(_3d[_3e[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_40){
var _41=0;
try{
this._each(function(_42){
try{
_40(_42,_41++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_43,_44){
var _45=-_43,slices=[],array=this.toArray();
while((_45+=_43)<array.length){
slices.push(array.slice(_45,_45+_43));
}
return slices.map(_44);
},all:function(_46){
var _47=true;
this.each(function(_48,_49){
_47=_47&&!!(_46||Prototype.K)(_48,_49);
if(!_47){
throw $break;
}
});
return _47;
},any:function(_4a){
var _4b=false;
this.each(function(_4c,_4d){
if(_4b=!!(_4a||Prototype.K)(_4c,_4d)){
throw $break;
}
});
return _4b;
},collect:function(_4e){
var _4f=[];
this.each(function(_50,_51){
_4f.push((_4e||Prototype.K)(_50,_51));
});
return _4f;
},detect:function(_52){
var _53;
this.each(function(_54,_55){
if(_52(_54,_55)){
_53=_54;
throw $break;
}
});
return _53;
},findAll:function(_56){
var _57=[];
this.each(function(_58,_59){
if(_56(_58,_59)){
_57.push(_58);
}
});
return _57;
},grep:function(_5a,_5b){
var _5c=[];
this.each(function(_5d,_5e){
var _5f=_5d.toString();
if(_5f.match(_5a)){
_5c.push((_5b||Prototype.K)(_5d,_5e));
}
});
return _5c;
},include:function(_60){
var _61=false;
this.each(function(_62){
if(_62==_60){
_61=true;
throw $break;
}
});
return _61;
},inGroupsOf:function(_63,_64){
_64=_64===undefined?null:_64;
return this.eachSlice(_63,function(_65){
while(_65.length<_63){
_65.push(_64);
}
return _65;
});
},inject:function(_66,_67){
this.each(function(_68,_69){
_66=_67(_66,_68,_69);
});
return _66;
},invoke:function(_6a){
var _6b=$A(arguments).slice(1);
return this.map(function(_6c){
return _6c[_6a].apply(_6c,_6b);
});
},max:function(_6d){
var _6e;
this.each(function(_6f,_70){
_6f=(_6d||Prototype.K)(_6f,_70);
if(_6e==undefined||_6f>=_6e){
_6e=_6f;
}
});
return _6e;
},min:function(_71){
var _72;
this.each(function(_73,_74){
_73=(_71||Prototype.K)(_73,_74);
if(_72==undefined||_73<_72){
_72=_73;
}
});
return _72;
},partition:function(_75){
var _76=[],falses=[];
this.each(function(_77,_78){
((_75||Prototype.K)(_77,_78)?_76:falses).push(_77);
});
return [_76,falses];
},pluck:function(_79){
var _7a=[];
this.each(function(_7b,_7c){
_7a.push(_7b[_79]);
});
return _7a;
},reject:function(_7d){
var _7e=[];
this.each(function(_7f,_80){
if(!_7d(_7f,_80)){
_7e.push(_7f);
}
});
return _7e;
},sortBy:function(_81){
return this.map(function(_82,_83){
return {value:_82,criteria:_81(_82,_83)};
}).sort(function(_84,_85){
var a=_84.criteria,b=_85.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _87=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_87=args.pop();
}
var _88=[this].concat(args).map($A);
return this.map(function(_89,_8a){
return _87(_88.pluck(_8a));
});
},size:function(){
return this.toArray().length;
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_8b){
if(!_8b){
return [];
}
if(_8b.toArray){
return _8b.toArray();
}else{
var _8c=[];
for(var i=0,length=_8b.length;i<length;i++){
_8c.push(_8b[i]);
}
return _8c;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_8e){
for(var i=0,length=this.length;i<length;i++){
_8e(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_90){
return _90!=null;
});
},flatten:function(){
return this.inject([],function(_91,_92){
return _91.concat(_92&&_92.constructor==Array?_92.flatten():[_92]);
});
},without:function(){
var _93=$A(arguments);
return this.select(function(_94){
return !_93.include(_94);
});
},indexOf:function(_95){
for(var i=0,length=this.length;i<length;i++){
if(this[i]==_95){
return i;
}
}
return -1;
},reverse:function(_97){
return (_97!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_98,_99){
return _98.include(_99)?_98:_98.concat([_99]);
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_9a){
_9a=_9a.strip();
return _9a?_9a.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _9b=[];
for(var i=0,length=this.length;i<length;i++){
_9b.push(this[i]);
}
for(var i=0,length=arguments.length;i<length;i++){
if(arguments[i].constructor==Array){
for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++){
_9b.push(arguments[i][j]);
}
}else{
_9b.push(arguments[i]);
}
}
return _9b;
};
}
var Hash=function(obj){
Object.extend(this,obj||{});
};
Object.extend(Hash,{toQueryString:function(obj){
var _a1=[];
this.prototype._each.call(obj,function(_a2){
if(!_a2.key){
return;
}
if(_a2.value&&_a2.value.constructor==Array){
var _a3=_a2.value.compact();
if(_a3.length<2){
_a2.value=_a3.reduce();
}else{
key=encodeURIComponent(_a2.key);
_a3.each(function(_a4){
_a4=_a4!=undefined?encodeURIComponent(_a4):"";
_a1.push(key+"="+encodeURIComponent(_a4));
});
return;
}
}
if(_a2.value==undefined){
_a2[1]="";
}
_a1.push(_a2.map(encodeURIComponent).join("="));
});
return _a1.join("&");
}});
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_a5){
for(var key in this){
var _a7=this[key];
if(_a7&&_a7==Hash.prototype[key]){
continue;
}
var _a8=[key,_a7];
_a8.key=key;
_a8.value=_a7;
_a5(_a8);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_a9){
return $H(_a9).inject(this,function(_aa,_ab){
_aa[_ab.key]=_ab.value;
return _aa;
});
},remove:function(){
var _ac;
for(var i=0,length=arguments.length;i<length;i++){
var _ae=this[arguments[i]];
if(_ae!==undefined){
if(_ac===undefined){
_ac=_ae;
}else{
if(_ac.constructor!=Array){
_ac=[_ac];
}
_ac.push(_ae);
}
}
delete this[arguments[i]];
}
return _ac;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.map(function(_af){
return _af.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}});
function $H(_b0){
if(_b0&&_b0.constructor==Hash){
return _b0;
}
return new Hash(_b0);
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_b1,end,_b3){
this.start=_b1;
this.end=end;
this.exclusive=_b3;
},_each:function(_b4){
var _b5=this.start;
while(this.include(_b5)){
_b4(_b5);
_b5=_b5.succ();
}
},include:function(_b6){
if(_b6<this.start){
return false;
}
if(this.exclusive){
return _b6<this.end;
}
return _b6<=this.end;
}});
var $R=function(_b7,end,_b9){
return new ObjectRange(_b7,end,_b9);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_ba){
this.responders._each(_ba);
},register:function(_bb){
if(!this.include(_bb)){
this.responders.push(_bb);
}
},unregister:function(_bc){
this.responders=this.responders.without(_bc);
},dispatch:function(_bd,_be,_bf,_c0){
this.each(function(_c1){
if(typeof _c1[_bd]=="function"){
try{
_c1[_bd].apply(_c1,[_be,_bf,_c0]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_c2){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_c2||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=this.options.parameters.toQueryParams();
}
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,_c4){
this.transport=Ajax.getTransport();
this.setOptions(_c4);
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _c6=this.options.parameters;
if(!["get","post"].include(this.method)){
_c6["_method"]=this.method;
this.method="post";
}
_c6=Hash.toQueryString(_c6);
if(_c6&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_c6+="&_=";
}
if(this.method=="get"&&_c6){
this.url+=(this.url.indexOf("?")>-1?"&":"?")+_c6;
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
var _c7=this.method=="post"?(this.options.postBody||_c6):null;
this.transport.send(_c7);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _c8=this.transport.readyState;
if(_c8>1&&!((_c8==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _c9={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){
_c9["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_c9["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _ca=this.options.requestHeaders;
if(typeof _ca.push=="function"){
for(var i=0,length=_ca.length;i<length;i+=2){
_c9[_ca[i]]=_ca[i+1];
}
}else{
$H(_ca).each(function(_cc){
_c9[_cc.key]=_cc.value;
});
}
}
for(var _cd in _c9){
this.transport.setRequestHeader(_cd,_c9[_cd]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_ce){
var _cf=Ajax.Request.Events[_ce];
var _d0=this.transport,json=this.evalJSON();
if(_cf=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_d0,json);
}
catch(e){
this.dispatchException(e);
}
if((this.getHeader("Content-type")||"text/javascript").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_cf]||Prototype.emptyFunction)(_d0,json);
Ajax.Responders.dispatch("on"+_cf,this,_d0,json);
}
catch(e){
this.dispatchException(e);
}
if(_cf=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(_d1){
try{
return this.transport.getResponseHeader(_d1);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var _d2=this.getHeader("X-JSON");
return _d2?eval("("+_d2+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_d3){
(this.options.onException||Prototype.emptyFunction)(this,_d3);
Ajax.Responders.dispatch("onException",this,_d3);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_d4,url,_d6){
this.container={success:(_d4.success||_d4),failure:(_d4.failure||(_d4.success?null:_d4))};
this.transport=Ajax.getTransport();
this.setOptions(_d6);
var _d7=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_d8,_d9){
this.updateContent();
_d7(_d8,_d9);
}).bind(this);
this.request(url);
},updateContent:function(){
var _da=this.container[this.success()?"success":"failure"];
var _db=this.transport.responseText;
if(!this.options.evalScripts){
_db=_db.stripScripts();
}
if(_da=$(_da)){
if(this.options.insertion){
new this.options.insertion(_da,_db);
}else{
_da.update(_db);
}
}
if(this.success()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_dc,url,_de){
this.setOptions(_de);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_dc;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_df){
if(this.options.decay){
this.decay=(_df.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_df.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
function $(_e0){
if(arguments.length>1){
for(var i=0,elements=[],length=arguments.length;i<length;i++){
elements.push($(arguments[i]));
}
return elements;
}
if(typeof _e0=="string"){
_e0=document.getElementById(_e0);
}
return Element.extend(_e0);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_e2,_e3){
var _e4=[];
var _e5=document.evaluate(_e2,$(_e3)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,length=_e5.snapshotLength;i<length;i++){
_e4.push(_e5.snapshotItem(i));
}
return _e4;
};
}
document.getElementsByClassName=function(_e7,_e8){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_e7+" ')]";
return document._getElementsByXPath(q,_e8);
}else{
var _ea=($(_e8)||document.body).getElementsByTagName("*");
var _eb=[],child;
for(var i=0,length=_ea.length;i<length;i++){
child=_ea[i];
if(Element.hasClassName(child,_e7)){
_eb.push(Element.extend(child));
}
}
return _eb;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_ed){
if(!_ed||_nativeExtensions||_ed.nodeType==3){
return _ed;
}
if(!_ed._extended&&_ed.tagName&&_ed!=window){
var _ee=Object.clone(Element.Methods),cache=Element.extend.cache;
if(_ed.tagName=="FORM"){
Object.extend(_ee,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_ed.tagName)){
Object.extend(_ee,Form.Element.Methods);
}
Object.extend(_ee,Element.Methods.Simulated);
for(var _ef in _ee){
var _f0=_ee[_ef];
if(typeof _f0=="function"&&!(_ef in _ed)){
_ed[_ef]=cache.findOrStore(_f0);
}
}
}
_ed._extended=true;
return _ed;
};
Element.extend.cache={findOrStore:function(_f1){
return this[_f1]=this[_f1]||function(){
return _f1.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_f2){
return $(_f2).style.display!="none";
},toggle:function(_f3){
_f3=$(_f3);
Element[Element.visible(_f3)?"hide":"show"](_f3);
return _f3;
},hide:function(_f4){
$(_f4).style.display="none";
return _f4;
},show:function(_f5){
$(_f5).style.display="";
return _f5;
},remove:function(_f6){
_f6=$(_f6);
_f6.parentNode.removeChild(_f6);
return _f6;
},update:function(_f7,_f8){
_f8=typeof _f8=="undefined"?"":_f8.toString();
$(_f7).innerHTML=_f8.stripScripts();
setTimeout(function(){
_f8.evalScripts();
},10);
return _f7;
},replace:function(_f9,_fa){
_f9=$(_f9);
_fa=typeof _fa=="undefined"?"":_fa.toString();
if(_f9.outerHTML){
_f9.outerHTML=_fa.stripScripts();
}else{
var _fb=_f9.ownerDocument.createRange();
_fb.selectNodeContents(_f9);
_f9.parentNode.replaceChild(_fb.createContextualFragment(_fa.stripScripts()),_f9);
}
setTimeout(function(){
_fa.evalScripts();
},10);
return _f9;
},inspect:function(_fc){
_fc=$(_fc);
var _fd="<"+_fc.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(_fe){
var _ff=_fe.first(),attribute=_fe.last();
var _100=(_fc[_ff]||"").toString();
if(_100){
_fd+=" "+attribute+"="+_100.inspect(true);
}
});
return _fd+">";
},recursivelyCollect:function(_101,_102){
_101=$(_101);
var _103=[];
while(_101=_101[_102]){
if(_101.nodeType==1){
_103.push(Element.extend(_101));
}
}
return _103;
},ancestors:function(_104){
return $(_104).recursivelyCollect("parentNode");
},descendants:function(_105){
return $A($(_105).getElementsByTagName("*"));
},immediateDescendants:function(_106){
if(!(_106=$(_106).firstChild)){
return [];
}
while(_106&&_106.nodeType!=1){
_106=_106.nextSibling;
}
if(_106){
return [_106].concat($(_106).nextSiblings());
}
return [];
},previousSiblings:function(_107){
return $(_107).recursivelyCollect("previousSibling");
},nextSiblings:function(_108){
return $(_108).recursivelyCollect("nextSibling");
},siblings:function(_109){
_109=$(_109);
return _109.previousSiblings().reverse().concat(_109.nextSiblings());
},match:function(_10a,_10b){
if(typeof _10b=="string"){
_10b=new Selector(_10b);
}
return _10b.match($(_10a));
},up:function(_10c,_10d,_10e){
return Selector.findElement($(_10c).ancestors(),_10d,_10e);
},down:function(_10f,_110,_111){
return Selector.findElement($(_10f).descendants(),_110,_111);
},previous:function(_112,_113,_114){
return Selector.findElement($(_112).previousSiblings(),_113,_114);
},next:function(_115,_116,_117){
return Selector.findElement($(_115).nextSiblings(),_116,_117);
},getElementsBySelector:function(){
var args=$A(arguments),element=$(args.shift());
return Selector.findChildElements(element,args);
},getElementsByClassName:function(_119,_11a){
return document.getElementsByClassName(_11a,_119);
},readAttribute:function(_11b,name){
_11b=$(_11b);
if(document.all&&!window.opera){
var t=Element._attributeTranslations;
if(t.values[name]){
return t.values[name](_11b,name);
}
if(t.names[name]){
name=t.names[name];
}
var _11e=_11b.attributes[name];
if(_11e){
return _11e.nodeValue;
}
}
return _11b.getAttribute(name);
},getHeight:function(_11f){
return $(_11f).getDimensions().height;
},getWidth:function(_120){
return $(_120).getDimensions().width;
},classNames:function(_121){
return new Element.ClassNames(_121);
},hasClassName:function(_122,_123){
if(!(_122=$(_122))){
return;
}
var _124=_122.className;
if(_124.length==0){
return false;
}
if(_124==_123||_124.match(new RegExp("(^|\\s)"+_123+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_125,_126){
if(!(_125=$(_125))){
return;
}
Element.classNames(_125).add(_126);
return _125;
},removeClassName:function(_127,_128){
if(!(_127=$(_127))){
return;
}
Element.classNames(_127).remove(_128);
return _127;
},toggleClassName:function(_129,_12a){
if(!(_129=$(_129))){
return;
}
Element.classNames(_129)[_129.hasClassName(_12a)?"remove":"add"](_12a);
return _129;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_12b){
_12b=$(_12b);
var node=_12b.firstChild;
while(node){
var _12d=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_12b.removeChild(node);
}
node=_12d;
}
return _12b;
},empty:function(_12e){
return $(_12e).innerHTML.match(/^\s*$/);
},descendantOf:function(_12f,_130){
_12f=$(_12f),_130=$(_130);
while(_12f=_12f.parentNode){
if(_12f==_130){
return true;
}
}
return false;
},scrollTo:function(_131){
_131=$(_131);
var pos=Position.cumulativeOffset(_131);
window.scrollTo(pos[0],pos[1]);
return _131;
},getStyle:function(_133,_134){
_133=$(_133);
if(["float","cssFloat"].include(_134)){
_134=(typeof _133.style.styleFloat!="undefined"?"styleFloat":"cssFloat");
}
_134=_134.camelize();
var _135=_133.style[_134];
if(!_135){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_133,null);
_135=css?css[_134]:null;
}else{
if(_133.currentStyle){
_135=_133.currentStyle[_134];
}
}
}
if((_135=="auto")&&["width","height"].include(_134)&&(_133.getStyle("display")!="none")){
_135=_133["offset"+_134.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].include(_134)){
if(Element.getStyle(_133,"position")=="static"){
_135="auto";
}
}
if(_134=="opacity"){
if(_135){
return parseFloat(_135);
}
if(_135=(_133.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_135[1]){
return parseFloat(_135[1])/100;
}
}
return 1;
}
return _135=="auto"?null:_135;
},setStyle:function(_137,_138){
_137=$(_137);
for(var name in _138){
var _13a=_138[name];
if(name=="opacity"){
if(_13a==1){
_13a=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_137.style.filter=_137.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_13a===""){
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_137.style.filter=_137.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_13a<0.00001){
_13a=0;
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_137.style.filter=_137.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_13a*100+")";
}
}
}
}else{
if(["float","cssFloat"].include(name)){
name=(typeof _137.style.styleFloat!="undefined")?"styleFloat":"cssFloat";
}
}
_137.style[name.camelize()]=_13a;
}
return _137;
},getDimensions:function(_13b){
_13b=$(_13b);
var _13c=$(_13b).getStyle("display");
if(_13c!="none"&&_13c!=null){
return {width:_13b.offsetWidth,height:_13b.offsetHeight};
}
var els=_13b.style;
var _13e=els.visibility;
var _13f=els.position;
var _140=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _141=_13b.clientWidth;
var _142=_13b.clientHeight;
els.display=_140;
els.position=_13f;
els.visibility=_13e;
return {width:_141,height:_142};
},makePositioned:function(_143){
_143=$(_143);
var pos=Element.getStyle(_143,"position");
if(pos=="static"||!pos){
_143._madePositioned=true;
_143.style.position="relative";
if(window.opera){
_143.style.top=0;
_143.style.left=0;
}
}
return _143;
},undoPositioned:function(_145){
_145=$(_145);
if(_145._madePositioned){
_145._madePositioned=undefined;
_145.style.position=_145.style.top=_145.style.left=_145.style.bottom=_145.style.right="";
}
return _145;
},makeClipping:function(_146){
_146=$(_146);
if(_146._overflow){
return _146;
}
_146._overflow=_146.style.overflow||"auto";
if((Element.getStyle(_146,"overflow")||"visible")!="hidden"){
_146.style.overflow="hidden";
}
return _146;
},undoClipping:function(_147){
_147=$(_147);
if(!_147._overflow){
return _147;
}
_147.style.overflow=_147._overflow=="auto"?"":_147._overflow;
_147._overflow=null;
return _147;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});
Element._attributeTranslations={};
Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};
Element._attributeTranslations.values={_getAttr:function(_148,_149){
return _148.getAttribute(_149,2);
},_flag:function(_14a,_14b){
return $(_14a).hasAttribute(_14b)?_14b:null;
},style:function(_14c){
return _14c.style.cssText.toLowerCase();
},title:function(_14d){
var node=_14d.getAttributeNode("title");
return node.specified?node.nodeValue:null;
}};
Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});
Element.Methods.Simulated={hasAttribute:function(_14f,_150){
var t=Element._attributeTranslations;
_150=t.names[_150]||_150;
return $(_14f).getAttributeNode(_150).specified;
}};
if(document.all&&!window.opera){
Element.Methods.update=function(_152,html){
_152=$(_152);
html=typeof html=="undefined"?"":html.toString();
var _154=_152.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_154)){
var div=document.createElement("div");
switch(_154){
case "THEAD":
case "TBODY":
div.innerHTML="<table><tbody>"+html.stripScripts()+"</tbody></table>";
depth=2;
break;
case "TR":
div.innerHTML="<table><tbody><tr>"+html.stripScripts()+"</tr></tbody></table>";
depth=3;
break;
case "TD":
div.innerHTML="<table><tbody><tr><td>"+html.stripScripts()+"</td></tr></tbody></table>";
depth=4;
}
$A(_152.childNodes).each(function(node){
_152.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_152.appendChild(node);
});
}else{
_152.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _152;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _159="HTML"+tag+"Element";
if(window[_159]){
return;
}
var _15a=window[_159]={};
_15a.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_15b){
Object.extend(Element.Methods,_15b||{});
function copy(_15c,_15d,_15e){
_15e=_15e||false;
var _15f=Element.extend.cache;
for(var _160 in _15c){
var _161=_15c[_160];
if(!_15e||!(_160 in _15d)){
_15d[_160]=_15f.findOrStore(_161);
}
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_162){
copy(Form.Element.Methods,_162.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_163){
this.adjacency=_163;
};
Abstract.Insertion.prototype={initialize:function(_164,_165){
this.element=$(_164);
this.content=_165.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _166=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_166)){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_165.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_168){
_168.each((function(_169){
this.element.parentNode.insertBefore(_169,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_16a){
_16a.reverse(false).each((function(_16b){
this.element.insertBefore(_16b,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_16c){
_16c.each((function(_16d){
this.element.appendChild(_16d);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_16e){
_16e.each((function(_16f){
this.element.parentNode.insertBefore(_16f,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_170){
this.element=$(_170);
},_each:function(_171){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_171);
},set:function(_173){
this.element.className=_173;
},add:function(_174){
if(this.include(_174)){
return;
}
this.set($A(this).concat(_174).join(" "));
},remove:function(_175){
if(!this.include(_175)){
return;
}
this.set($A(this).without(_175).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_176){
this.params={classNames:[]};
this.expression=_176.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_177){
throw "Parse error in selector: "+_177;
}
if(this.expression==""){
abort("empty expression");
}
var _178=this.params,expr=this.expression,match,modifier,clause,rest;
while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_178.attributes=_178.attributes||[];
_178.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""});
expr=match[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
modifier=match[1],clause=match[2],rest=match[3];
switch(modifier){
case "#":
_178.id=clause;
break;
case ".":
_178.classNames.push(clause);
break;
case "":
case undefined:
_178.tagName=clause.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _179=this.params,conditions=[],clause;
if(_179.wildcard){
conditions.push("true");
}
if(clause=_179.id){
conditions.push("element.readAttribute(\"id\") == "+clause.inspect());
}
if(clause=_179.tagName){
conditions.push("element.tagName.toUpperCase() == "+clause.inspect());
}
if((clause=_179.classNames).length>0){
for(var i=0,length=clause.length;i<length;i++){
conditions.push("element.hasClassName("+clause[i].inspect()+")");
}
}
if(clause=_179.attributes){
clause.each(function(_17b){
var _17c="element.readAttribute("+_17b.name.inspect()+")";
var _17d=function(_17e){
return _17c+" && "+_17c+".split("+_17e.inspect()+")";
};
switch(_17b.operator){
case "=":
conditions.push(_17c+" == "+_17b.value.inspect());
break;
case "~=":
conditions.push(_17d(" ")+".include("+_17b.value.inspect()+")");
break;
case "|=":
conditions.push(_17d("-")+".first().toUpperCase() == "+_17b.value.toUpperCase().inspect());
break;
case "!=":
conditions.push(_17c+" != "+_17b.value.inspect());
break;
case "":
case undefined:
conditions.push("element.hasAttribute("+_17b.name.inspect()+")");
break;
default:
throw "Unknown operator "+_17b.operator+" in selector";
}
});
}
return conditions.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       element = $(element);       return "+this.buildMatchExpression());
},findElements:function(_17f){
var _180;
if(_180=$(this.params.id)){
if(this.match(_180)){
if(!_17f||Element.childOf(_180,_17f)){
return [_180];
}
}
}
_17f=(_17f||document).getElementsByTagName(this.params.tagName||"*");
var _181=[];
for(var i=0,length=_17f.length;i<length;i++){
if(this.match(_180=_17f[i])){
_181.push(Element.extend(_180));
}
}
return _181;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_183,_184){
var _185=new Selector(_184);
return _183.select(_185.match.bind(_185)).map(Element.extend);
},findElement:function(_186,_187,_188){
if(typeof _187=="number"){
_188=_187,_187=false;
}
return Selector.matchElements(_186,_187||"*")[_188||0];
},findChildElements:function(_189,_18a){
return _18a.map(function(_18b){
return _18b.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(_18c,expr){
var _18e=new Selector(expr);
return _18c.inject([],function(_18f,_190){
return _18f.concat(_18e.findElements(_190||_189));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_192,_193){
var data=_192.inject({},function(_195,_196){
if(!_196.disabled&&_196.name){
var key=_196.name,value=$(_196).getValue();
if(value!=undefined){
if(_195[key]){
if(_195[key].constructor!=Array){
_195[key]=[_195[key]];
}
_195[key].push(value);
}else{
_195[key]=value;
}
}
}
return _195;
});
return _193?data:Hash.toQueryString(data);
}};
Form.Methods={serialize:function(form,_199){
return Form.serializeElements(Form.getElements(form),_199);
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_19b,_19c){
if(Form.Element.Serializers[_19c.tagName.toLowerCase()]){
_19b.push(Element.extend(_19c));
}
return _19b;
});
},getInputs:function(form,_19e,name){
form=$(form);
var _1a0=form.getElementsByTagName("input");
if(!_19e&&!name){
return $A(_1a0).map(Element.extend);
}
for(var i=0,matchingInputs=[],length=_1a0.length;i<length;i++){
var _1a2=_1a0[i];
if((_19e&&_1a2.type!=_19e)||(name&&_1a2.name!=name)){
continue;
}
matchingInputs.push(Element.extend(_1a2));
}
return matchingInputs;
},disable:function(form){
form=$(form);
form.getElements().each(function(_1a4){
_1a4.blur();
_1a4.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_1a6){
_1a6.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_1a8){
return _1a8.type!="hidden"&&!_1a8.disabled&&["input","select","textarea"].include(_1a8.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_1aa){
$(_1aa).focus();
return _1aa;
},select:function(_1ab){
$(_1ab).select();
return _1ab;
}};
Form.Element.Methods={serialize:function(_1ac){
_1ac=$(_1ac);
if(!_1ac.disabled&&_1ac.name){
var _1ad=_1ac.getValue();
if(_1ad!=undefined){
var pair={};
pair[_1ac.name]=_1ad;
return Hash.toQueryString(pair);
}
}
return "";
},getValue:function(_1af){
_1af=$(_1af);
var _1b0=_1af.tagName.toLowerCase();
return Form.Element.Serializers[_1b0](_1af);
},clear:function(_1b1){
$(_1b1).value="";
return _1b1;
},present:function(_1b2){
return $(_1b2).value!="";
},activate:function(_1b3){
_1b3=$(_1b3);
_1b3.focus();
if(_1b3.select&&(_1b3.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_1b3.type))){
_1b3.select();
}
return _1b3;
},disable:function(_1b4){
_1b4=$(_1b4);
_1b4.disabled=true;
return _1b4;
},enable:function(_1b5){
_1b5=$(_1b5);
_1b5.blur();
_1b5.disabled=false;
return _1b5;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
var $F=Form.Element.getValue;
Form.Element.Serializers={input:function(_1b6){
switch(_1b6.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_1b6);
default:
return Form.Element.Serializers.textarea(_1b6);
}
},inputSelector:function(_1b7){
return _1b7.checked?_1b7.value:null;
},textarea:function(_1b8){
return _1b8.value;
},select:function(_1b9){
return this[_1b9.type=="select-one"?"selectOne":"selectMany"](_1b9);
},selectOne:function(_1ba){
var _1bb=_1ba.selectedIndex;
return _1bb>=0?this.optionValue(_1ba.options[_1bb]):null;
},selectMany:function(_1bc){
var _1bd,length=_1bc.length;
if(!length){
return null;
}
for(var i=0,_1bd=[];i<length;i++){
var opt=_1bc.options[i];
if(opt.selected){
_1bd.push(this.optionValue(opt));
}
}
return _1bd;
},optionValue:function(opt){
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
}};
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_1c1,_1c2,_1c3){
this.frequency=_1c2;
this.element=$(_1c1);
this.callback=_1c3;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _1c4=this.getValue();
var _1c5=("string"==typeof this.lastValue&&"string"==typeof _1c4?this.lastValue!=_1c4:String(this.lastValue)!=String(_1c4));
if(_1c5){
this.callback(this.element,_1c4);
this.lastValue=_1c4;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_1c6,_1c7){
this.element=$(_1c6);
this.callback=_1c7;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _1c8=this.getValue();
if(this.lastValue!=_1c8){
this.callback(this.element,_1c8);
this.lastValue=_1c8;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_1c9){
if(_1c9.type){
switch(_1c9.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_1c9,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_1c9,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(_1ca){
return _1ca.target||_1ca.srcElement;
},isLeftClick:function(_1cb){
return (((_1cb.which)&&(_1cb.which==1))||((_1cb.button)&&(_1cb.button==1)));
},pointerX:function(_1cc){
return _1cc.pageX||(_1cc.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_1cd){
return _1cd.pageY||(_1cd.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_1ce){
if(_1ce.preventDefault){
_1ce.preventDefault();
_1ce.stopPropagation();
}else{
_1ce.returnValue=false;
_1ce.cancelBubble=true;
}
},findElement:function(_1cf,_1d0){
var _1d1=Event.element(_1cf);
while(_1d1.parentNode&&(!_1d1.tagName||(_1d1.tagName.toUpperCase()!=_1d0.toUpperCase()))){
_1d1=_1d1.parentNode;
}
return _1d1;
},observers:false,_observeAndCache:function(_1d2,name,_1d4,_1d5){
if(!this.observers){
this.observers=[];
}
if(_1d2.addEventListener){
this.observers.push([_1d2,name,_1d4,_1d5]);
_1d2.addEventListener(name,_1d4,_1d5);
}else{
if(_1d2.attachEvent){
this.observers.push([_1d2,name,_1d4,_1d5]);
_1d2.attachEvent("on"+name,_1d4);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,length=Event.observers.length;i<length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_1d7,name,_1d9,_1da){
_1d7=$(_1d7);
_1da=_1da||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1d7.attachEvent)){
name="keydown";
}
Event._observeAndCache(_1d7,name,_1d9,_1da);
},stopObserving:function(_1db,name,_1dd,_1de){
_1db=$(_1db);
_1de=_1de||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1db.detachEvent)){
name="keydown";
}
if(_1db.removeEventListener){
_1db.removeEventListener(name,_1dd,_1de);
}else{
if(_1db.detachEvent){
try{
_1db.detachEvent("on"+name,_1dd);
}
catch(e){
}
}
}
}});
if(navigator.appVersion.match(/\bMSIE\b/)){
Event.observe(window,"unload",Event.unloadCache,false);
}
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_1df){
var _1e0=0,valueL=0;
do{
_1e0+=_1df.scrollTop||0;
valueL+=_1df.scrollLeft||0;
_1df=_1df.parentNode;
}while(_1df);
return [valueL,_1e0];
},cumulativeOffset:function(_1e1){
var _1e2=0,valueL=0;
do{
_1e2+=_1e1.offsetTop||0;
valueL+=_1e1.offsetLeft||0;
_1e1=_1e1.offsetParent;
}while(_1e1);
return [valueL,_1e2];
},positionedOffset:function(_1e3){
var _1e4=0,valueL=0;
do{
_1e4+=_1e3.offsetTop||0;
valueL+=_1e3.offsetLeft||0;
_1e3=_1e3.offsetParent;
if(_1e3){
if(_1e3.tagName=="BODY"){
break;
}
var p=Element.getStyle(_1e3,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_1e3);
return [valueL,_1e4];
},offsetParent:function(_1e6){
if(_1e6.offsetParent){
return _1e6.offsetParent;
}
if(_1e6==document.body){
return _1e6;
}
while((_1e6=_1e6.parentNode)&&_1e6!=document.body){
if(Element.getStyle(_1e6,"position")!="static"){
return _1e6;
}
}
return document.body;
},within:function(_1e7,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_1e7,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_1e7);
return (y>=this.offset[1]&&y<this.offset[1]+_1e7.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_1e7.offsetWidth);
},withinIncludingScrolloffsets:function(_1ea,x,y){
var _1ed=this.realOffset(_1ea);
this.xcomp=x+_1ed[0]-this.deltaX;
this.ycomp=y+_1ed[1]-this.deltaY;
this.offset=this.cumulativeOffset(_1ea);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_1ea.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_1ea.offsetWidth);
},overlap:function(mode,_1ef){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_1ef.offsetHeight)-this.ycomp)/_1ef.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_1ef.offsetWidth)-this.xcomp)/_1ef.offsetWidth;
}
},page:function(_1f0){
var _1f1=0,valueL=0;
var _1f2=_1f0;
do{
_1f1+=_1f2.offsetTop||0;
valueL+=_1f2.offsetLeft||0;
if(_1f2.offsetParent==document.body){
if(Element.getStyle(_1f2,"position")=="absolute"){
break;
}
}
}while(_1f2=_1f2.offsetParent);
_1f2=_1f0;
do{
if(!window.opera||_1f2.tagName=="BODY"){
_1f1-=_1f2.scrollTop||0;
valueL-=_1f2.scrollLeft||0;
}
}while(_1f2=_1f2.parentNode);
return [valueL,_1f1];
},clone:function(_1f3,_1f4){
var _1f5=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_1f3=$(_1f3);
var p=Position.page(_1f3);
_1f4=$(_1f4);
var _1f7=[0,0];
var _1f8=null;
if(Element.getStyle(_1f4,"position")=="absolute"){
_1f8=Position.offsetParent(_1f4);
_1f7=Position.page(_1f8);
}
if(_1f8==document.body){
_1f7[0]-=document.body.offsetLeft;
_1f7[1]-=document.body.offsetTop;
}
if(_1f5.setLeft){
_1f4.style.left=(p[0]-_1f7[0]+_1f5.offsetLeft)+"px";
}
if(_1f5.setTop){
_1f4.style.top=(p[1]-_1f7[1]+_1f5.offsetTop)+"px";
}
if(_1f5.setWidth){
_1f4.style.width=_1f3.offsetWidth+"px";
}
if(_1f5.setHeight){
_1f4.style.height=_1f3.offsetHeight+"px";
}
},absolutize:function(_1f9){
_1f9=$(_1f9);
if(_1f9.style.position=="absolute"){
return;
}
Position.prepare();
var _1fa=Position.positionedOffset(_1f9);
var top=_1fa[1];
var left=_1fa[0];
var _1fd=_1f9.clientWidth;
var _1fe=_1f9.clientHeight;
_1f9._originalLeft=left-parseFloat(_1f9.style.left||0);
_1f9._originalTop=top-parseFloat(_1f9.style.top||0);
_1f9._originalWidth=_1f9.style.width;
_1f9._originalHeight=_1f9.style.height;
_1f9.style.position="absolute";
_1f9.style.top=top+"px";
_1f9.style.left=left+"px";
_1f9.style.width=_1fd+"px";
_1f9.style.height=_1fe+"px";
},relativize:function(_1ff){
_1ff=$(_1ff);
if(_1ff.style.position=="relative"){
return;
}
Position.prepare();
_1ff.style.position="relative";
var top=parseFloat(_1ff.style.top||0)-(_1ff._originalTop||0);
var left=parseFloat(_1ff.style.left||0)-(_1ff._originalLeft||0);
_1ff.style.top=top+"px";
_1ff.style.left=left+"px";
_1ff.style.height=_1ff._originalHeight;
_1ff.style.width=_1ff._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_202){
var _203=0,valueL=0;
do{
_203+=_202.offsetTop||0;
valueL+=_202.offsetLeft||0;
if(_202.offsetParent==document.body){
if(Element.getStyle(_202,"position")=="absolute"){
break;
}
}
_202=_202.offsetParent;
}while(_202);
return [valueL,_203];
};
}
Element.addMethods();
var Scriptaculous={Version:"1.7.0",require:function(_1){
document.write("<script type=\"text/javascript\" src=\""+_1+"\"></script>");
},load:function(){
if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])<1.5){
throw ("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0");
}
$A(document.getElementsByTagName("script")).findAll(function(s){
return (s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/));
}).each(function(s){
var _4=s.src.replace(/scriptaculous\.js(\?.*)?$/,"");
var _5=s.src.match(/\?.*load=([a-z,]*)/);
(_5?_5[1]:"builder,effects,dragdrop,controls,slider").split(",").each(function(_6){
Scriptaculous.require(_4+_6+".js");
});
});
}};
Scriptaculous.load();
String.prototype.parseColor=function(){
var _1="#";
if(this.slice(0,4)=="rgb("){
var _2=this.slice(4,this.length-1).split(",");
var i=0;
do{
_1+=parseInt(_2[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_1+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_1=this.toLowerCase();
}
}
}
return (_1.length==7?_1:(arguments[0]||this));
};
Element.collectTextNodes=function(_5){
return $A($(_5).childNodes).collect(function(_6){
return (_6.nodeType==3?_6.nodeValue:(_6.hasChildNodes()?Element.collectTextNodes(_6):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_7,_8){
return $A($(_7).childNodes).collect(function(_9){
return (_9.nodeType==3?_9.nodeValue:((_9.hasChildNodes()&&!Element.hasClassName(_9,_8))?Element.collectTextNodesIgnoreClass(_9,_8):""));
}).flatten().join("");
};
Element.setContentZoom=function(_a,_b){
_a=$(_a);
_a.setStyle({fontSize:(_b/100)+"em"});
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
return _a;
};
Element.getOpacity=function(_c){
return $(_c).getStyle("opacity");
};
Element.setOpacity=function(_d,_e){
return $(_d).setStyle({opacity:_e});
};
Element.getInlineOpacity=function(_f){
return $(_f).style.opacity||"";
};
Element.forceRerendering=function(_10){
try{
_10=$(_10);
var n=document.createTextNode(" ");
_10.appendChild(n);
_10.removeChild(n);
}
catch(e){
}
};
Array.prototype.call=function(){
var _12=arguments;
this.each(function(f){
f.apply(this,_12);
});
};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(_14){
if(typeof Builder=="undefined"){
throw ("Effect.tagifyText requires including script.aculo.us' builder.js library");
}
var _15="position:relative";
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_15+=";zoom:1";
}
_14=$(_14);
$A(_14.childNodes).each(function(_16){
if(_16.nodeType==3){
_16.nodeValue.toArray().each(function(_17){
_14.insertBefore(Builder.node("span",{style:_15},_17==" "?String.fromCharCode(160):_17),_16);
});
Element.remove(_16);
}
});
},multiple:function(_18,_19){
var _1a;
if(((typeof _18=="object")||(typeof _18=="function"))&&(_18.length)){
_1a=_18;
}else{
_1a=$(_18).childNodes;
}
var _1b=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _1c=_1b.delay;
$A(_1a).each(function(_1d,_1e){
new _19(_1d,Object.extend(_1b,{delay:_1e*_1b.speed+_1c}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_1f,_20){
_1f=$(_1f);
_20=(_20||"appear").toLowerCase();
var _21=Object.extend({queue:{position:"end",scope:(_1f.id||"global"),limit:1}},arguments[2]||{});
Effect[_1f.visible()?Effect.PAIRS[_20][1]:Effect.PAIRS[_20][0]](_1f,_21);
}};
var Effect2=Effect;
Effect.Transitions={linear:Prototype.K,sinoidal:function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
},reverse:function(pos){
return 1-pos;
},flicker:function(pos){
return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
},wobble:function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
},pulse:function(pos,_27){
_27=_27||5;
return (Math.round((pos%(1/_27))*_27)==0?((pos*_27*2)-Math.floor(pos*_27*2)):1-((pos*_27*2)-Math.floor(pos*_27*2)));
},none:function(pos){
return 0;
},full:function(pos){
return 1;
}};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_2a){
this.effects._each(_2a);
},add:function(_2b){
var _2c=new Date().getTime();
var _2d=(typeof _2b.options.queue=="string")?_2b.options.queue:_2b.options.queue.position;
switch(_2d){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_2b.finishOn;
e.finishOn+=_2b.finishOn;
});
break;
case "with-last":
_2c=this.effects.pluck("startOn").max()||_2c;
break;
case "end":
_2c=this.effects.pluck("finishOn").max()||_2c;
break;
}
_2b.startOn+=_2c;
_2b.finishOn+=_2c;
if(!_2b.options.queue.limit||(this.effects.length<_2b.options.queue.limit)){
this.effects.push(_2b);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),15);
}
},remove:function(_30){
this.effects=this.effects.reject(function(e){
return e==_30;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _32=new Date().getTime();
for(var i=0,len=this.effects.length;i<len;i++){
if(this.effects[i]){
this.effects[i].loop(_32);
}
}
}});
Effect.Queues={instances:$H(),get:function(_34){
if(typeof _34!="string"){
return _34;
}
if(!this.instances[_34]){
this.instances[_34]=new Effect.ScopedQueue();
}
return this.instances[_34];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:60,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_35){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_35||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_36){
if(_36>=this.startOn){
if(_36>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_36-this.startOn)/(this.finishOn-this.startOn);
var _38=Math.round(pos*this.options.fps*this.options.duration);
if(_38>this.currentFrame){
this.render(pos);
this.currentFrame=_38;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
if(this.setup){
this.setup();
}
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.position=pos;
this.event("beforeUpdate");
if(this.update){
this.update(pos);
}
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_3a){
if(this.options[_3a+"Internal"]){
this.options[_3a+"Internal"](this);
}
if(this.options[_3a]){
this.options[_3a](this);
}
},inspect:function(){
var _3b=$H();
for(property in this){
if(typeof this[property]!="function"){
_3b[property]=this[property];
}
}
return "#<Effect:"+_3b.inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_3c){
this.effects=_3c||[];
this.start(arguments[1]);
},update:function(_3d){
this.effects.invoke("render",_3d);
},finish:function(_3e){
this.effects.each(function(_3f){
_3f.render(1);
_3f.cancel();
_3f.event("beforeFinish");
if(_3f.finish){
_3f.finish(_3e);
}
_3f.event("afterFinish");
});
}});
Effect.Event=Class.create();
Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){
var _40=Object.extend({duration:0},arguments[0]||{});
this.start(_40);
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_41){
this.element=$(_41);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _42=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_42);
},update:function(_43){
this.element.setOpacity(_43);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_44){
this.element=$(_44);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _45=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_45);
},setup:function(){
this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){
this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop;
}
},update:function(_46){
this.element.setStyle({left:Math.round(this.options.x*_46+this.originalLeft)+"px",top:Math.round(this.options.y*_46+this.originalTop)+"px"});
}});
Effect.MoveBy=function(_47,_48,_49){
return new Effect.Move(_47,Object.extend({x:_49,y:_48},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_4a,_4b){
this.element=$(_4a);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _4c=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_4b},arguments[2]||{});
this.start(_4c);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(k){
this.originalStyle[k]=this.element.style[k];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _4e=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_4f){
if(_4e.indexOf(_4f)>0){
this.fontSize=parseFloat(_4e);
this.fontSizeType=_4f;
}
}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){
this.dims=[this.element.offsetHeight,this.element.offsetWidth];
}
if(/^content/.test(this.options.scaleMode)){
this.dims=[this.element.scrollHeight,this.element.scrollWidth];
}
if(!this.dims){
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
}
},update:function(_50){
var _51=(this.options.scaleFrom/100)+(this.factor*_50);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_51+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_51,this.dims[1]*_51);
},finish:function(_52){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_53,_54){
var d={};
if(this.options.scaleX){
d.width=Math.round(_54)+"px";
}
if(this.options.scaleY){
d.height=Math.round(_53)+"px";
}
if(this.options.scaleFromCenter){
var _56=(_53-this.dims[0])/2;
var _57=(_54-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-_56+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_57+"px";
}
}else{
if(this.options.scaleY){
d.top=-_56+"px";
}
if(this.options.scaleX){
d.left=-_57+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_58){
this.element=$(_58);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _59=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_59);
},setup:function(){
if(this.element.getStyle("display")=="none"){
this.cancel();
return;
}
this.oldStyle={};
if(!this.options.keepBackgroundImage){
this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"});
}
if(!this.options.endcolor){
this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff");
}
if(!this.options.restorecolor){
this.options.restorecolor=this.element.getStyle("background-color");
}
this._base=$R(0,2).map(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
}.bind(this));
},update:function(_5c){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_5c)).toColorPart());
}.bind(this))});
},finish:function(){
this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(_60){
this.element=$(_60);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _61=Position.cumulativeOffset(this.element);
if(this.options.offset){
_61[1]+=this.options.offset;
}
var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
this.scrollStart=Position.deltaY;
this.delta=(_61[1]>max?max:_61[1])-this.scrollStart;
},update:function(_63){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_63*this.delta));
}});
Effect.Fade=function(_64){
_64=$(_64);
var _65=_64.getInlineOpacity();
var _66=Object.extend({from:_64.getOpacity()||1,to:0,afterFinishInternal:function(_67){
if(_67.options.to!=0){
return;
}
_67.element.hide().setStyle({opacity:_65});
}},arguments[1]||{});
return new Effect.Opacity(_64,_66);
};
Effect.Appear=function(_68){
_68=$(_68);
var _69=Object.extend({from:(_68.getStyle("display")=="none"?0:_68.getOpacity()||0),to:1,afterFinishInternal:function(_6a){
_6a.element.forceRerendering();
},beforeSetup:function(_6b){
_6b.element.setOpacity(_6b.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(_68,_69);
};
Effect.Puff=function(_6c){
_6c=$(_6c);
var _6d={opacity:_6c.getInlineOpacity(),position:_6c.getStyle("position"),top:_6c.style.top,left:_6c.style.left,width:_6c.style.width,height:_6c.style.height};
return new Effect.Parallel([new Effect.Scale(_6c,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_6c,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_6e){
Position.absolutize(_6e.effects[0].element);
},afterFinishInternal:function(_6f){
_6f.effects[0].element.hide().setStyle(_6d);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_70){
_70=$(_70);
_70.makeClipping();
return new Effect.Scale(_70,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_71){
_71.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_72){
_72=$(_72);
var _73=_72.getDimensions();
return new Effect.Scale(_72,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_73.height,originalWidth:_73.width},restoreAfterFinish:true,afterSetup:function(_74){
_74.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(_75){
_75.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_76){
_76=$(_76);
var _77=_76.getInlineOpacity();
return new Effect.Appear(_76,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_78){
new Effect.Scale(_78.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_79){
_79.element.makePositioned().makeClipping();
},afterFinishInternal:function(_7a){
_7a.element.hide().undoClipping().undoPositioned().setStyle({opacity:_77});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_7b){
_7b=$(_7b);
var _7c={top:_7b.getStyle("top"),left:_7b.getStyle("left"),opacity:_7b.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_7b,{x:0,y:100,sync:true}),new Effect.Opacity(_7b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_7d){
_7d.effects[0].element.makePositioned();
},afterFinishInternal:function(_7e){
_7e.effects[0].element.hide().undoPositioned().setStyle(_7c);
}},arguments[1]||{}));
};
Effect.Shake=function(_7f){
_7f=$(_7f);
var _80={top:_7f.getStyle("top"),left:_7f.getStyle("left")};
return new Effect.Move(_7f,{x:20,y:0,duration:0.05,afterFinishInternal:function(_81){
new Effect.Move(_81.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_82){
new Effect.Move(_82.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_83){
new Effect.Move(_83.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_84){
new Effect.Move(_84.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_85){
new Effect.Move(_85.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_86){
_86.element.undoPositioned().setStyle(_80);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_87){
_87=$(_87).cleanWhitespace();
var _88=_87.down().getStyle("bottom");
var _89=_87.getDimensions();
return new Effect.Scale(_87,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_89.height,originalWidth:_89.width},restoreAfterFinish:true,afterSetup:function(_8a){
_8a.element.makePositioned();
_8a.element.down().makePositioned();
if(window.opera){
_8a.element.setStyle({top:""});
}
_8a.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(_8b){
_8b.element.down().setStyle({bottom:(_8b.dims[0]-_8b.element.clientHeight)+"px"});
},afterFinishInternal:function(_8c){
_8c.element.undoClipping().undoPositioned();
_8c.element.down().undoPositioned().setStyle({bottom:_88});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_8d){
_8d=$(_8d).cleanWhitespace();
var _8e=_8d.down().getStyle("bottom");
return new Effect.Scale(_8d,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_8f){
_8f.element.makePositioned();
_8f.element.down().makePositioned();
if(window.opera){
_8f.element.setStyle({top:""});
}
_8f.element.makeClipping().show();
},afterUpdateInternal:function(_90){
_90.element.down().setStyle({bottom:(_90.dims[0]-_90.element.clientHeight)+"px"});
},afterFinishInternal:function(_91){
_91.element.hide().undoClipping().undoPositioned().setStyle({bottom:_8e});
_91.element.down().undoPositioned();
}},arguments[1]||{}));
};
Effect.Squish=function(_92){
return new Effect.Scale(_92,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_93){
_93.element.makeClipping();
},afterFinishInternal:function(_94){
_94.element.hide().undoClipping();
}});
};
Effect.Grow=function(_95){
_95=$(_95);
var _96=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _97={top:_95.style.top,left:_95.style.left,height:_95.style.height,width:_95.style.width,opacity:_95.getInlineOpacity()};
var _98=_95.getDimensions();
var _99,initialMoveY;
var _9a,moveY;
switch(_96.direction){
case "top-left":
_99=initialMoveY=_9a=moveY=0;
break;
case "top-right":
_99=_98.width;
initialMoveY=moveY=0;
_9a=-_98.width;
break;
case "bottom-left":
_99=_9a=0;
initialMoveY=_98.height;
moveY=-_98.height;
break;
case "bottom-right":
_99=_98.width;
initialMoveY=_98.height;
_9a=-_98.width;
moveY=-_98.height;
break;
case "center":
_99=_98.width/2;
initialMoveY=_98.height/2;
_9a=-_98.width/2;
moveY=-_98.height/2;
break;
}
return new Effect.Move(_95,{x:_99,y:initialMoveY,duration:0.01,beforeSetup:function(_9b){
_9b.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(_9c){
new Effect.Parallel([new Effect.Opacity(_9c.element,{sync:true,to:1,from:0,transition:_96.opacityTransition}),new Effect.Move(_9c.element,{x:_9a,y:moveY,sync:true,transition:_96.moveTransition}),new Effect.Scale(_9c.element,100,{scaleMode:{originalHeight:_98.height,originalWidth:_98.width},sync:true,scaleFrom:window.opera?1:0,transition:_96.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_9d){
_9d.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(_9e){
_9e.effects[0].element.undoClipping().undoPositioned().setStyle(_97);
}},_96));
}});
};
Effect.Shrink=function(_9f){
_9f=$(_9f);
var _a0=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _a1={top:_9f.style.top,left:_9f.style.left,height:_9f.style.height,width:_9f.style.width,opacity:_9f.getInlineOpacity()};
var _a2=_9f.getDimensions();
var _a3,moveY;
switch(_a0.direction){
case "top-left":
_a3=moveY=0;
break;
case "top-right":
_a3=_a2.width;
moveY=0;
break;
case "bottom-left":
_a3=0;
moveY=_a2.height;
break;
case "bottom-right":
_a3=_a2.width;
moveY=_a2.height;
break;
case "center":
_a3=_a2.width/2;
moveY=_a2.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_9f,{sync:true,to:0,from:1,transition:_a0.opacityTransition}),new Effect.Scale(_9f,window.opera?1:0,{sync:true,transition:_a0.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_9f,{x:_a3,y:moveY,sync:true,transition:_a0.moveTransition})],Object.extend({beforeStartInternal:function(_a4){
_a4.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(_a5){
_a5.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_a1);
}},_a0));
};
Effect.Pulsate=function(_a6){
_a6=$(_a6);
var _a7=arguments[1]||{};
var _a8=_a6.getInlineOpacity();
var _a9=_a7.transition||Effect.Transitions.sinoidal;
var _aa=function(pos){
return _a9(1-Effect.Transitions.pulse(pos,_a7.pulses));
};
_aa.bind(_a9);
return new Effect.Opacity(_a6,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_ac){
_ac.element.setStyle({opacity:_a8});
}},_a7),{transition:_aa}));
};
Effect.Fold=function(_ad){
_ad=$(_ad);
var _ae={top:_ad.style.top,left:_ad.style.left,width:_ad.style.width,height:_ad.style.height};
_ad.makeClipping();
return new Effect.Scale(_ad,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_af){
new Effect.Scale(_ad,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_b0){
_b0.element.hide().undoClipping().setStyle(_ae);
}});
}},arguments[1]||{}));
};
Effect.Morph=Class.create();
Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(_b1){
this.element=$(_b1);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _b2=Object.extend({style:{}},arguments[1]||{});
if(typeof _b2.style=="string"){
if(_b2.style.indexOf(":")==-1){
var _b3="",selector="."+_b2.style;
$A(document.styleSheets).reverse().each(function(_b4){
if(_b4.cssRules){
cssRules=_b4.cssRules;
}else{
if(_b4.rules){
cssRules=_b4.rules;
}
}
$A(cssRules).reverse().each(function(_b5){
if(selector==_b5.selectorText){
_b3=_b5.style.cssText;
throw $break;
}
});
if(_b3){
throw $break;
}
});
this.style=_b3.parseStyle();
_b2.afterFinishInternal=function(_b6){
_b6.element.addClassName(_b6.options.style);
_b6.transforms.each(function(_b7){
if(_b7.style!="opacity"){
_b6.element.style[_b7.style.camelize()]="";
}
});
};
}else{
this.style=_b2.style.parseStyle();
}
}else{
this.style=$H(_b2.style);
}
this.start(_b2);
},setup:function(){
function parseColor(_b8){
if(!_b8||["rgba(0, 0, 0, 0)","transparent"].include(_b8)){
_b8="#ffffff";
}
_b8=_b8.parseColor();
return $R(0,2).map(function(i){
return parseInt(_b8.slice(i*2+1,i*2+3),16);
});
}
this.transforms=this.style.map(function(_ba){
var _bb=_ba[0].underscore().dasherize(),value=_ba[1],unit=null;
if(value.parseColor("#zzzzzz")!="#zzzzzz"){
value=value.parseColor();
unit="color";
}else{
if(_bb=="opacity"){
value=parseFloat(value);
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
}else{
if(Element.CSS_LENGTH.test(value)){
var _bc=value.match(/^([\+\-]?[0-9\.]+)(.*)$/),value=parseFloat(_bc[1]),unit=(_bc.length==3)?_bc[2]:null;
}
}
}
var _bd=this.element.getStyle(_bb);
return $H({style:_bb,originalValue:unit=="color"?parseColor(_bd):parseFloat(_bd||0),targetValue:unit=="color"?parseColor(value):value,unit:unit});
}.bind(this)).reject(function(_be){
return ((_be.originalValue==_be.targetValue)||(_be.unit!="color"&&(isNaN(_be.originalValue)||isNaN(_be.targetValue))));
});
},update:function(_bf){
var _c0=$H(),value=null;
this.transforms.each(function(_c1){
value=_c1.unit=="color"?$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(_c1.originalValue[i]+(_c1.targetValue[i]-_c1.originalValue[i])*_bf)).toColorPart();
}):_c1.originalValue+Math.round(((_c1.targetValue-_c1.originalValue)*_bf)*1000)/1000+_c1.unit;
_c0[_c1.style]=value;
});
this.element.setStyle(_c0);
}});
Effect.Transform=Class.create();
Object.extend(Effect.Transform.prototype,{initialize:function(_c5){
this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(_c5);
},addTracks:function(_c6){
_c6.each(function(_c7){
var _c8=$H(_c7).values().first();
this.tracks.push($H({ids:$H(_c7).keys().first(),effect:Effect.Morph,options:{style:_c8}}));
}.bind(this));
return this;
},play:function(){
return new Effect.Parallel(this.tracks.map(function(_c9){
var _ca=[$(_c9.ids)||$$(_c9.ids)].flatten();
return _ca.map(function(e){
return new _c9.effect(e,Object.extend({sync:true},_c9.options));
});
}).flatten(),this.options);
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle "+"borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth "+"borderRightColor borderRightStyle borderRightWidth borderSpacing "+"borderTopColor borderTopStyle borderTopWidth bottom clip color "+"fontSize fontWeight height left letterSpacing lineHeight "+"marginBottom marginLeft marginRight marginTop markerOffset maxHeight "+"maxWidth minHeight minWidth opacity outlineColor outlineOffset "+"outlineWidth paddingBottom paddingLeft paddingRight paddingTop "+"right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.prototype.parseStyle=function(){
var _cc=Element.extend(document.createElement("div"));
_cc.innerHTML="<div style=\""+this+"\"></div>";
var _cd=_cc.down().style,styleRules=$H();
Element.CSS_PROPERTIES.each(function(_ce){
if(_cd[_ce]){
styleRules[_ce]=_cd[_ce];
}
});
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&this.indexOf("opacity")>-1){
styleRules.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
}
return styleRules;
};
Element.morph=function(_cf,_d0){
new Effect.Morph(_cf,Object.extend({style:_d0},arguments[2]||{}));
return _cf;
};
["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(f){
Element.Methods[f]=Element[f];
});
Element.Methods.visualEffect=function(_d2,_d3,_d4){
s=_d3.gsub(/_/,"-").camelize();
effect_class=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[effect_class](_d2,_d4);
return $(_d2);
};
Element.addMethods();
Event.simulateMouse=function(_1,_2){
var _3=Object.extend({pointerX:0,pointerY:0,buttons:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},arguments[2]||{});
var _4=document.createEvent("MouseEvents");
_4.initMouseEvent(_2,true,true,document.defaultView,_3.buttons,_3.pointerX,_3.pointerY,_3.pointerX,_3.pointerY,_3.ctrlKey,_3.altKey,_3.shiftKey,_3.metaKey,0,$(_1));
if(this.mark){
Element.remove(this.mark);
}
this.mark=document.createElement("div");
this.mark.appendChild(document.createTextNode(" "));
document.body.appendChild(this.mark);
this.mark.style.position="absolute";
this.mark.style.top=_3.pointerY+"px";
this.mark.style.left=_3.pointerX+"px";
this.mark.style.width="5px";
this.mark.style.height="5px;";
this.mark.style.borderTop="1px solid red;";
this.mark.style.borderLeft="1px solid red;";
if(this.step){
alert("["+new Date().getTime().toString()+"] "+_2+"/"+Test.Unit.inspect(_3));
}
$(_1).dispatchEvent(_4);
};
Event.simulateKey=function(_5,_6){
var _7=Object.extend({ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,keyCode:0,charCode:0},arguments[2]||{});
var _8=document.createEvent("KeyEvents");
_8.initKeyEvent(_6,true,true,window,_7.ctrlKey,_7.altKey,_7.shiftKey,_7.metaKey,_7.keyCode,_7.charCode);
$(_5).dispatchEvent(_8);
};
Event.simulateKeys=function(_9,_a){
for(var i=0;i<_a.length;i++){
Event.simulateKey(_9,"keypress",{charCode:_a.charCodeAt(i)});
}
};
var Test={};
Test.Unit={};
Test.Unit.inspect=Object.inspect;
Test.Unit.Logger=Class.create();
Test.Unit.Logger.prototype={initialize:function(_c){
this.log=$(_c);
if(this.log){
this._createLogTable();
}
},start:function(_d){
if(!this.log){
return;
}
this.testName=_d;
this.lastLogLine=document.createElement("tr");
this.statusCell=document.createElement("td");
this.nameCell=document.createElement("td");
this.nameCell.className="nameCell";
this.nameCell.appendChild(document.createTextNode(_d));
this.messageCell=document.createElement("td");
this.lastLogLine.appendChild(this.statusCell);
this.lastLogLine.appendChild(this.nameCell);
this.lastLogLine.appendChild(this.messageCell);
this.loglines.appendChild(this.lastLogLine);
},finish:function(_e,_f){
if(!this.log){
return;
}
this.lastLogLine.className=_e;
this.statusCell.innerHTML=_e;
this.messageCell.innerHTML=this._toHTML(_f);
this.addLinksToResults();
},message:function(_10){
if(!this.log){
return;
}
this.messageCell.innerHTML=this._toHTML(_10);
},summary:function(_11){
if(!this.log){
return;
}
this.logsummary.innerHTML=this._toHTML(_11);
},_createLogTable:function(){
this.log.innerHTML="<div id=\"logsummary\"></div>"+"<table id=\"logtable\">"+"<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>"+"<tbody id=\"loglines\"></tbody>"+"</table>";
this.logsummary=$("logsummary");
this.loglines=$("loglines");
},_toHTML:function(txt){
return txt.escapeHTML().replace(/\n/g,"<br/>");
},addLinksToResults:function(){
$$("tr.failed .nameCell").each(function(td){
td.title="Run only this test";
Event.observe(td,"click",function(){
window.location.search="?tests="+td.innerHTML;
});
});
$$("tr.passed .nameCell").each(function(td){
td.title="Run all tests";
Event.observe(td,"click",function(){
window.location.search="";
});
});
}};
Test.Unit.Runner=Class.create();
Test.Unit.Runner.prototype={initialize:function(_15){
this.options=Object.extend({testLog:"testlog"},arguments[1]||{});
this.options.resultsURL=this.parseResultsURLQueryParameter();
this.options.tests=this.parseTestsQueryParameter();
if(this.options.testLog){
this.options.testLog=$(this.options.testLog)||null;
}
if(this.options.tests){
this.tests=[];
for(var i=0;i<this.options.tests.length;i++){
if(/^test/.test(this.options.tests[i])){
this.tests.push(new Test.Unit.Testcase(this.options.tests[i],_15[this.options.tests[i]],_15["setup"],_15["teardown"]));
}
}
}else{
if(this.options.test){
this.tests=[new Test.Unit.Testcase(this.options.test,_15[this.options.test],_15["setup"],_15["teardown"])];
}else{
this.tests=[];
for(var _17 in _15){
if(/^test/.test(_17)){
this.tests.push(new Test.Unit.Testcase(this.options.context?" -> "+this.options.titles[_17]:_17,_15[_17],_15["setup"],_15["teardown"]));
}
}
}
}
this.currentTest=0;
this.logger=new Test.Unit.Logger(this.options.testLog);
setTimeout(this.runTests.bind(this),1000);
},parseResultsURLQueryParameter:function(){
return window.location.search.parseQuery()["resultsURL"];
},parseTestsQueryParameter:function(){
if(window.location.search.parseQuery()["tests"]){
return window.location.search.parseQuery()["tests"].split(",");
}
},getResult:function(){
var _18=false;
for(var i=0;i<this.tests.length;i++){
if(this.tests[i].errors>0){
return "ERROR";
}
if(this.tests[i].failures>0){
_18=true;
}
}
if(_18){
return "FAILURE";
}else{
return "SUCCESS";
}
},postResults:function(){
if(this.options.resultsURL){
new Ajax.Request(this.options.resultsURL,{method:"get",parameters:"result="+this.getResult(),asynchronous:false});
}
},runTests:function(){
var _1a=this.tests[this.currentTest];
if(!_1a){
this.postResults();
this.logger.summary(this.summary());
return;
}
if(!_1a.isWaiting){
this.logger.start(_1a.name);
}
_1a.run();
if(_1a.isWaiting){
this.logger.message("Waiting for "+_1a.timeToWait+"ms");
setTimeout(this.runTests.bind(this),_1a.timeToWait||1000);
}else{
this.logger.finish(_1a.status(),_1a.summary());
this.currentTest++;
this.runTests();
}
},summary:function(){
var _1b=0;
var _1c=0;
var _1d=0;
var _1e=[];
for(var i=0;i<this.tests.length;i++){
_1b+=this.tests[i].assertions;
_1c+=this.tests[i].failures;
_1d+=this.tests[i].errors;
}
return ((this.options.context?this.options.context+": ":"")+this.tests.length+" tests, "+_1b+" assertions, "+_1c+" failures, "+_1d+" errors");
}};
Test.Unit.Assertions=Class.create();
Test.Unit.Assertions.prototype={initialize:function(){
this.assertions=0;
this.failures=0;
this.errors=0;
this.messages=[];
},summary:function(){
return (this.assertions+" assertions, "+this.failures+" failures, "+this.errors+" errors"+"\n"+this.messages.join("\n"));
},pass:function(){
this.assertions++;
},fail:function(_20){
this.failures++;
this.messages.push("Failure: "+_20);
},info:function(_21){
this.messages.push("Info: "+_21);
},error:function(_22){
this.errors++;
this.messages.push(_22.name+": "+_22.message+"("+Test.Unit.inspect(_22)+")");
},status:function(){
if(this.failures>0){
return "failed";
}
if(this.errors>0){
return "error";
}
return "passed";
},assert:function(_23){
var _24=arguments[1]||"assert: got \""+Test.Unit.inspect(_23)+"\"";
try{
_23?this.pass():this.fail(_24);
}
catch(e){
this.error(e);
}
},assertEqual:function(_25,_26){
var _27=arguments[2]||"assertEqual";
try{
(_25==_26)?this.pass():this.fail(_27+": expected \""+Test.Unit.inspect(_25)+"\", actual \""+Test.Unit.inspect(_26)+"\"");
}
catch(e){
this.error(e);
}
},assertInspect:function(_28,_29){
var _2a=arguments[2]||"assertInspect";
try{
(_28==_29.inspect())?this.pass():this.fail(_2a+": expected \""+Test.Unit.inspect(_28)+"\", actual \""+Test.Unit.inspect(_29)+"\"");
}
catch(e){
this.error(e);
}
},assertEnumEqual:function(_2b,_2c){
var _2d=arguments[2]||"assertEnumEqual";
try{
$A(_2b).length==$A(_2c).length&&_2b.zip(_2c).all(function(_2e){
return _2e[0]==_2e[1];
})?this.pass():this.fail(_2d+": expected "+Test.Unit.inspect(_2b)+", actual "+Test.Unit.inspect(_2c));
}
catch(e){
this.error(e);
}
},assertNotEqual:function(_2f,_30){
var _31=arguments[2]||"assertNotEqual";
try{
(_2f!=_30)?this.pass():this.fail(_31+": got \""+Test.Unit.inspect(_30)+"\"");
}
catch(e){
this.error(e);
}
},assertIdentical:function(_32,_33){
var _34=arguments[2]||"assertIdentical";
try{
(_32===_33)?this.pass():this.fail(_34+": expected \""+Test.Unit.inspect(_32)+"\", actual \""+Test.Unit.inspect(_33)+"\"");
}
catch(e){
this.error(e);
}
},assertNotIdentical:function(_35,_36){
var _37=arguments[2]||"assertNotIdentical";
try{
!(_35===_36)?this.pass():this.fail(_37+": expected \""+Test.Unit.inspect(_35)+"\", actual \""+Test.Unit.inspect(_36)+"\"");
}
catch(e){
this.error(e);
}
},assertNull:function(obj){
var _39=arguments[1]||"assertNull";
try{
(obj==null)?this.pass():this.fail(_39+": got \""+Test.Unit.inspect(obj)+"\"");
}
catch(e){
this.error(e);
}
},assertMatch:function(_3a,_3b){
var _3c=arguments[2]||"assertMatch";
var _3d=new RegExp(_3a);
try{
(_3d.exec(_3b))?this.pass():this.fail(_3c+" : regex: \""+Test.Unit.inspect(_3a)+" did not match: "+Test.Unit.inspect(_3b)+"\"");
}
catch(e){
this.error(e);
}
},assertHidden:function(_3e){
var _3f=arguments[1]||"assertHidden";
this.assertEqual("none",_3e.style.display,_3f);
},assertNotNull:function(_40){
var _41=arguments[1]||"assertNotNull";
this.assert(_40!=null,_41);
},assertType:function(_42,_43){
var _44=arguments[2]||"assertType";
try{
(_43.constructor==_42)?this.pass():this.fail(_44+": expected \""+Test.Unit.inspect(_42)+"\", actual \""+(_43.constructor)+"\"");
}
catch(e){
this.error(e);
}
},assertNotOfType:function(_45,_46){
var _47=arguments[2]||"assertNotOfType";
try{
(_46.constructor!=_45)?this.pass():this.fail(_47+": expected \""+Test.Unit.inspect(_45)+"\", actual \""+(_46.constructor)+"\"");
}
catch(e){
this.error(e);
}
},assertInstanceOf:function(_48,_49){
var _4a=arguments[2]||"assertInstanceOf";
try{
(_49 instanceof _48)?this.pass():this.fail(_4a+": object was not an instance of the expected type");
}
catch(e){
this.error(e);
}
},assertNotInstanceOf:function(_4b,_4c){
var _4d=arguments[2]||"assertNotInstanceOf";
try{
!(_4c instanceof _4b)?this.pass():this.fail(_4d+": object was an instance of the not expected type");
}
catch(e){
this.error(e);
}
},assertRespondsTo:function(_4e,obj){
var _50=arguments[2]||"assertRespondsTo";
try{
(obj[_4e]&&typeof obj[_4e]=="function")?this.pass():this.fail(_50+": object doesn't respond to ["+_4e+"]");
}
catch(e){
this.error(e);
}
},assertReturnsTrue:function(_51,obj){
var _53=arguments[2]||"assertReturnsTrue";
try{
var m=obj[_51];
if(!m){
m=obj["is"+_51.charAt(0).toUpperCase()+_51.slice(1)];
}
m()?this.pass():this.fail(_53+": method returned false");
}
catch(e){
this.error(e);
}
},assertReturnsFalse:function(_55,obj){
var _57=arguments[2]||"assertReturnsFalse";
try{
var m=obj[_55];
if(!m){
m=obj["is"+_55.charAt(0).toUpperCase()+_55.slice(1)];
}
!m()?this.pass():this.fail(_57+": method returned true");
}
catch(e){
this.error(e);
}
},assertRaise:function(_59,_5a){
var _5b=arguments[2]||"assertRaise";
try{
_5a();
this.fail(_5b+": exception expected but none was raised");
}
catch(e){
((_59==null)||(e.name==_59))?this.pass():this.error(e);
}
},assertElementsMatch:function(){
var _5c=$A(arguments),elements=$A(_5c.shift());
if(elements.length!=_5c.length){
this.fail("assertElementsMatch: size mismatch: "+elements.length+" elements, "+_5c.length+" expressions");
return false;
}
elements.zip(_5c).all(function(_5d,_5e){
var _5f=$(_5d.first()),expression=_5d.last();
if(_5f.match(expression)){
return true;
}
this.fail("assertElementsMatch: (in index "+_5e+") expected "+expression.inspect()+" but got "+_5f.inspect());
}.bind(this))&&this.pass();
},assertElementMatches:function(_60,_61){
this.assertElementsMatch([_60],_61);
},benchmark:function(_62,_63){
var _64=new Date();
(_63||1).times(_62);
var _65=((new Date())-_64);
this.info((arguments[2]||"Operation")+" finished "+_63+" iterations in "+(_65/1000)+"s");
return _65;
},_isVisible:function(_66){
_66=$(_66);
if(!_66.parentNode){
return true;
}
this.assertNotNull(_66);
if(_66.style&&Element.getStyle(_66,"display")=="none"){
return false;
}
return this._isVisible(_66.parentNode);
},assertNotVisible:function(_67){
this.assert(!this._isVisible(_67),Test.Unit.inspect(_67)+" was not hidden and didn't have a hidden parent either. "+(""||arguments[1]));
},assertVisible:function(_68){
this.assert(this._isVisible(_68),Test.Unit.inspect(_68)+" was not visible. "+(""||arguments[1]));
},benchmark:function(_69,_6a){
var _6b=new Date();
(_6a||1).times(_69);
var _6c=((new Date())-_6b);
this.info((arguments[2]||"Operation")+" finished "+_6a+" iterations in "+(_6c/1000)+"s");
return _6c;
}};
Test.Unit.Testcase=Class.create();
Object.extend(Object.extend(Test.Unit.Testcase.prototype,Test.Unit.Assertions.prototype),{initialize:function(_6d,_6e,_6f,_70){
Test.Unit.Assertions.prototype.initialize.bind(this)();
this.name=_6d;
if(typeof _6e=="string"){
_6e=_6e.gsub(/(\.should[^\(]+\()/,"#{0}this,");
_6e=_6e.gsub(/(\.should[^\(]+)\(this,\)/,"#{1}(this)");
this.test=function(){
eval("with(this){"+_6e+"}");
};
}else{
this.test=_6e||function(){
};
}
this.setup=_6f||function(){
};
this.teardown=_70||function(){
};
this.isWaiting=false;
this.timeToWait=1000;
},wait:function(_71,_72){
this.isWaiting=true;
this.test=_72;
this.timeToWait=_71;
},run:function(){
try{
try{
if(!this.isWaiting){
this.setup.bind(this)();
}
this.isWaiting=false;
this.test.bind(this)();
}
finally{
if(!this.isWaiting){
this.teardown.bind(this)();
}
}
}
catch(e){
this.error(e);
}
}});
Test.setupBDDExtensionMethods=function(){
var _73={shouldEqual:"assertEqual",shouldNotEqual:"assertNotEqual",shouldEqualEnum:"assertEnumEqual",shouldBeA:"assertType",shouldNotBeA:"assertNotOfType",shouldBeAn:"assertType",shouldNotBeAn:"assertNotOfType",shouldBeNull:"assertNull",shouldNotBeNull:"assertNotNull",shouldBe:"assertReturnsTrue",shouldNotBe:"assertReturnsFalse",shouldRespondTo:"assertRespondsTo"};
Test.BDDMethods={};
for(m in _73){
Test.BDDMethods[m]=eval("function(){"+"var args = $A(arguments);"+"var scope = args.shift();"+"scope."+_73[m]+".apply(scope,(args || []).concat([this])); }");
}
[Array.prototype,String.prototype,Number.prototype].each(function(p){
Object.extend(p,Test.BDDMethods);
});
};
Test.context=function(_75,_76,log){
Test.setupBDDExtensionMethods();
var _78={};
var _79={};
for(specName in _76){
switch(specName){
case "setup":
case "teardown":
_78[specName]=_76[specName];
break;
default:
var _7a="test"+specName.gsub(/\s+/,"-").camelize();
var _7b=_76[specName].toString().split("\n").slice(1);
if(/^\{/.test(_7b[0])){
_7b=_7b.slice(1);
}
_7b.pop();
_7b=_7b.map(function(_7c){
return _7c.strip();
});
_78[_7a]=_7b.join("\n");
_79[_7a]=specName;
}
}
new Test.Unit.Runner(_78,{titles:_79,testLog:log||"testlog",context:_75});
};

var ajaxBox_offsetX=0;
var ajaxBox_offsetY=0;
var ajax_list_externalFile="search_trs_name.php";
var minimumLettersBeforeLookup=1;
var ajax_list_objects=new Array();
var ajax_list_cachedLists=new Array();
var ajax_list_activeInput=false;
var ajax_list_activeItem;
var ajax_list_optionDivFirstItem=false;
var ajax_list_currentLetters=new Array();
var ajax_optionDiv=false;
var ajax_optionDiv_iframe=false;
var ajax_list_MSIE=false;
if(navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("Opera")<0){
ajax_list_MSIE=true;
}
function ajax_getTopPos(_1){
var _2=_1.offsetTop;
while((_1=_1.offsetParent)!=null){
_2+=_1.offsetTop;
}
return _2;
}
function ajax_list_cancelEvent(){
return false;
}
function ajax_getLeftPos(_3){
var _4=_3.offsetLeft;
while((_3=_3.offsetParent)!=null){
_4+=_3.offsetLeft;
}
return _4;
}
function ajax_option_setValue(e,_6){
if(!_6){
_6=this;
}
var _7=_6.innerHTML;
if(ajax_list_MSIE){
_7=_6.innerText;
}else{
_7=_6.textContent;
}
if(!_7){
_7=_6.innerHTML;
}
ajax_list_activeInput.value=_7;
if(document.getElementById(ajax_list_activeInput.name+"_hidden")){
document.getElementById(ajax_list_activeInput.name+"_hidden").value=_6.id;
}
ajax_options_hide();
}
function ajax_options_hide(){
ajax_optionDiv.style.display="none";
if(ajax_optionDiv_iframe){
ajax_optionDiv_iframe.style.display="none";
}
}
function ajax_options_rollOverActiveItem(_8,_9){
if(ajax_list_activeItem){
ajax_list_activeItem.className="optionDiv";
}
_8.className="optionDivSelected";
ajax_list_activeItem=_8;
if(_9){
if(ajax_list_activeItem.offsetTop>ajax_optionDiv.offsetHeight){
ajax_optionDiv.scrollTop=ajax_list_activeItem.offsetTop-ajax_optionDiv.offsetHeight+ajax_list_activeItem.offsetHeight+2;
}
if(ajax_list_activeItem.offsetTop<ajax_optionDiv.scrollTop){
ajax_optionDiv.scrollTop=0;
}
}
}
function ajax_option_list_buildList(_a,_b){
ajax_optionDiv.innerHTML="";
ajax_list_activeItem=false;
if(ajax_list_cachedLists[_b][_a].length<=1){
ajax_options_hide();
return;
}
ajax_list_optionDivFirstItem=false;
var _c=false;
for(var no=0;no<ajax_list_cachedLists[_b][_a].length;no++){
if(ajax_list_cachedLists[_b][_a][no].length==0){
continue;
}
_c=true;
var _e=document.createElement("DIV");
var _f=ajax_list_cachedLists[_b][_a][no].split(/###/gi);
if(ajax_list_cachedLists[_b][_a].length==1&&ajax_list_activeInput.value==_f[0]){
ajax_options_hide();
return;
}
_e.innerHTML=_f[_f.length-1];
_e.id=_f[0];
_e.className="optionDiv";
_e.onmouseover=function(){
ajax_options_rollOverActiveItem(this,false);
};
_e.onclick=ajax_option_setValue;
if(!ajax_list_optionDivFirstItem){
ajax_list_optionDivFirstItem=_e;
}
ajax_optionDiv.appendChild(_e);
}
if(_c){
ajax_optionDiv.style.display="block";
if(ajax_optionDiv_iframe){
ajax_optionDiv_iframe.style.display="";
}
}
}
function ajax_option_list_showContent(_10,_11,_12){
var _13=_11.value;
var _14=ajax_list_objects[_10].response;
var _15=_14.split("|");
ajax_list_cachedLists[_12][_13]=_15;
ajax_option_list_buildList(_13,_12);
}
function ajax_option_resize(_16){
ajax_optionDiv.style.top=(ajax_getTopPos(_16)+_16.offsetHeight+ajaxBox_offsetY)+"px";
ajax_optionDiv.style.left=(ajax_getLeftPos(_16)+ajaxBox_offsetX)+"px";
if(ajax_optionDiv_iframe){
ajax_optionDiv_iframe.style.left=ajax_optionDiv.style.left;
ajax_optionDiv_iframe.style.top=ajax_optionDiv.style.top;
}
}
function ajax_showOptions(_17,_18,e){
if(e.keyCode==13||e.keyCode==9){
return;
}
if(ajax_list_currentLetters[_17.name]==_17.value){
return;
}
if(!ajax_list_cachedLists[_18]){
ajax_list_cachedLists[_18]=new Array();
}
ajax_list_currentLetters[_17.name]=_17.value;
if(!ajax_optionDiv){
ajax_optionDiv=document.createElement("DIV");
ajax_optionDiv.id="ajax_listOfOptions";
document.body.appendChild(ajax_optionDiv);
if(ajax_list_MSIE){
ajax_optionDiv_iframe=document.createElement("IFRAME");
ajax_optionDiv_iframe.border="0";
ajax_optionDiv_iframe.style.width=ajax_optionDiv.clientWidth+"px";
ajax_optionDiv_iframe.style.height=ajax_optionDiv.clientHeight+"px";
ajax_optionDiv_iframe.id="ajax_listOfOptions_iframe";
document.body.appendChild(ajax_optionDiv_iframe);
}
var _1a=document.getElementsByTagName("SELECT");
for(var no=0;no<_1a.length;no++){
_1a[no].onfocus=ajax_options_hide;
}
var _1c=document.body.onkeydown;
if(typeof _1c!="function"){
document.body.onkeydown=ajax_option_keyNavigation;
}else{
document.body.onkeydown=function(){
_1c();
ajax_option_keyNavigation();
};
}
var _1d=document.body.onresize;
if(typeof _1d!="function"){
document.body.onresize=function(){
ajax_option_resize(_17);
};
}else{
document.body.onresize=function(){
_1d();
ajax_option_resize(_17);
};
}
}
if(_17.value.length<minimumLettersBeforeLookup){
ajax_options_hide();
return;
}
ajax_optionDiv.style.top=(ajax_getTopPos(_17)+_17.offsetHeight+ajaxBox_offsetY)+"px";
ajax_optionDiv.style.left=(ajax_getLeftPos(_17)+ajaxBox_offsetX)+"px";
if(ajax_optionDiv_iframe){
ajax_optionDiv_iframe.style.left=ajax_optionDiv.style.left;
ajax_optionDiv_iframe.style.top=ajax_optionDiv.style.top;
}
ajax_list_activeInput=_17;
ajax_optionDiv.onselectstart=ajax_list_cancelEvent;
if(ajax_list_cachedLists[_18][_17.value]){
ajax_option_list_buildList(_17.value,_18);
}else{
ajax_optionDiv.innerHTML="";
var _1e=ajax_list_objects.length;
ajax_list_objects[_1e]=new sack();
var url=ajax_list_externalFile+"?"+_18+"=1&letters="+_17.value.replace(" ","+");
ajax_list_objects[_1e].requestFile=url;
ajax_list_objects[_1e].onCompletion=function(){
ajax_option_list_showContent(_1e,_17,_18);
};
ajax_list_objects[_1e].runAJAX();
}
}
function ajax_option_keyNavigation(e){
if(document.all){
e=event;
}
if(!ajax_optionDiv){
return;
}
if(ajax_optionDiv.style.display=="none"){
return;
}
if(e.keyCode==38){
if(!ajax_list_activeItem){
return;
}
if(ajax_list_activeItem&&!ajax_list_activeItem.previousSibling){
return;
}
ajax_options_rollOverActiveItem(ajax_list_activeItem.previousSibling,true);
}
if(e.keyCode==40){
if(!ajax_list_activeItem){
ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem,true);
}else{
if(!ajax_list_activeItem.nextSibling){
return;
}
ajax_options_rollOverActiveItem(ajax_list_activeItem.nextSibling,true);
}
}
if(e.keyCode==13||e.keyCode==9){
if(ajax_list_activeItem&&ajax_list_activeItem.className=="optionDivSelected"){
ajax_option_setValue(false,ajax_list_activeItem);
}
if(e.keyCode==13){
return false;
}else{
return true;
}
}
if(e.keyCode==27){
ajax_options_hide();
}
}
function DHTMLgoodies_roundedCorners(){
var _1;
this.roundedCornerTargets=new Array();
}
var string="";
DHTMLgoodies_roundedCorners.prototype={addTarget:function(_2,_3,_4,_5,_6,_7,_8,_9){
var _a=this.roundedCornerTargets.length;
this.roundedCornerTargets[_a]=new Array();
this.roundedCornerTargets[_a]["divId"]=_2;
this.roundedCornerTargets[_a]["xRadius"]=_3;
this.roundedCornerTargets[_a]["yRadius"]=_4;
this.roundedCornerTargets[_a]["color"]=_5;
this.roundedCornerTargets[_a]["backgroundColor"]=_6;
this.roundedCornerTargets[_a]["padding"]=_7;
this.roundedCornerTargets[_a]["heightOfContent"]=_8;
this.roundedCornerTargets[_a]["whichCorners"]=_9;
},init:function(){
for(var _b=0;_b<this.roundedCornerTargets.length;_b++){
whichCorners=this.roundedCornerTargets[_b]["whichCorners"];
divId=this.roundedCornerTargets[_b]["divId"];
xRadius=this.roundedCornerTargets[_b]["xRadius"];
yRadius=this.roundedCornerTargets[_b]["yRadius"];
color=this.roundedCornerTargets[_b]["color"];
backgroundColor=this.roundedCornerTargets[_b]["backgroundColor"];
padding=this.roundedCornerTargets[_b]["padding"];
heightOfContent=this.roundedCornerTargets[_b]["heightOfContent"];
whichCorners=this.roundedCornerTargets[_b]["whichCorners"];
var _c=new Array();
if(!whichCorners||whichCorners=="all"){
_c["top_left"]=true;
_c["top_right"]=true;
_c["bottom_left"]=true;
_c["bottom_right"]=true;
}else{
_c=whichCorners.split(/,/gi);
for(var _d in _c){
_c[_c[_d]]=true;
}
}
var _e=xRadius/yRadius;
var _f=document.getElementById(divId);
_f.style.backgroundColor=null;
_f.style.backgroundColor="transparent";
var _10=_f.innerHTML;
_f.innerHTML="";
if(_c["top_left"]||_c["top_right"]){
var _11=document.createElement("DIV");
_11.style.height=yRadius+"px";
_11.style.overflow="hidden";
_f.appendChild(_11);
var _12=0;
var _13=0;
for(no=1;no<=yRadius;no++){
var _14=(xRadius-(this.getY((yRadius-no),yRadius,_e)));
var _15=(xRadius-(this.getY_withDecimals((yRadius-no),yRadius,_e)));
var _16=xRadius-_15;
var _17=xRadius-_14-Math.floor(_13);
var _18=xRadius-(_14+_17);
var el=document.createElement("DIV");
el.style.overflow="hidden";
el.style.height="1px";
if(_c["top_left"]){
el.style.marginLeft=_14+"px";
}
if(_c["top_right"]){
el.style.marginRight=_14+"px";
}
_11.appendChild(el);
var y=_11;
for(var no2=1;no2<=_17;no2++){
switch(no2){
case 1:
if(no2==_17){
blendMode=((_16+_13)/2)-_18;
}else{
var _1c=this.getY_withDecimals((xRadius-_14-no2),xRadius,1/_e);
blendMode=(_16-_18-_17+1)*(_1c-(yRadius-no))/2;
}
break;
case _17:
var _1d=this.getY_withDecimals((xRadius-_14-no2+1),xRadius,1/_e);
blendMode=1-(1-(_1d-(yRadius-no)))*(1-(_13-_18))/2;
break;
default:
var _1e=this.getY_withDecimals((xRadius-_14-no2),xRadius,1/_e);
var _1f=this.getY_withDecimals((xRadius-_14-no2+1),xRadius,1/_e);
blendMode=((_1f+_1e)/2)-(yRadius-no);
}
el.style.backgroundColor=this.__blendColors(backgroundColor,color,blendMode);
y.appendChild(el);
y=el;
var el=document.createElement("DIV");
el.style.height="1px";
el.style.overflow="hidden";
if(_c["top_left"]){
el.style.marginLeft="1px";
}
if(_c["top_right"]){
el.style.marginRight="1px";
}
el.style.backgroundColor=color;
}
y.appendChild(el);
_13=_16;
}
}
var _21=document.createElement("DIV");
_21.className=_f.className;
_21.style.border="1px solid "+color;
_21.innerHTML=_10;
_21.style.backgroundColor=color;
_21.style.paddingLeft=padding+"px";
_21.style.paddingRight=padding+"px";
if(!heightOfContent){
heightOfContent="";
}
heightOfContent=heightOfContent+"";
if(heightOfContent.length>0&&heightOfContent.indexOf("%")==-1){
heightOfContent=heightOfContent+"px";
}
if(heightOfContent.length>0){
_21.style.height=heightOfContent;
}
_f.appendChild(_21);
if(_c["bottom_left"]||_c["bottom_right"]){
var _22=document.createElement("DIV");
_22.style.height=yRadius+"px";
_22.style.overflow="hidden";
_f.appendChild(_22);
var _23=0;
var _24=0;
var _25=false;
var _26=new Array();
for(no=1;no<=yRadius;no++){
var _27=(xRadius-(this.getY((yRadius-no),yRadius,_e)));
var _28=(xRadius-(this.getY_withDecimals((yRadius-no),yRadius,_e)));
var _29=(xRadius-_28);
var _2a=xRadius-_27-Math.floor(_24);
var _2b=xRadius-(_27+_2a);
var el=document.createElement("DIV");
el.style.overflow="hidden";
el.style.height="1px";
if(_c["bottom_left"]){
el.style.marginLeft=_27+"px";
}
if(_c["bottom_right"]){
el.style.marginRight=_27+"px";
}
_22.insertBefore(el,_22.firstChild);
var y=_22;
for(var no2=1;no2<=_2a;no2++){
switch(no2){
case 1:
if(no2==_2a){
blendMode=((_29+_24)/2)-_2b;
}else{
var _2f=this.getY_withDecimals((xRadius-_27-no2),xRadius,1/_e);
blendMode=(_29-_2b-_2a+1)*(_2f-(yRadius-no))/2;
}
break;
case _2a:
var _30=this.getY_withDecimals((xRadius-_27-no2+1),xRadius,1/_e);
blendMode=1-(1-(_30-(yRadius-no)))*(1-(_24-_2b))/2;
break;
default:
var _31=this.getY_withDecimals((xRadius-_27-no2),xRadius,1/_e);
var _32=this.getY_withDecimals((xRadius-_27-no2+1),xRadius,1/_e);
blendMode=((_32+_31)/2)-(yRadius-no);
}
el.style.backgroundColor=this.__blendColors(backgroundColor,color,blendMode);
if(y==_22){
_26[_26.length]=el;
}
try{
var _33=y.getElementsByTagName("DIV")[0];
y.insertBefore(el,y.firstChild);
}
catch(e){
y.appendChild(el);
_25=true;
}
y=el;
var el=document.createElement("DIV");
el.style.height="1px";
el.style.overflow="hidden";
if(_c["bottom_left"]){
el.style.marginLeft="1px";
}
if(_c["bottom_right"]){
el.style.marginRight="1px";
}
}
if(_25){
for(var _35=_26.length-1;_35>=0;_35--){
_22.appendChild(_26[_35]);
}
}
el.style.backgroundColor=color;
y.appendChild(el);
_24=_29;
}
}
}
},getY:function(x,_37,_38){
return Math.max(0,Math.ceil(_38*Math.sqrt((_37*_37)-(x*x))));
},getY_withDecimals:function(x,_3a,_3b){
return Math.max(0,_3b*Math.sqrt((_3a*_3a)-(x*x)));
},__blendColors:function(_3c,_3d,_3e){
if(_3c.length=="4"){
_3c="#"+_3c.substring(1,1)+_3c.substring(1,1)+_3c.substring(2,1)+_3c.substring(2,1)+_3c.substring(3,1)+_3c.substring(3,1);
}
if(_3d.length=="4"){
_3d="#"+_3d.substring(1,1)+_3d.substring(1,1)+_3d.substring(2,1)+_3d.substring(2,1)+_3d.substring(3,1)+_3d.substring(3,1);
}
var _3f=[parseInt("0x"+_3c.substring(1,3)),parseInt("0x"+_3c.substring(3,5)),parseInt("0x"+_3c.substring(5,7))];
var _40=[parseInt("0x"+_3d.substring(1,3)),parseInt("0x"+_3d.substring(3,5)),parseInt("0x"+_3d.substring(5,7))];
var red=Math.round(_3f[0]+(_40[0]-_3f[0])*_3e).toString(16);
var _42=Math.round(_3f[1]+(_40[1]-_3f[1])*_3e).toString(16);
var _43=Math.round(_3f[2]+(_40[2]-_3f[2])*_3e).toString(16);
if(red.length==1){
red="0"+red;
}
if(_42.length==1){
_42="0"+_42;
}
if(_43.length==1){
_43="0"+_43;
}
return "#"+red+_42+_43;
}};
var DHTMLgoodies_globalTooltipObj;
function DHTMLgoodies_formTooltip(){
var _1;
var _2;
var _3;
var _4;
var _5;
var _6;
var _7;
var _8;
var _9;
var _a;
var _b;
var _c;
var _d;
var _e;
var _f;
var _10;
var _11;
var _12;
var _13;
var _14;
var _15;
var _16;
var _17;
var _18;
var _19;
this.currentTooltipObj=false,this.tooltipDiv=false,this.tooltipText=false;
this.imagePath="images/";
this.arrowImageFile="green-arrow.gif";
this.arrowImageFileRight="green-arrow-right.gif";
this.tooltipWidth=200;
this.tooltipBgColor="#317082";
this.closeMessage="Close";
this.disableTooltipMessage="Don't show this message again";
this.activeInput=false;
this.tooltipPosition="right";
this.arrowRightWidth=16;
this.arrowTopHeight=13;
this.tooltipCornerSize=10;
this.displayArrow=true;
this.cookieName="DHTMLgoodies_tooltipVisibility";
this.disableTooltipByCookie=false;
this.tooltipDisabled=false;
this.disableTooltipPossibility=true;
this.tooltipIframeObj=false;
this.pageBgColor="#FFFFFF";
DHTMLgoodies_globalTooltipObj=this;
if(navigator.userAgent.indexOf("MSIE")>=0){
this.isMSIE=true;
}else{
this.isMSIE=false;
}
}
DHTMLgoodies_formTooltip.prototype={initFormFieldTooltip:function(){
var _1a=new Array();
var _1b=document.getElementsByTagName("INPUT");
for(var no=0;no<_1b.length;no++){
var _1d=_1b[no].getAttribute("tooltipText");
if(!_1d){
_1d=_1b[no].tooltipText;
}
if(_1d){
_1a[_1a.length]=_1b[no];
}
}
var _1e=document.getElementsByTagName("TEXTAREA");
for(var no=0;no<_1e.length;no++){
var _20=_1e[no].getAttribute("tooltipText");
if(!_20){
_20=_1e[no].tooltipText;
}
if(_20){
_1a[_1a.length]=_1e[no];
}
}
var _21=document.getElementsByTagName("SELECT");
for(var no=0;no<_21.length;no++){
var _23=_21[no].getAttribute("tooltipText");
if(!_23){
_23=_21[no].tooltipText;
}
if(_23){
_1a[_1a.length]=_21[no];
}
}
window.refToFormTooltip=this;
for(var no=0;no<_1a.length;no++){
_1a[no].onfocus=this.__displayTooltip;
}
this.addEvent(window,"resize",function(){
window.refToFormTooltip.__positionCurrentToolTipObj();
});
this.addEvent(document.documentElement,"click",function(e){
window.refToFormTooltip.__autoHideTooltip(e);
});
},setTooltipPosition:function(_26){
this.tooltipPosition=_26;
},setCloseMessage:function(_27){
this.closeMessage=_27;
},setDisableTooltipMessage:function(_28){
this.disableTooltipMessage=_28;
},setTooltipDisablePossibility:function(_29){
this.disableTooltipPossibility=_29;
},setCookieName:function(_2a){
this.cookieName=_2a;
},setTooltipWidth:function(_2b){
this.tooltipWidth=_2b;
},setArrowVisibility:function(_2c){
this.displayArrow=_2c;
},setDisableTooltipByCookie:function(_2d){
this.disableTooltipByCookie=_2d;
},setTooltipBgColor:function(_2e){
this.tooltipBgColor=_2e;
},setTooltipCornerSize:function(_2f){
this.tooltipCornerSize=_2f;
},setTopArrowHeight:function(_30){
this.arrowTopHeight=_30;
},setRightArrowWidth:function(_31){
this.arrowRightWidth=_31;
},setPageBgColor:function(_32){
this.pageBgColor=_32;
},__displayTooltip:function(){
if(DHTMLgoodies_globalTooltipObj.disableTooltipByCookie){
var _33=DHTMLgoodies_globalTooltipObj.getCookie(DHTMLgoodies_globalTooltipObj.cookieName)+"";
if(_33=="1"){
DHTMLgoodies_globalTooltipObj.tooltipDisabled=true;
}
}
if(DHTMLgoodies_globalTooltipObj.tooltipDisabled){
return;
}
var _34=this.getAttribute("tooltipText");
DHTMLgoodies_globalTooltipObj.activeInput=this;
if(!_34){
_34=this.tooltipText;
}
DHTMLgoodies_globalTooltipObj.tooltipText=_34;
if(!DHTMLgoodies_globalTooltipObj.tooltipDiv){
DHTMLgoodies_globalTooltipObj.__createTooltip();
}
DHTMLgoodies_globalTooltipObj.__positionTooltip(this);
DHTMLgoodies_globalTooltipObj.tooltipContentDiv.innerHTML=_34;
DHTMLgoodies_globalTooltipObj.tooltipDiv.style.display="block";
if(DHTMLgoodies_globalTooltipObj.isMSIE){
if(DHTMLgoodies_globalTooltipObj.tooltipPosition=="below"){
DHTMLgoodies_globalTooltipObj.tooltipIframeObj.style.height=(DHTMLgoodies_globalTooltipObj.tooltipDiv.clientHeight-DHTMLgoodies_globalTooltipObj.arrowTopHeight);
}else{
DHTMLgoodies_globalTooltipObj.tooltipIframeObj.style.height=(DHTMLgoodies_globalTooltipObj.tooltipDiv.clientHeight);
}
}
},__hideTooltip:function(){
try{
DHTMLgoodies_globalTooltipObj.tooltipDiv.style.display="none";
}
catch(e){
}
},getSrcElement:function(e){
var el;
if(e.target){
el=e.target;
}else{
if(e.srcElement){
el=e.srcElement;
}
}
if(el.nodeType==3){
el=el.parentNode;
}
return el;
},__autoHideTooltip:function(e){
if(document.all){
e=event;
}
var src=this.getSrcElement(e);
if(src.tagName.toLowerCase()!="input"&&src.tagName.toLowerCase().toLowerCase()!="textarea"&&src.tagName.toLowerCase().toLowerCase()!="select"){
this.__hideTooltip();
}
var _39=src.getAttribute("tooltipText");
if(!_39){
_39=src.tooltipText;
}
if(!_39){
this.__hideTooltip();
}
},__hideTooltipFromLink:function(){
this.activeInput.focus();
window.refToThis=this;
setTimeout("window.refToThis.__hideTooltip()",10);
},disableTooltip:function(){
this.__hideTooltipFromLink();
if(this.disableTooltipByCookie){
this.setCookie(this.cookieName,"1",500);
}
this.tooltipDisabled=true;
},__createTooltip:function(){
this.tooltipDiv=document.createElement("DIV");
this.tooltipDiv.style.position="absolute";
if(this.displayArrow){
var _3a=document.createElement("DIV");
if(this.tooltipPosition=="below"){
_3a.style.marginLeft="20px";
var _3b=document.createElement("IMG");
_3b.src=this.imagePath+this.arrowImageFile+"?rand="+Math.random();
_3b.style.display="block";
_3a.appendChild(_3b);
}else{
_3a.style.marginTop="5px";
var _3c=document.createElement("IMG");
_3c.src=this.imagePath+this.arrowImageFileRight+"?rand="+Math.random();
_3c.style.display="block";
_3a.appendChild(_3c);
_3a.style.position="absolute";
}
this.tooltipDiv.appendChild(_3a);
}
var _3d=document.createElement("DIV");
_3d.style.position="relative";
_3d.style.zIndex=1000;
if(this.tooltipPosition!="below"&&this.displayArrow){
_3d.style.left=this.arrowRightWidth+"px";
}
_3d.id="DHTMLgoodies_formTooltipDiv";
_3d.className="DHTMLgoodies_formTooltipDiv";
_3d.style.backgroundColor=this.tooltipBgColor;
this.tooltipDiv.appendChild(_3d);
if(this.isMSIE){
this.tooltipIframeObj=document.createElement("<IFRAME name=\"tooltipIframeObj\" width=\""+this.tooltipWidth+"\" frameborder=\"no\" src=\"about:blank\"></IFRAME>");
this.tooltipIframeObj.style.position="absolute";
this.tooltipIframeObj.style.top="0px";
this.tooltipIframeObj.style.left="0px";
this.tooltipIframeObj.style.width=(this.tooltipWidth)+"px";
this.tooltipIframeObj.style.zIndex=100;
this.tooltipIframeObj.background=this.pageBgColor;
this.tooltipIframeObj.style.backgroundColor=this.pageBgColor;
this.tooltipDiv.appendChild(this.tooltipIframeObj);
if(this.tooltipPosition!="below"&&this.displayArrow){
this.tooltipIframeObj.style.left=(this.arrowRightWidth)+"px";
}else{
this.tooltipIframeObj.style.top=this.arrowTopHeight+"px";
}
setTimeout("self.frames['tooltipIframeObj'].document.documentElement.style.backgroundColor='"+this.pageBgColor+"'",500);
}
this.tooltipContentDiv=document.createElement("DIV");
this.tooltipContentDiv.style.position="relative";
this.tooltipContentDiv.id="DHTMLgoodies_formTooltipContent";
_3d.appendChild(this.tooltipContentDiv);
var _3e=document.createElement("DIV");
_3e.style.textAlign="center";
_3e.innerHTML="<A class=\"DHTMLgoodies_formTooltip_closeMessage\" href=\"#\" onclick=\"DHTMLgoodies_globalTooltipObj.__hideTooltipFromLink();return false\">"+this.closeMessage+"</A>";
if(this.disableTooltipPossibility){
var _3f=_3e.innerHTML;
_3f=_3f+" | <A class=\"DHTMLgoodies_formTooltip_closeMessage\" href=\"#\" onclick=\"DHTMLgoodies_globalTooltipObj.disableTooltip();return false\">"+this.disableTooltipMessage+"</A>";
_3e.innerHTML=_3f;
}
_3d.appendChild(_3e);
document.body.appendChild(this.tooltipDiv);
if(this.tooltipCornerSize>0){
this.roundedCornerObj=new DHTMLgoodies_roundedCorners();
this.roundedCornerObj.addTarget("DHTMLgoodies_formTooltipDiv",this.tooltipCornerSize,this.tooltipCornerSize,this.tooltipBgColor,this.pageBgColor,5);
this.roundedCornerObj.init();
}
this.tooltipContentDiv=document.getElementById("DHTMLgoodies_formTooltipContent");
},addEvent:function(_40,_41,_42){
if(_40.attachEvent){
_40["e"+_41+_42]=_42;
_40[_41+_42]=function(){
_40["e"+_41+_42](window.event);
};
_40.attachEvent("on"+_41,_40[_41+_42]);
}else{
_40.addEventListener(_41,_42,false);
}
},__positionCurrentToolTipObj:function(){
if(DHTMLgoodies_globalTooltipObj.activeInput){
this.__positionTooltip(DHTMLgoodies_globalTooltipObj.activeInput);
}
},__positionTooltip:function(_43){
var _44=0;
if(!this.displayArrow){
_44=3;
}
if(this.tooltipPosition=="below"){
this.tooltipDiv.style.left=this.getLeftPos(_43)+"px";
this.tooltipDiv.style.top=(this.getTopPos(_43)+_43.offsetHeight+_44)+"px";
}else{
this.tooltipDiv.style.left=(this.getLeftPos(_43)+_43.offsetWidth+_44)+"px";
this.tooltipDiv.style.top=this.getTopPos(_43)+"px";
}
this.tooltipDiv.style.width=this.tooltipWidth+"px";
},getTopPos:function(_45){
var _46=_45.offsetTop;
while((_45=_45.offsetParent)!=null){
if(_45.tagName!="HTML"){
_46+=_45.offsetTop;
if(document.all){
_46+=_45.clientTop;
}
}
}
return _46;
},getLeftPos:function(_47){
var _48=_47.offsetLeft;
while((_47=_47.offsetParent)!=null){
if(_47.tagName!="HTML"){
_48+=_47.offsetLeft;
if(document.all){
_48+=_47.clientLeft;
}
}
}
return _48;
},getCookie:function(_49){
var _4a=document.cookie.indexOf(_49+"=");
var len=_4a+_49.length+1;
if((!_4a)&&(_49!=document.cookie.substring(0,_49.length))){
return null;
}
if(_4a==-1){
return null;
}
var end=document.cookie.indexOf(";",len);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(len,end));
},setCookie:function(_4d,_4e,_4f,_50,_51,_52){
_4f=_4f*60*60*24*1000;
var _53=new Date();
var _54=new Date(_53.getTime()+(_4f));
var _55=_4d+"="+escape(_4e)+((_4f)?";expires="+_54.toGMTString():"")+((_50)?";path="+_50:"")+((_51)?";domain="+_51:"")+((_52)?";secure":"");
document.cookie=_55;
}};
function sack(_1){
this.xmlhttp=null;
this.resetData=function(){
this.method="POST";
this.queryStringSeparator="?";
this.argumentSeparator="&";
this.URLString="";
this.encodeURIString=true;
this.execute=false;
this.element=null;
this.elementObj=null;
this.requestFile=_1;
this.vars=new Object();
this.responseStatus=new Array(2);
};
this.resetFunctions=function(){
this.onLoading=function(){
};
this.onLoaded=function(){
};
this.onInteractive=function(){
};
this.onCompletion=function(){
};
this.onError=function(){
};
this.onFail=function(){
};
};
this.reset=function(){
this.resetFunctions();
this.resetData();
};
this.createAJAX=function(){
try{
this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
try{
this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e2){
this.xmlhttp=null;
}
}
if(!this.xmlhttp){
if(typeof XMLHttpRequest!="undefined"){
this.xmlhttp=new XMLHttpRequest();
}else{
this.failed=true;
}
}
};
this.setVar=function(_2,_3){
this.vars[_2]=Array(_3,false);
};
this.encVar=function(_4,_5,_6){
if(true==_6){
return Array(encodeURIComponent(_4),encodeURIComponent(_5));
}else{
this.vars[encodeURIComponent(_4)]=Array(encodeURIComponent(_5),true);
}
};
this.processURLString=function(_7,_8){
encoded=encodeURIComponent(this.argumentSeparator);
regexp=new RegExp(this.argumentSeparator+"|"+encoded);
varArray=_7.split(regexp);
for(i=0;i<varArray.length;i++){
urlVars=varArray[i].split("=");
if(true==_8){
this.encVar(urlVars[0],urlVars[1]);
}else{
this.setVar(urlVars[0],urlVars[1]);
}
}
};
this.createURLString=function(_9){
if(this.encodeURIString&&this.URLString.length){
this.processURLString(this.URLString,true);
}
if(_9){
if(this.URLString.length){
this.URLString+=this.argumentSeparator+_9;
}else{
this.URLString=_9;
}
}
this.setVar("rndval",new Date().getTime());
urlstringtemp=new Array();
for(key in this.vars){
if(false==this.vars[key][1]&&true==this.encodeURIString){
encoded=this.encVar(key,this.vars[key][0],true);
delete this.vars[key];
this.vars[encoded[0]]=Array(encoded[1],true);
key=encoded[0];
}
urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0];
}
if(_9){
this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator);
}else{
this.URLString+=urlstringtemp.join(this.argumentSeparator);
}
};
this.runResponse=function(){
eval(this.response);
};
this.runAJAX=function(_a){
if(this.failed){
this.onFail();
}else{
this.createURLString(_a);
if(this.element){
this.elementObj=document.getElementById(this.element);
}
if(this.xmlhttp){
var _b=this;
if(this.method=="GET"){
totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;
this.xmlhttp.open(this.method,totalurlstring,true);
}else{
this.xmlhttp.open(this.method,this.requestFile,true);
try{
this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
catch(e){
}
}
this.xmlhttp.onreadystatechange=function(){
switch(_b.xmlhttp.readyState){
case 1:
_b.onLoading();
break;
case 2:
_b.onLoaded();
break;
case 3:
_b.onInteractive();
break;
case 4:
_b.response=_b.xmlhttp.responseText;
_b.responseXML=_b.xmlhttp.responseXML;
_b.responseStatus[0]=_b.xmlhttp.status;
_b.responseStatus[1]=_b.xmlhttp.statusText;
if(_b.execute){
_b.runResponse();
}
if(_b.elementObj){
elemNodeName=_b.elementObj.nodeName;
elemNodeName.toLowerCase();
if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){
_b.elementObj.value=_b.response;
}else{
_b.elementObj.innerHTML=_b.response;
}
}
if(_b.responseStatus[0]=="200"){
_b.onCompletion();
}else{
_b.onError();
}
_b.URLString="";
break;
}
};
this.xmlhttp.send(this.URLString);
}
}
};
this.reset();
this.createAJAX();
}
function isValidYear(_1,_2){
var _3=new Date();
var _4=_3.getYear();
if(_4>_2){
alert("Birth Year Has To Be Smaller Than Current Year");
return false;
}
return true;
}
function getSelectedCount(_5,_6,_7){
var _8=0;
for(var i=0;i<_5.length;i++){
var _a=_5.elements[i];
var _b=_a.type;
var id=_a.id;
if(_b==_7&&id==_6&&_a.checked==true){
_8=parseInt(_8)+1;
}
}
_8=parseInt(_8);
return _8;
}
function checkTrim(_d){
_d=LTrim(_d);
_d=RTrim(_d);
return _d;
}
function LTrim(_e){
ctr=0;
while(ctr<_e.length&&(_e.substring(ctr,ctr+1)==" ")){
ctr=ctr+1;
}
return _e.substring(ctr);
}
function RTrim(_f){
ctr=_f.length;
while(ctr>0&&(_f.substring(ctr,ctr-1)==" ")){
ctr=ctr-1;
}
return _f.substring(0,ctr);
}
function isEmpty(_10,_11){
var re=/\s/g;
var str=_11.replace(re,"");
if(str.length==0){
alert(_10+" cannot be blank ");
return true;
}else{
return false;
}
}
function hasOnlyAlphaNumericwithDot(_14,_15){
var str=_15;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z"))||(str.charAt(i)==".")||(str.charAt(i)<=" "))){
alert(_14+" contains only alphanumeric values \n\nValid Characters :(A to Z),(a to z) and (0 to 9) ");
return false;
}
i++;
}
return true;
}
function hasOnlyAlphaNumeric(_17,_18){
var str=_18;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z"))||(str.charAt(i)<=" "))){
alert(_17+" contains only alphanumeric values \n\nValid Characters :(A to Z),(a to z) and (0 to 9) ");
return false;
}
i++;
}
return true;
}
function hasOnlyAlphaNumericWithSymbol(_1a,_1b){
var str=_1b;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||(str.charAt(i)<="@")||((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z"))||(str.charAt(i)<=" "))){
alert(_1a+" contains only alphanumeric values \n\nValid Characters :(A to Z),(a to z) and (0 to 9) and @");
return false;
}
i++;
}
return true;
}
function validateCompanyName(_1d,_1e){
var _1f=checkTrim(_1e.value);
var _20="~!%^*+=?><,;#|/:";
for(i=0;i<_1f.length;i++){
for(j=0;j<_20.length;j++){
if(_1f.charAt(i)==_20.charAt(j)){
alert("Invalid "+_1d+"");
return false;
}
}
}
return true;
}
function validateEmailID(_21,_22){
var _23=checkTrim(_22.value);
var _24=" ~!$%^*()+=?><,;#&|/:";
for(i=0;i<_23.length;i++){
for(j=0;j<_24.length;j++){
if(_23.charAt(i)==_24.charAt(j)){
alert("Invalid "+_21+"");
return false;
}
}
}
return true;
}
function validatePhone(_25,_26){
var _27=checkTrim(_26.value);
var _28=" ~!$%^*@+=?><,;&|/:";
for(i=0;i<_27.length;i++){
for(j=0;j<_28.length;j++){
if(_27.charAt(i)==_28.charAt(j)){
alert("Invalid "+_25+"");
return false;
}
}
}
return true;
}
function validateFax(_29,_2a){
var _2b=checkTrim(_2a.value);
var _2c=" ~!$%^*@+=?><,#&|/:";
for(i=0;i<_2b.length;i++){
for(j=0;j<_2c.length;j++){
if(_2b.charAt(i)==_2c.charAt(j)){
alert("Invalid "+_29+"");
return false;
}
}
}
return true;
}
function validateStreet(_2d,_2e){
var _2f=checkTrim(_2e.value);
var _30="~!$%^*@+=?><;&|";
for(i=0;i<_2f.length;i++){
for(j=0;j<_30.length;j++){
if(_2f.charAt(i)==_30.charAt(j)){
alert("Invalid "+_2d+"");
return false;
}
}
}
return true;
}
function validateZipCode(_31,_32){
var _33=checkTrim(_32.value);
var _34=" ~!$%^*@+=?><,";
for(i=0;i<_33.length;i++){
for(j=0;j<_34.length;j++){
if(_33.charAt(i)==_34.charAt(j)){
alert("Invalid "+_31+"");
return false;
}
}
}
return true;
}
function hasValidCharacter(_35,_36){
var str=_36;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z")))){
alert(_35+" contains only alphanumeric values \n\nValid Characters :(A to Z),(a to z) and (1 to 9) ");
return false;
}
i++;
}
return true;
}
function hasValidRemarks(_38,_39){
var str=_39;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z"))||(str.charAt(i)==" ")||(str.charAt(i)=="-")||(str.charAt(i)=="(")||(str.charAt(i)==")"))){
alert(_38+" contains only alphanumeric values \n\nValid Characters :(A to Z),(a to z),(\" \"),(-),(\"(\"),(\")\") and (1 to 9) ");
return false;
}
i++;
}
return true;
}
function isSpace(_3b,_3c){
var str=_3c;
if((str).indexOf(" ")!=-1){
alert(" Space is not allowed in "+_3b);
return false;
}
return true;
}
function isStartsWithNumber(_3e,_3f){
var _40="0123456789";
startsWithNumber=false;
var str=checkTrim(_3f);
for(i=0;i<_40.length;i++){
if(str.charAt(0)==_40.charAt(i)){
alert(_3e+" cannot start with number");
return false;
}
}
return true;
}
function hasOnlyAlphabets(_42,_43){
var str=_43;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||(str.charAt(i)==" ")||((str.charAt(i)>="A")&&(str.charAt(i)<="Z")))){
alert(_42+" can contain only alphabets\n\nValid Characters :(A to Z),(a to z) ");
return false;
}
i++;
}
return true;
}
function hasOnlyNumeric(_45,_46){
var str=_46;
var i=0;
while(i<str.length){
if(!((str.charAt(i)>="0")&&(str.charAt(i)<="9"))){
alert(_45+" can contain only numeric value");
return false;
}else{
i=i+1;
}
}
return true;
}
function hasOnlyNumericAndSpecificChar(_49,_4a){
var str=_4a;
i=0;
while(i<str.length){
if(!((str.charAt(i)>="0")&&(str.charAt(i)<="9")||(str.charAt(i)=="-")||(str.charAt(i)==" ")||(str.charAt(i)==","))){
alert(_49+" can contain only numeric value,whitespace and hyphen");
return false;
}
i++;
}
return true;
}
function hasOnlyNumericAndComma(_4c,_4d){
var str=_4d;
i=0;
while(i<str.length){
if(!((str.charAt(i)>="0")&&(str.charAt(i)<="9")||(str.charAt(i)==","))){
alert(_4c+" can contain only numeric value and comma");
return false;
}
i++;
}
return true;
}
function hasOnlyAlphabetsAndSpecificChar(_4f,_50){
var str=_50;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z")||(str.charAt(i)==" ")||(str.charAt(i)=="-")||(str.charAt(i)=="_")||(str.charAt(i)==",")||(str.charAt(i)==".")||(str.charAt(i)=="'")||(str.charAt(i)>="0")&&(str.charAt(i)<="9")))){
alert(_4f+" can contain only alphabets\n\nValid Characters :(A to Z),(a to z),whitespace and hyphen ");
return false;
}
i++;
}
return true;
}
function validateFileName(_52,_53){
var str=_53;
i=0;
while(i<str.length){
if((str.charAt(i)==">")||(str.charAt(i)=="<")){
alert("Invalid "+_52);
return false;
}
i++;
}
return true;
}
function hasOnlySpecificChar(_55,_56,_57){
var str=_55.value;
i=0;
while(i<str.length){
n=0;
while(n<_56.length){
if(str.charAt(i)==_56.charAt(n)){
break;
}
n++;
}
if(n==_56.length){
alert(_57);
return false;
}
i++;
}
return true;
}
function isFloat(_59,_5a){
var str=_5a;
var _5c;
i=0;
j=0;
if(str.charAt(0)=="."){
alert(_59+" is not valid\n\n e.g 57.55");
return false;
}
while(i<str.length){
if((!((str.charAt(i)>="0")&&(str.charAt(i)<="9")))&&(str.charAt(i)!=".")){
alert(_59+" is not valid\n\n e.g 57.55");
return false;
}
if(str.charAt(i)=="."){
j++;
}
i++;
}
if(j>1){
alert(_59+" is not valid\n\n e.g 57.55");
return false;
}
if(str.indexOf(".")>=0){
_5c=str.substring(str.indexOf("."),str.length-1);
if(_5c.length>2){
alert(_59+" is not valid\n\nOnly 2 digits allowed after the decimal");
return false;
}
}
return true;
}
function isTooLong(_5d,_5e,_5f){
_5e=checkTrim(_5e);
if((_5e.length)>_5f){
alert(_5d+" cannot exceed "+_5f+" character");
return false;
}else{
return true;
}
}
function emailCheck(_60){
var _61=/^(.+)@(.+)$/;
var _62="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
var _63="[^\\s"+_62+"]";
var _64="(\"[^\"]*\")";
var _65=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var _66=_63+"+";
var _67="("+_66+"|"+_64+")";
var _68=new RegExp("^"+_67+"(\\."+_67+")*$");
var _69=new RegExp("^"+_66+"(\\."+_66+")*$");
var _6a=_60.match(_61);
if(_6a==null){
alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var _6b=_6a[1];
var _6c=_6a[2];
if(_6b.match(_68)==null){
alert("Email address seems incorrect\n(The username doesn't seem to be valid)");
return false;
}
var _6d=_6c.match(_65);
if(_6d!=null){
for(var i=1;i<=4;i++){
if(_6d[i]>255){
alert("Email address seems incorrect\n(Destination IP address is invalid)");
return false;
}
}
return true;
}
var _6f=_6c.match(_69);
if(_6f==null){
alert("Email address seems incorrect\n(The domain name doesn't seem to be valid)");
return false;
}
var _70=new RegExp(_66,"g");
var _71=_6c.match(_70);
var len=_71.length;
if(_71[_71.length-1].length<2||_71[_71.length-1].length>3){
alert("Email address seems incorrect\n(The address must end in a three-letter domain, or two letter country)");
return false;
}
if(len<2){
var _73="Email address seems incorrect\n(This address is missing a hostname)";
alert(_73);
return false;
}
return true;
}
function isDuplicate(_74,_75){
if(_74==_75){
return true;
}else{
return false;
}
}
function isValidPhoneNO(_76,_77){
var str=_77;
var _79="0123456789-";
var _7a=checkTrim(str);
var _7b=true;
var _7c="";
for(i=0;i<_7a.length;i++){
ch=_7a.charAt(i);
for(j=0;j<_79.length;j++){
if(ch==_79.charAt(j)){
break;
}
}
if(j==_79.length){
_7b=false;
break;
}
if(ch!=","){
_7c+=ch;
}
}
if(_7b){
return (true);
}else{
alert("Please enter valid "+_76+"\n\n e.g. XXX-XXX-XXXX");
}
return (false);
}
function check_usphone(_7d,_7e){
if(!_7e){
_7e=1;
}
if((_7d.match(/^[ ]*[(]{0,1}[ ]*[0-9]{3,3}[ ]*[)]{0,1}[-]{0,1}[ ]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/)==null)&&((_7e!=1)&&(_7d.match(/^[ ]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/)==null))){
return false;
}
return true;
}
function isValidID(_7f,_80){
var str=_80;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z")))){
alert(_7f+" contains only alphanumeric values(without whitespace) \n\nValid Characters :(A to Z),(a to z) and (1 to 9) ");
return false;
}
i++;
}
return true;
}
function validateSingleDate(_82){
if(_82==""){
alert("Date cannot be empty");
return false;
}
var _83;
var dat;
var _85;
var _86;
var _87;
var str=_82;
var i=0;
var _8a=0;
if(str.charAt(0)=="0"&&str.charAt(1)=="0"){
alert("Please enter valid Month");
return false;
}
if(str.charAt(3)=="0"&&str.charAt(4)=="0"){
alert("Please enter valid Date");
return false;
}
if(str.charAt(6)=="0"&&str.charAt(7)=="0"&&str.charAt(8)=="0"&&str.charAt(9)=="0"){
alert("Please enter valid Year");
return false;
}
if(str.charAt(2)!="/"){
alert("Please enter valid Date (e.g. 02/07/2002)");
return false;
}
if(str.charAt(5)!="/"){
alert("Please enter valid Date (e.g. 02/07/2002)");
return false;
}
while(i<str.length){
if(!(((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||(str.charAt(i)=="/"))){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}else{
if(str.charAt(i)=="/"){
_8a=_8a+1;
}
}
i++;
}
if(_8a>2){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}
_83=_82.substring(0,2);
dat=_82.substring(3,5);
_85=_82.substring(6,10);
if(_83>12){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}
if(_83==1||_83==3||_83==5||_83==7||_83==8||_83==10||_83==12){
if(dat>31){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}
}
if(_83==2||_83==4||_83==6||_83==9||_83==11){
if(dat>30){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}
}
if((_85%4==0&&_85%100!=0)||_85%400==0){
if(_83==2){
if(dat>29){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}
}
}else{
if(_83==2){
if(dat>28){
alert("Please enter valid Date (e.g. 12/27/2002)");
return false;
}
}
}
if(_85<1900||_85>2050){
alert("Please enter year between 1900 and 2050");
return false;
}
return true;
}
function validateDate(_8b,_8c){
var _8d;
var _8e;
_8d=new Date();
_8e=new Date(_8b);
enDate=new Date(_8c);
if(_8d<_8e){
alert("From Date cannot be the future date");
return false;
}
if(_8d<enDate){
alert("To Date cannot be the future date");
return false;
}
if(enDate<_8e){
alert("Invalid Date range selection");
return false;
}
return true;
}
function isDateBefore(_8f,_90,_91,_92){
var _93=convertStringToDate(_90,5);
var _94=convertStringToDate(_92,5);
if(_93<_94){
alert(_8f+" cannot be earlier than the "+_91+".");
return false;
}
return true;
}
function isDateAfter(_95,_96,_97,_98){
var _99=convertStringToDate(_96,5);
var _9a=convertStringToDate(_98,5);
if(_99>_9a){
alert(_95+" cannot be later than the "+_97+".");
return false;
}
return true;
}
function isValidString(_9b,_9c){
var _9d=checkTrim(_9c);
var _9e="~!@$%^*()-+=?><\"";
for(i=0;i<_9d.length;i++){
for(j=0;j<_9e.length;j++){
if(_9d.charAt(i)==_9e.charAt(j)){
alert("Invalid "+_9b+"");
return false;
}
}
}
return true;
}
function isValidFileName(_9f,_a0){
var _a1=checkTrim(_a0);
var _a2="\"~!@#$%^&*()+=|[]{}?><,:;'/\\";
for(i=0;i<_a1.length;i++){
for(j=0;j<_a2.length;j++){
if(_a1.charAt(i)==_a2.charAt(j)){
alert("Invalid "+_9f+"");
return false;
}
}
}
return true;
}
function isValidZipCode(_a3){
var _a4="0123456789-";
var _a5=0;
if(_a3.length!=5&&_a3.length!=10){
alert("Please enter your 5 digit or 5 digit+4 zip code.");
return false;
}
for(var i=0;i<_a3.length;i++){
temp=""+_a3.substring(i,i+1);
if(temp=="-"){
_a5++;
}
if(_a4.indexOf(temp)=="-1"){
alert("Invalid characters in your zip code.  Please try again.");
return false;
}
if((_a5>1)||((_a3.length==10)&&""+_a3.charAt(5)!="-")){
alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
return false;
}
}
return true;
}
function isValidNumeric(_a7){
var str=_a7;
i=0;
while(i<str.length){
if(!((str.charAt(i)>="0")&&(str.charAt(i)<="9"))){
return false;
}
i++;
}
return true;
}
function isValidCreditCardNo(_a9,_aa){
if(!checkTextData(_a9,_aa,true,false,true,false,false,false,false)){
return false;
}
var _ab=_aa.value.length;
if(!(_ab==15||_ab==16)){
alert("Invalid "+_a9);
_aa.focus();
return false;
}
return true;
}
function checkRadioCheckBox(_ac,_ad){
var _ae=false;
if(_ad.length){
for(i=0;i<_ad.length;i++){
if(_ad[i].checked){
_ae=true;
break;
}
}
}else{
if(_ad.checked){
_ae=true;
}
}
if(!_ae){
alert(_ac+" must be specified");
return false;
}
return _ae;
}
function checkTextData(_af,_b0,_b1,_b2,_b3,_b4,_b5,_b6,_b7,_b8,_b9,_ba){
if(_b1){
if(isEmpty(_af,_b0.value)){
_b0.focus();
return false;
}
}
if(_b2){
if(!hasOnlyAlphabets(_af,_b0.value)){
_b0.focus();
return false;
}
}
if(_b3){
if(!hasOnlyNumeric(_af,_b0.value)){
_b0.focus();
return false;
}
}
if(_b5){
if(!hasOnlyAlphabetsAndSpecificChar(_af,_b0.value)){
_b0.focus();
return false;
}
}
if(_b6){
if(!hasOnlyNumericAndSpecificChar(_af,_b0.value)){
_b0.focus();
return false;
}
}
if(_b7){
if(!hasOnlyNumericAndComma(_af,_b0.value)){
_b0.focus();
return false;
}
}
if(_b8){
if(!hasOnlySpecificChar(_b0,_b9,_ba)){
_b0.focus();
return false;
}
}
return true;
}
function addDays(_bb,_bc){
return new Date(_bb.getTime()+_bc*24*60*60*1000);
}
function addMonths(_bd,_be){
_bd.setMonth(_bd.getMonth()+_be);
return _bd;
}
function convertStringToDate(_bf,_c0){
if(_c0==1){
var _c1=new Date(_bf.substring(0,4),_bf.substring(4,6)-1,_bf.substring(6,8));
return _c1;
}else{
if(_c0==2){
var _c2=new Date(_bf.substring(0,2),_bf.substring(2,4)-1,_bf.substring(4,6));
return _c2;
}else{
if(_c0==3){
var _c3=new Date(_bf.substring(6,10),_bf.substring(3,5)-1,_bf.substring(0,2));
return _c3;
}else{
if(_c0==4){
var _c4=new Date(_bf.substring(6,8),_bf.substring(0,2)-1,_bf.substring(3,5));
return _c4;
}else{
if(_c0==5){
var _c5=new Date(_bf.substring(6,10),_bf.substring(0,2)-1,_bf.substring(3,5));
return _c5;
}else{
return "";
}
}
}
}
}
}
function getDateDiff(_c6,dTo){
var _c8=_c6.getYear();
var _c9=_c6.getMonth();
var _ca=_c6.getDate();
var _cb=dTo.getYear();
var _cc=dTo.getMonth();
var _cd=dTo.getDate();
yearAge=_cb-_c8;
if(_cc>=_c9){
var _ce=_cc-_c9;
}else{
yearAge--;
var _cf=12+_cc-_c9;
}
if(_cd>=_ca){
var _d0=_cd-_ca;
}else{
_cf--;
var _d1=31+_cd-_ca;
if(_cf<0){
_cf=11;
yearAge--;
}
}
_cf=_cf+(yearAge*12);
return _cf+"/"+_d1;
}
function y2k(_d2){
return (_d2<1000)?_d2+1900:_d2;
}
function daysElapsed(_d3,_d4){
var _d5=Date.UTC(y2k(_d3.getYear()),_d3.getMonth(),_d3.getDate(),0,0,0)-Date.UTC(y2k(_d4.getYear()),_d4.getMonth(),_d4.getDate(),0,0,0);
return _d5/1000/60/60/24;
}
function round(n,d){
n=n-0;
if(d==null){
d=2;
}
var f=Math.pow(10,d);
n+=Math.pow(10,-(d+1));
n=Math.round(n*f)/f;
n+=Math.pow(10,-(d+1));
n+="";
return d==0?n.substring(0,n.indexOf(".")):n.substring(0,n.indexOf(".")+d+1);
}
var digits="0123456789";
var phoneNumberDelimiters="-";
var validWorldPhoneChars=phoneNumberDelimiters;
var minDigitsInIPhoneNumber=10;
function isInteger(s){
var i;
for(i=0;i<s.length;i++){
var c=s.charAt(i);
if(((c<"0")||(c>"9"))){
return false;
}
}
return true;
}
function stripCharsInBag(s,bag){
var i;
var _df="";
for(i=0;i<s.length;i++){
var c=s.charAt(i);
if(bag.indexOf(c)==-1){
_df+=c;
}
}
return _df;
}
function checkUSPhone(_e1){
s=stripCharsInBag(_e1,validWorldPhoneChars);
return (isInteger(s)&&s.length>=minDigitsInIPhoneNumber);
}
function isDigit(_e2){
var _e3=new Array("0","1","2","3","4","5","6","7","8","9"),j;
for(j=0;j<_e3.length;j++){
if(_e2==_e3[j]){
return true;
}
}
return false;
}
function isPositiveInteger(_e4){
var _e5=new String(_e4);
if(!isDigit(_e5.charAt(0))){
if(!(_e5.charAt(0)=="+")){
return false;
}
}
for(var i=1;i<_e5.length;i++){
if(!isDigit(_e5.charAt(i))){
return false;
}
}
return true;
}
function isValidDate(s,f){
if(s!=null&&checkTrim(s)!=""){
var a1=s.split("/");
var a2=s.split("-");
var e=true;
if((a1.length!=3)&&(a2.length!=3)){
e=false;
}else{
if(a1.length==3){
var na=a1;
}
if(a2.length==3){
var na=a2;
}
if(isPositiveInteger(na[0])&&isPositiveInteger(na[1])&&isPositiveInteger(na[2])){
if(f==1){
var d=na[1],m=na[0];
}else{
var d=na[0],m=na[1];
}
var y=na[2];
if(((e)&&(y<1000)||y.length>4)){
e=false;
}
if(e){
v=new Date(m+"/"+d+"/"+y);
if(v.getMonth()!=m-1){
e=false;
}
}
}else{
e=false;
}
}
return e;
}else{
return true;
}
}
function maxlength(obj,_f2,_f3){
var q=eval(obj.value.length);
var r=q-_f3;
var msg="Sorry , You have typed "+q+" characters in "+_f2+" textbox. The text box has limit of "+_f3+" characters. Please shorten your text by "+r+" characters.";
if(q>_f3){
alert(msg);
return false;
}else{
return true;
}
}
function isValidFloat(_f7,_f8){
var str=_f8;
var _fa;
i=0;
j=0;
while(i<str.length){
if((!((str.charAt(i)>="0")&&(str.charAt(i)<="9")))&&(str.charAt(i)!=".")&&(str.charAt(i)!="-")){
alert(_f7+" is not valid\n\n e.g -57.55");
return false;
}
if(str.charAt(i)=="."){
j++;
}
if(str.charAt(i)=="-"){
if(i!=0){
alert(_f7+" is not valid\n\n e.g 57.55");
return false;
}
}
i++;
}
if(j>1){
alert(_f7+" is not valid\n\n e.g 57.55");
return false;
}
if(str.indexOf(".")>=0){
_fa=str.substring(str.indexOf("."),str.length-1);
if(_fa.length>2){
alert(_f7+" is not valid\n\n e.g 57.55");
return false;
}
}
return true;
}
function isValidPasswordChar(_fb,_fc){
var str=_fc;
i=0;
while(i<str.length){
if((str.charAt(i)=="<")||(str.charAt(i)==">")||(str.charAt(i)=="\"")||(str.charAt(i)=="'")||(str.charAt(i)==" ")){
alert("Invalid "+_fb+"");
return false;
}
i++;
}
return true;
}
function hasFileNameAlphabets(_fe,_ff){
var str=_ff;
i=0;
while(i<str.length){
if((str.charAt(i)=="<")||(str.charAt(i)==">")||(str.charAt(i)=="\"")||(str.charAt(i)=="\\")||(str.charAt(i)=="/")||(str.charAt(i)=="?")||(str.charAt(i)=="*")||(str.charAt(i)==":")||(str.charAt(i)=="|")){
alert(_fe+" cannot contain any of the following characters: \n /  : ? | < > * \"");
return false;
}
i++;
}
return true;
}
function maskIt(fld,_102){
fldVal=fld.value;
var _103=_102;
var _104="";
var _105;
keyCount=fldVal.length;
keyEntered=fldVal.substring(keyCount-1,keyCount);
if(keyCount<2){
_105=false;
}
if(!_105){
_105=chkNAN(keyEntered);
}
keyCount++;
with(_103){
switch(keyCount){
case 2:
_104+=fldVal;
fld.value=_104;
break;
case 4:
fld.value+="-";
break;
case 5:
fld.value+="";
break;
case 8:
fld.value+="-";
break;
}
}
}
function checkPhoneNO(_106,_107){
if(isValidPhoneNO(_106,_107)){
if(_107.indexOf("-")!=3){
alert(_106+" should be of format xxx-xxx-xxxx");
return false;
}
if(_107.lastIndexOf("-")!=7){
alert(_106+" should be of format xxx-xxx-xxxx");
return false;
}
if(_107.length!=12){
alert(_106+" should be of format xxx-xxx-xxxx");
return false;
}
return true;
}else{
return false;
}
}
function chkNAN(_108){
var _109="0123456789";
if(_109.indexOf(_108)=="-1"){
alert("You have entered a non-numeric character.");
return false;
}
}
function allowFloat(_10a,_10b,_10c,_10d){
var str=checkTrim(_10b);
j=0;
i=0;
while(i<str.length){
if(str.charAt(i)=="."){
if(j!=0){
alert(_10a+" is not valid value");
return false;
}else{
j++;
}
}
i++;
}
i=0;
if(j!=0){
var _10f=str.substring(0,str.indexOf("."));
var _110=str.substring(str.indexOf(".")+1,str.length);
if(_10f.length==0||_110.length==0){
alert(_10a+" is not valid value");
return false;
}
if(!checkLength(_10f,_10c)){
alert(_10a+" is not valid value \n\nOnly "+_10c+" digits allowed before the decimal");
return false;
}
if(!checkLength(_110,_10d)){
alert(_10a+" is not valid value\n\nOnly "+_10d+" digits allowed after the decimal");
return false;
}
}else{
if(!checkLength(str,_10c)){
alert(_10a+" is not valid value");
return false;
}
}
while(i<str.length){
if(!(((str.charAt(i)>="0")&&(str.charAt(i)<="9"))||str.charAt(i)==".")){
alert(_10a+" contains only numeric value");
return false;
}
i++;
}
return true;
}
function checkLength(_111,_112){
_111=checkTrim(_111);
if((_111.length)>_112){
return false;
}else{
return true;
}
}
function validateEmail(_113,_114){
var _115=/^([\w]+)(.[\w]+){1,4}@([\w]+)(.[\w]+)([.][\w]{2,3}){1,2}$/;
if(!_114.value.match(_115)){
alert("Invalid "+_113+" ");
return (false);
}
return (true);
}
function hasOnlyAlphabetsAndSingleQuote(_116,_117){
var str=_117;
i=0;
while(i<str.length){
if(!(((str.charAt(i)>="a")&&(str.charAt(i)<="z"))||((str.charAt(i)>="A")&&(str.charAt(i)<="Z"))||(str.charAt(i)=="'")||(str.charAt(i)==" "))){
alert(_116+" can contain only alphabets\n\nValid Characters :(A to Z),(a to z) and single quotes");
return false;
}
i++;
}
return true;
}
function strMonth(_119){
if(_119==1){
return "January";
}
if(_119==2){
return "February";
}
if(_119==3){
return "March";
}
if(_119==4){
return "April";
}
if(_119==5){
return "May";
}
if(_119==6){
return "June";
}
if(_119==7){
return "July";
}
if(_119==8){
return "August";
}
if(_119==9){
return "September";
}
if(_119==10){
return "October";
}
if(_119==11){
return "November";
}
if(_119==12){
return "December";
}
}
function stringLength(_11a){
var _11b=checkTrim(_11a);
return _11b.length;
}
function checkTrim(_11c){
_11c=LTrim(_11c);
_11c=RTrim(_11c);
return _11c;
}
function LTrim(_11d){
ctr=0;
while(ctr<_11d.length&&(_11d.substring(ctr,ctr+1)==" ")){
ctr=ctr+1;
}
return _11d.substring(ctr);
}
function RTrim(_11e){
ctr=_11e.length;
while(ctr>0&&(_11e.substring(ctr,ctr-1)==" ")){
ctr=ctr-1;
}
return _11e.substring(0,ctr);
}
function isTooLong(_11f,_120,_121){
_120=checkTrim(_120);
if((_120.length)>_121){
alert(_11f+" cannot exceed "+_121+" character");
return false;
}else{
return true;
}
}
function isValid(_122,_123){
var str=_123;
i=0;
while(i<str.length){
if((str.charAt(i)=="<")||(str.charAt(i)==">")||(str.charAt(i)=="\"")||(str.charAt(i)=="'")||(str.charAt(i)=="\\")){
alert("Invalid "+_122+"");
return false;
}
i++;
}
return true;
}
function isValidKeyword(_125,_126){
var str=_126;
i=0;
while(i<str.length){
if((str.charAt(i)=="<")||(str.charAt(i)==">")||(str.charAt(i)=="\"")||(str.charAt(i)=="\"")){
alert("Invalid "+_125+"");
return false;
}
i++;
}
return true;
}
function checkdate(_128){
var _129=_128;
if(validateSingleDate(_129.value)==false){
_129.className="cal-TextBoxInvalid";
_129.focus();
_129.select();
return false;
}else{
return true;
}
}
function doDateCheck(from,to){
if(Date.parse(from.value)<=Date.parse(to.value)){
return true;
}else{
if(from.value==""){
alert("Start date must be entered");
from.className="cal-TextBoxInvalid";
from.focus();
from.select();
return false;
}else{
if(to.value==""){
alert("End date must be entered");
to.className="cal-TextBoxInvalid";
to.focus();
to.select();
return false;
}else{
alert("End Date must occur after the Start Date");
to.className="cal-TextBoxInvalid";
to.focus();
to.select();
return false;
}
}
}
}
function doSearchDateCheck(from,to){
if(Date.parse(from.value)<=Date.parse(to.value)){
return true;
}else{
if(from.value==""){
alert("From date must be entered");
from.className="cal-TextBoxInvalid";
from.focus();
from.select();
return false;
}else{
if(to.value==""){
alert("To date must be entered");
to.className="cal-TextBoxInvalid";
to.focus();
to.select();
return false;
}else{
alert("To date must occur after the From date");
to.className="cal-TextBoxInvalid";
to.focus();
to.select();
return false;
}
}
}
}
function doTodayDateCheck(from,to,_130){
if(Date.parse(from.value)<=Date.parse(to)){
return true;
}else{
if(from.value==""){
alert("From date must be entered");
from.className="cal-TextBoxInvalid";
from.focus();
from.select();
return false;
}else{
if(to.value==""){
alert("To date must be entered");
to.className="cal-TextBoxInvalid";
to.focus();
to.select();
return false;
}else{
alert(_130+" cannot be future date");
return false;
}
}
}
}
function isValidPassword(_131,_132){
var str=_132;
i=0;
while(i<str.length){
if((str.charAt(i)=="\"")||(str.charAt(i)=="'")||(str.charAt(i)=="\\")){
alert("Invalid "+_131+"");
return false;
}
i++;
}
return true;
}
var Cards=new makeArray(8);
Cards[0]=new CardType("MasterCard","51,52,53,54,55","16");
var MasterCard=Cards[0];
Cards[1]=new CardType("VisaCard","4","13,16");
var VisaCard=Cards[1];
Cards[2]=new CardType("AmExCard","34,37","15");
var AmExCard=Cards[2];
Cards[3]=new CardType("DinersClubCard","30,36,38","14");
var DinersClubCard=Cards[3];
Cards[4]=new CardType("DiscoverCard","6011","16");
var DiscoverCard=Cards[4];
Cards[5]=new CardType("enRouteCard","2014,2149","15");
var enRouteCard=Cards[5];
Cards[6]=new CardType("JCBCard","3088,3096,3112,3158,3337,3528","16");
var JCBCard=Cards[6];
var LuhnCheckSum=Cards[7]=new CardType();
function CheckCardNumber(form){
var _135;
if(form.cardNumber.value.length==0){
alert("Please enter a Card Number.");
form.cardNumber.focus();
return false;
}
if(form.cardYear.value.length==0){
alert("Please enter the Expiration Year.");
form.cardYear.focus();
return false;
}
if(form.cardYear.value>96){
_135="19"+form.cardYear.value;
}else{
if(form.cardYear.value<21){
_135="20"+form.cardYear.value;
}else{
alert("The Expiration Year is not valid.");
return false;
}
}
tmpmonth=form.cardMonth.options[form.cardMonth.selectedIndex].value;
if(!(new CardType()).isExpiryDate(_135,tmpmonth)){
alert("This card has already expired.");
return false;
}
card=form.cardType.options[form.cardType.selectedIndex].value;
var _136=eval(card+".checkCardNumber(\""+form.cardNumber.value+"\", "+_135+", "+tmpmonth+");");
cardname="";
if(_136){
}else{
for(var n=0;n<Cards.size;n++){
if(Cards[n].checkCardNumber(form.cardNumber.value,_135,tmpmonth)){
cardname=Cards[n].getCardType();
break;
}
}
if(cardname.length>0){
alert("This is not a "+card+" number.");
}else{
alert("This card number is not valid.");
}
}
return _136;
}
function CardType(){
var n;
var argv=CardType.arguments;
var argc=CardType.arguments.length;
this.objname="object CardType";
var _13b=(argc>0)?argv[0]:"CardObject";
var _13c=(argc>1)?argv[1]:"0,1,2,3,4,5,6,7,8,9";
var _13d=(argc>2)?argv[2]:"13,14,15,16,19";
this.setCardNumber=setCardNumber;
this.setCardType=setCardType;
this.setLen=setLen;
this.setRules=setRules;
this.setExpiryDate=setExpiryDate;
this.setCardType(_13b);
this.setLen(_13d);
this.setRules(_13c);
if(argc>4){
this.setExpiryDate(argv[3],argv[4]);
}
this.checkCardNumber=checkCardNumber;
this.getExpiryDate=getExpiryDate;
this.getCardType=getCardType;
this.isCardNumber=isCardNumber;
this.isExpiryDate=isExpiryDate;
this.luhnCheck=luhnCheck;
return this;
}
function checkCardNumber(){
var argv=checkCardNumber.arguments;
var argc=checkCardNumber.arguments.length;
var _140=(argc>0)?argv[0]:this.cardnumber;
var year=(argc>1)?argv[1]:this.year;
var _142=(argc>2)?argv[2]:this.month;
this.setCardNumber(_140);
this.setExpiryDate(year,_142);
if(!this.isCardNumber()){
return false;
}
if(!this.isExpiryDate()){
return false;
}
return true;
}
function getCardType(){
return this.cardtype;
}
function getExpiryDate(){
return this.month+"/"+this.year;
}
function isCardNumber(){
var argv=isCardNumber.arguments;
var argc=isCardNumber.arguments.length;
var _145=(argc>0)?argv[0]:this.cardnumber;
if(!this.luhnCheck()){
return false;
}
for(var n=0;n<this.len.size;n++){
if(_145.toString().length==this.len[n]){
for(var m=0;m<this.rules.size;m++){
var _148=_145.substring(0,this.rules[m].toString().length);
if(_148==this.rules[m]){
return true;
}
}
return false;
}
}
return false;
}
function isExpiryDate(){
var argv=isExpiryDate.arguments;
var argc=isExpiryDate.arguments.length;
year=argc>0?argv[0]:this.year;
month=argc>1?argv[1]:this.month;
if(!isNum(year+"")){
return false;
}
if(!isNum(month+"")){
return false;
}
today=new Date();
expiry=new Date(year,month);
if(today.getTime()>expiry.getTime()){
return false;
}else{
return true;
}
}
function isNum(_14b){
_14b=_14b.toString();
if(_14b.length==0){
return false;
}
for(var n=0;n<_14b.length;n++){
if(_14b.substring(n,n+1)<"0"||_14b.substring(n,n+1)>"9"){
return false;
}
}
return true;
}
function luhnCheck(){
var argv=luhnCheck.arguments;
var argc=luhnCheck.arguments.length;
var _14f=argc>0?argv[0]:this.cardnumber;
if(!isNum(_14f)){
return false;
}
var _150=_14f.length;
var _151=_150&1;
var sum=0;
for(var _153=0;_153<_150;_153++){
var _154=parseInt(_14f.charAt(_153));
if(!((_153&1)^_151)){
_154*=2;
if(_154>9){
_154-=9;
}
}
sum+=_154;
}
if(sum%10==0){
return true;
}else{
return false;
}
}
function makeArray(size){
this.size=size;
return this;
}
function setCardNumber(_156){
this.cardnumber=_156;
return this;
}
function setCardType(_157){
this.cardtype=_157;
return this;
}
function setExpiryDate(year,_159){
this.year=year;
this.month=_159;
return this;
}
function setLen(len){
if(len.length==0||len==null){
len="13,14,15,16,19";
}
var _15b=len;
n=1;
while(_15b.indexOf(",")!=-1){
_15b=_15b.substring(_15b.indexOf(",")+1,_15b.length);
n++;
}
this.len=new makeArray(n);
n=0;
while(len.indexOf(",")!=-1){
var _15c=len.substring(0,len.indexOf(","));
this.len[n]=_15c;
len=len.substring(len.indexOf(",")+1,len.length);
n++;
}
this.len[n]=len;
return this;
}
function setRules(_15d){
if(_15d.length==0||_15d==null){
_15d="0,1,2,3,4,5,6,7,8,9";
}
var _15e=_15d;
n=1;
while(_15e.indexOf(",")!=-1){
_15e=_15e.substring(_15e.indexOf(",")+1,_15e.length);
n++;
}
this.rules=new makeArray(n);
n=0;
while(_15d.indexOf(",")!=-1){
var _15f=_15d.substring(0,_15d.indexOf(","));
this.rules[n]=_15f;
_15d=_15d.substring(_15d.indexOf(",")+1,_15d.length);
n++;
}
this.rules[n]=_15d;
return this;
}

var ajax=new sack();
var check=/[0-9]/;
var remail=/^([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+\.+[a-zA-Z0-9-]+|[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+\.+[a-zA-Z0-9-]+\.+[a-zA-Z0-9-]+)$/;
function checkIfIsNo(_1){
if(check.test(_1.charAt(0))){
return true;
}else{
return false;
}
}
function checkEmail(_2){
if(remail.test(_2)){
return false;
}else{
return true;
}
}
function login_form_submit(_3){
if(_3.txt_username.value==""){
alert("Enter Username");
_3.txt_username.focus();
return false;
}else{
if(_3.txt_password.value==""){
alert("Enter Password");
_3.txt_password.focus();
return false;
}else{
_3.submit();
}
}
}
function change_labels(_4,_5,_6,_7){
var _8=document.getElementById("label_field");
var _9=document.getElementById("label2_field");
if(document.all&&_5=="sub_broker"){
document.all.myCell.bgColor="#6E706E";
}else{
document.all.myCell.bgColor="#515151";
}
_8.innerHTML=_4;
_6.action_type.value=_7;
}
function forgot_submit(){
document.forms.login_form.action="forgot_password.php";
document.forms.login_form.submit();
}
function MM_findObj(n,d){
var p,i,x;
if(!d){
d=document;
}
if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n])&&d.all){
x=d.all[n];
}
for(i=0;!x&&i<d.forms.length;i++){
x=d.forms[i][n];
}
for(i=0;!x&&d.layers&&i<d.layers.length;i++){
x=MM_findObj(n,d.layers[i].document);
}
if(!x&&d.getElementById){
x=d.getElementById(n);
}
return x;
}
function MM_showHideLayers(){
if(document.layers){
window.captureEvents(Event.MOUSEMOVE);
}
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i<(args.length-2);i+=3){
if((obj=MM_findObj(args[i]))!=null){
v=args[i+2];
if(obj.style){
obj=obj.style;
v=(v=="show")?"visible":(v="hide")?"hidden":v;
}
obj.visibility=v;
}
}
}
function PopupWin(_e,_f,w,h){
var _12=(screen.width-w)/2;
var _13=0;
winprops="height="+h+",width="+w+",top="+_13+",left="+_12+"resizable=1,scrollbars=1,resizable=1";
window.open(_e,_f,winprops);
}
function MM_preloadImages(){
var d=document;
if(d.images){
if(!d.MM_p){
d.MM_p=new Array();
}
var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0;i<a.length;i++){
if(a[i].indexOf("#")!=0){
d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];
}
}
}
}
function MM_swapImgRestore(){
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++){
x.src=x.oSrc;
}
}
function MM_findObj(n,d){
var p,i,x;
if(!d){
d=document;
}
if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n])&&d.all){
x=d.all[n];
}
for(i=0;!x&&i<d.forms.length;i++){
x=d.forms[i][n];
}
for(i=0;!x&&d.layers&&i<d.layers.length;i++){
x=MM_findObj(n,d.layers[i].document);
}
if(!x&&d.getElementById){
x=d.getElementById(n);
}
return x;
}
function MM_swapImage(){
var i,j=0,x,a=MM_swapImage.arguments;
document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3){
if((x=MM_findObj(a[i]))!=null){
document.MM_sr[j++]=x;
if(!x.oSrc){
x.oSrc=x.src;
}
x.src=a[i+2];
}
}
}

var dhtmlwindow={imagefiles:["images/min.gif","images/close.gif","images/restore.gif","images/resize.gif"],ajaxbustcache:true,minimizeorder:0,tobjects:[],init:function(t){
var _2=document.createElement("div");
_2.id=t;
_2.className="dhtmlwindow";
var _3="";
_3="<div class=\"drag-handle\">";
_3+="DHTML Window <div class=\"drag-controls\"><img src=\""+this.imagefiles[0]+"\" title=\"Minimize\" /><img src=\""+this.imagefiles[1]+"\" title=\"Close\" /></div>";
_3+="</div>";
_3+="<div class=\"drag-contentarea\"></div>";
_3+="<div class=\"drag-statusarea\"><div class=\"drag-resizearea\" style=\"background: transparent url("+this.imagefiles[3]+") top right no-repeat;\">&nbsp;</div></div>";
_3+="</div>";
_2.innerHTML=_3;
document.getElementById("dhtmlwindowholder").appendChild(_2);
this.zIndexvalue=(this.zIndexvalue)?this.zIndexvalue+1:100;
var t=document.getElementById(t);
var _5=t.getElementsByTagName("div");
for(var i=0;i<_5.length;i++){
if(/drag-/.test(_5[i].className)){
t[_5[i].className.replace(/drag-/,"")]=_5[i];
}
}
t.style.zIndex=this.zIndexvalue;
t.handle._parent=t;
t.resizearea._parent=t;
t.controls._parent=t;
t.onclose=function(){
return true;
};
t.onmousedown=function(){
dhtmlwindow.zIndexvalue++;
this.style.zIndex=dhtmlwindow.zIndexvalue;
};
t.handle.onmousedown=dhtmlwindow.setupdrag;
t.resizearea.onmousedown=dhtmlwindow.setupdrag;
t.controls.onclick=dhtmlwindow.enablecontrols;
t.show=function(){
dhtmlwindow.show(this);
};
t.hide=function(){
dhtmlwindow.close(this);
};
t.setSize=function(w,h){
dhtmlwindow.setSize(this,w,h);
};
t.moveTo=function(x,y){
dhtmlwindow.moveTo(this,x,y);
};
t.isResize=function(_b){
dhtmlwindow.isResize(this,_b);
};
t.isScrolling=function(_c){
dhtmlwindow.isScrolling(this,_c);
};
t.load=function(_d,_e,_f){
dhtmlwindow.load(this,_d,_e,_f);
};
this.tobjects[this.tobjects.length]=t;
return t;
},open:function(t,_11,_12,_13,_14,_15){
var d=dhtmlwindow;
function getValue(_17){
var _18=new RegExp(_17+"=([^,]+)","i");
return (_18.test(_14))?parseInt(RegExp.$1):0;
}
if(document.getElementById(t)==null){
t=this.init(t);
}else{
t=document.getElementById(t);
}
t.setSize(getValue(("width")),(getValue("height")));
var _19=getValue("center")?"middle":getValue("left");
var _1a=getValue("center")?"middle":getValue("top");
if(typeof _15!="undefined"&&_15=="recal"&&this.scroll_top==0){
if(window.attachEvent&&!window.opera){
this.addEvent(window,function(){
setTimeout(function(){
t.moveTo(_19,_1a);
},400);
},"load");
}else{
this.addEvent(window,function(){
t.moveTo(_19,_1a);
},"load");
}
}
t.isResize(getValue("resize"));
t.isScrolling(getValue("scrolling"));
t.style.visibility="visible";
t.style.display="block";
t.contentarea.style.display="block";
t.moveTo(_19,_1a);
t.load(_11,_12,_13);
if(t.state=="minimized"&&t.controls.firstChild.title=="Restore"){
t.controls.firstChild.setAttribute("src",dhtmlwindow.imagefiles[0]);
t.controls.firstChild.setAttribute("title","Minimize");
t.state="fullview";
}
return t;
},setSize:function(t,w,h){
t.style.width=Math.max(parseInt(w),150)+"px";
t.contentarea.style.height=Math.max(parseInt(h),100)+"px";
},moveTo:function(t,x,y){
this.getviewpoint();
t.style.left=(x=="middle")?this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px":this.scroll_left+parseInt(x)+"px";
t.style.top=(y=="middle")?this.scroll_top+(this.docheight-t.offsetHeight)/2+"px":this.scroll_top+parseInt(y)+"px";
},isResize:function(t,bol){
t.statusarea.style.display=(bol)?"block":"none";
t.resizeBool=(bol)?1:0;
},isScrolling:function(t,bol){
t.contentarea.style.overflow=(bol)?"auto":"hidden";
},load:function(t,_26,_27,_28){
var _29=_29.toLowerCase();
if(typeof _28!="undefined"){
t.handle.firstChild.nodeValue=_28;
}
if(_29=="inline"){
t.contentarea.innerHTML=_27;
}else{
if(_29=="div"){
t.contentarea.innerHTML=document.getElementById(_27).innerHTML;
document.getElementById(_27).style.display="none";
}else{
if(_29=="iframe"){
t.contentarea.style.overflow="hidden";
if(!t.contentarea.firstChild||t.contentarea.firstChild.tagName!="IFRAME"){
t.contentarea.innerHTML="<iframe src=\"\" style=\"margin:0; padding:0; width:100%; height: 100%\" name=\"_iframe-"+t.id+"\"></iframe>";
}
window.frames["_iframe-"+t.id].location.replace(_27);
}else{
if(_29=="ajax"){
this.ajax_connect(_27,t);
}
}
}
}
t.contentarea.datatype=_29;
},setupdrag:function(e){
var d=dhtmlwindow;
var t=this._parent;
d.etarget=this;
var e=window.event||e;
d.initmousex=e.clientX;
d.initmousey=e.clientY;
d.initx=parseInt(t.offsetLeft);
d.inity=parseInt(t.offsetTop);
d.width=parseInt(t.offsetWidth);
d.contentheight=parseInt(t.contentarea.offsetHeight);
if(t.contentarea.datatype=="iframe"){
t.style.backgroundColor="#F8F8F8";
t.contentarea.style.visibility="hidden";
}
document.onmousemove=d.getdistance;
document.onmouseup=function(){
if(t.contentarea.datatype=="iframe"){
t.contentarea.style.backgroundColor="white";
t.contentarea.style.visibility="visible";
}
d.stop();
};
return false;
},getdistance:function(e){
var d=dhtmlwindow;
var _30=d.etarget;
var e=window.event||e;
d.distancex=e.clientX-d.initmousex;
d.distancey=e.clientY-d.initmousey;
if(_30.className=="drag-handle"){
d.move(_30._parent,e);
}else{
if(_30.className=="drag-resizearea"){
d.resize(_30._parent,e);
}
}
return false;
},getviewpoint:function(){
var ie=document.all&&!window.opera;
var _33=document.documentElement&&parseInt(document.documentElement.clientWidth)||100000;
this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;
this.scroll_top=(ie)?this.standardbody.scrollTop:window.pageYOffset;
this.scroll_left=(ie)?this.standardbody.scrollLeft:window.pageXOffset;
this.docwidth=(ie)?this.standardbody.clientWidth:(/Safari/i.test(navigator.userAgent))?window.innerWidth:Math.min(_33,window.innerWidth-16);
this.docheight=(ie)?this.standardbody.clientHeight:window.innerHeight;
},rememberattrs:function(t){
this.getviewpoint();
t.lastx=parseInt((t.style.left||t.offsetLeft))-dhtmlwindow.scroll_left;
t.lasty=parseInt((t.style.top||t.offsetTop))-dhtmlwindow.scroll_top;
t.lastwidth=parseInt(t.style.width);
},move:function(t,e){
t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px";
t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px";
},resize:function(t,e){
t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex,150)+"px";
t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey,100)+"px";
},enablecontrols:function(e){
var d=dhtmlwindow;
var _3b=window.event?window.event.srcElement:e.target;
if(/Minimize/i.test(_3b.getAttribute("title"))){
d.minimize(_3b,this._parent);
}else{
if(/Restore/i.test(_3b.getAttribute("title"))){
d.restore(_3b,this._parent);
}else{
if(/Close/i.test(_3b.getAttribute("title"))){
d.close(this._parent);
}
}
}
return false;
},minimize:function(_3c,t){
dhtmlwindow.rememberattrs(t);
_3c.setAttribute("src",dhtmlwindow.imagefiles[2]);
_3c.setAttribute("title","Restore");
t.state="minimized";
t.contentarea.style.display="none";
t.statusarea.style.display="none";
if(typeof t.minimizeorder=="undefined"){
dhtmlwindow.minimizeorder++;
t.minimizeorder=dhtmlwindow.minimizeorder;
}
t.style.left="10px";
t.style.width="200px";
var _3e=t.minimizeorder*10;
t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-_3e+"px";
},restore:function(_3f,t){
dhtmlwindow.getviewpoint();
_3f.setAttribute("src",dhtmlwindow.imagefiles[0]);
_3f.setAttribute("title","Minimize");
t.state="fullview";
t.style.display="block";
t.contentarea.style.display="block";
if(t.resizeBool){
t.statusarea.style.display="block";
}
t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px";
t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px";
t.style.width=parseInt(t.lastwidth)+"px";
},close:function(t){
try{
var _42=t.onclose();
}
catch(err){
var _43=true;
}
finally{
if(typeof _43=="undefined"){
alert("An error has occured somwhere inside your \"onclose\" event handler");
var _44=true;
}
}
if(_44){
if(t.state!="minimized"){
dhtmlwindow.rememberattrs(t);
}
t.style.display="none";
}
return _44;
},show:function(t){
if(t.lastx){
dhtmlwindow.restore(t.controls.firstChild,t);
}else{
t.style.display="block";
}
t.state="fullview";
},ajax_connect:function(url,t){
var _48=false;
var _49="";
if(window.XMLHttpRequest){
_48=new XMLHttpRequest();
}else{
if(window.ActiveXObject){
try{
_48=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_48=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
}
}
}else{
return false;
}
}
_48.onreadystatechange=function(){
dhtmlwindow.ajax_loadpage(_48,t);
};
if(this.ajaxbustcache){
_49=(url.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime();
}
_48.open("GET",url+_49,true);
_48.send(null);
},ajax_loadpage:function(_4a,t){
if(_4a.readyState==4&&(_4a.status==200||window.location.href.indexOf("http")==-1)){
t.contentarea.innerHTML=_4a.responseText;
}
},stop:function(){
dhtmlwindow.etarget=null;
document.onmousemove=null;
document.onmouseup=null;
},addEvent:function(_4c,_4d,_4e){
var _4f=(window.addEventListener)?_4f:"on"+_4f;
if(_4c.addEventListener){
_4c.addEventListener(_4f,_4d,false);
}else{
if(_4c.attachEvent){
_4c.attachEvent(_4f,_4d);
}
}
},cleanup:function(){
for(var i=0;i<dhtmlwindow.tobjects.length;i++){
dhtmlwindow.tobjects[i].handle._parent=dhtmlwindow.tobjects[i].resizearea._parent=dhtmlwindow.tobjects[i].controls._parent=null;
}
window.onload=null;
}};
document.write("<div id=\"dhtmlwindowholder\"><span style=\"display:none\">.</span></div>");
window.onunload=dhtmlwindow.cleanup;

function swap_divs(_1){
if(_1=="open"){
document.getElementById("forth_ipo").style.display="none";
document.getElementById("ipo_close").style.display="none";
document.getElementById("ipo_over").style.display="none";
document.getElementById("open").src="images/ipos_open_ov.gif";
document.getElementById("close").src="images/ipos_closed.gif";
document.getElementById("forth").src="images/forth_coming_ipo_btn.gif";
document.getElementById("over").src="images/over_subs_btn.gif";
document.getElementById("img_a").src="images/img_0011.gif";
document.getElementById("img_b").src="images/img_0013.gif";
document.getElementById("img_c").src="images/img_0013.gif";
document.getElementById("ipo_open").style.display="block";
}else{
if(_1=="close"){
document.getElementById("ipo_open").style.display="none";
document.getElementById("forth_ipo").style.display="none";
document.getElementById("ipo_over").style.display="none";
document.getElementById("open").src="images/ipos_open.gif";
document.getElementById("close").src="images/ipos_closed_ov.gif";
document.getElementById("forth").src="images/forth_coming_ipo_btn.gif";
document.getElementById("over").src="images/over_subs_btn.gif";
document.getElementById("img_a").src="images/img_0012.gif";
document.getElementById("img_b").src="images/img_0011.gif";
document.getElementById("img_c").src="images/img_0013.gif";
document.getElementById("ipo_close").style.display="block";
}else{
if(_1=="forth"){
document.getElementById("ipo_open").style.display="none";
document.getElementById("ipo_close").style.display="none";
document.getElementById("ipo_over").style.display="none";
document.getElementById("open").src="images/ipos_open.gif";
document.getElementById("close").src="images/ipos_closed.gif";
document.getElementById("forth").src="images/forth_coming_ipo_btn_ov.gif";
document.getElementById("over").src="images/over_subs_btn.gif";
document.getElementById("img_a").src="images/img_0013.gif";
document.getElementById("img_b").src="images/img_0012.gif";
document.getElementById("img_c").src="images/img_0011.gif";
document.getElementById("forth_ipo").style.display="block";
}else{
if(_1=="over"){
document.getElementById("ipo_open").style.display="none";
document.getElementById("ipo_close").style.display="none";
document.getElementById("forth_ipo").style.display="none";
document.getElementById("open").src="images/ipos_open.gif";
document.getElementById("close").src="images/ipos_closed.gif";
document.getElementById("forth").src="images/forth_coming_ipo_btn.gif";
document.getElementById("over").src="images/over_subs_btn_ov.gif";
document.getElementById("img_a").src="images/img_0013.gif";
document.getElementById("img_b").src="images/img_0013.gif";
document.getElementById("img_c").src="images/img_0012.gif";
document.getElementById("ipo_over").style.display="block";
}
}
}
}
}
function submitform(_2,_3){
if(_2.txt_application_number.value==""&&_3){
alert("Enter Application Number");
_2.txt_application_number.focus();
}else{
if(!_3){
_2.action_type.value="";
_2.sel_ipo.value="";
_2.txt_application_number.value="";
}
}
}
function send_request(){
formObj=document.app_form;
var _4=document.getElementById("sel_ipo").value;
if(document.getElementById("txt_application_no").value!=""){
app_no=document.getElementById("txt_application_no").value;
}else{
alert("Enter Application Number");
formObj.txt_application_number.focus();
return false;
}
document.getElementById("loading_response").style.display="block";
ajax.requestFile="trs_result_ajax.php?sel_ipo="+_4+"&txt_application_number="+app_no+"&action_type=show_results";
ajax.onCompletion=get_response;
ajax.runAJAX();
}
function get_response(){
document.getElementById("loading_response").style.display="none";
if(ajax.response!=""){
Effect.Appear("div_response");
document.getElementById("div_response").innerHTML=ajax.response;
}
}
function clear_res(){
Effect.BlindUp("div_response");
}
function search_trs_show_hide(){
if(document.getElementById("search_trs").style.display=="block"){
document.getElementById("search_trs").style.display="none";
}else{
document.getElementById("search_trs").style.display="block";
}
}
function trs_ipo(_5,a){
if(_5!=""){
	if(a!="")
	{
		document.getElementById("sel_ipo").value=a+" - "+_5;
	}
	else
	{
			document.getElementById("sel_ipo").value=_5;
	}
	
}else{
	alert("Please Select IPO");
}
}
function sh_div(_6){
document.getElementById("ipo_reco_"+_6).style.display="block";
document.getElementById("ipo_recommendation_"+_6).innerHTML="<img src='images/working.gif'>";
document.getElementById("txt_ipo_det").value=_6;
ajax.requestFile="view_recommendation.php?id="+_6;
ajax.onCompletion=get_ipo_detail;
ajax.runAJAX();
}
function get_ipo_detail(){
val=document.getElementById("txt_ipo_det").value;
document.getElementById("ipo_recommendation_"+val).innerHTML=ajax.response;
document.getElementById("txt_ipo_det").value="";
}
function hd_div(_7){
document.getElementById("ipo_reco_"+_7).style.display="none";
}
function float_ipo_hide(_8){
Effect.Fade("float_ipo_det_"+_8);
}

