/* jQuery.js */
/*
 * jQuery 1.2.3 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2009/01/07 20:30:40 $
 * $Rev: 4663 $
 */
(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else
selector=[];}}else
return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){if(target===options[name])continue;if(deep&&options[name]&&typeof options[name]=="object"&&target[name]&&!options[name].nodeType)target[name]=jQuery.extend(target[name],options[name]);else if(options[name]!=undefined)target[name]=options[name];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,windowData={};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.appendChild(script);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){if(args){if(object.length==undefined){for(var name in object)if(callback.apply(object[name],args)===false)break;}else
for(var i=0,length=object.length;i<length;i++)if(callback.apply(object[i],args)===false)break;}else{if(object.length==undefined){for(var name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var i=0,length=object.length,value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(getComputedStyle&&getComputedStyle.getPropertyValue(name))||"";for(var i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left,runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem=elem.toString();if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i<length;i++)ret.push(array[i]);else
ret=array.slice(0);return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]==elem)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv&&callback(elems[i],i)||inv&&!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!==null&&value!=undefined){if(value.constructor!=Array)value=[value];ret=ret.concat(value);}}return ret;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength",selectedIndex:"selectedIndex",defaultValue:"defaultValue",tagName:"tagName",nodeName:"nodeName"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=(new Date()).getTime();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})();/* mootools.js */
//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, <http://mad4milk.net>, MIT Style License.

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('o 95={8Z:\'1.11\'};k $4Y(Q){h(Q!=6W)};k $B(Q){m(!$4Y(Q))h 14;m(Q.3d)h\'1b\';o B=4D Q;m(B==\'2h\'&&Q.90){1L(Q.5r){P 1:h\'1b\';P 3:h(/\\S/).28(Q.7r)?\'91\':\'93\'}}m(B==\'2h\'||B==\'k\'){1L(Q.6T){P 1U:h\'1g\';P 5Q:h\'3P\';P 1i:h\'58\'}m(4D Q.O==\'43\'){m(Q.2n)h\'9c\';m(Q.70)h\'15\'}}h B};k $2p(){o 3B={};J(o i=0;i<15.O;i++){J(o F 1j 15[i]){o ap=15[i][F];o 54=3B[F];m(54&&$B(ap)==\'2h\'&&$B(54)==\'2h\')3B[F]=$2p(54,ap);17 3B[F]=ap}}h 3B};o $N=k(){o 18=15;m(!18[1])18=[c,18[0]];J(o F 1j 18[1])18[0][F]=18[1][F];h 18[0]};o $3p=k(){J(o i=0,l=15.O;i<l;i++){15[i].N=k(1s){J(o 1y 1j 1s){m(!c.1p[1y])c.1p[1y]=1s[1y];m(!c[1y])c[1y]=$3p.4S(1y)}}}};$3p.4S=k(1y){h k(U){h c.1p[1y].3q(U,1U.1p.74.1R(15,1))}};$3p(5w,1U,4q,71);k $3U(Q){h!!(Q||Q===0)};k $3y(Q,6X){h $4Y(Q)?Q:6X};k $5F(2X,2J){h 1e.8y(1e.5F()*(2J-2X+1)+2X)};k $2x(){h Y 8l().8k()};k $6n(1W){8R(1W);8Q(1W);h 1d};o 2E=k(Q){Q=Q||{};Q.N=$N;h Q};o 8S=Y 2E(L);o 8T=Y 2E(M);M.6Y=M.2c(\'6Y\')[0];L.2O=!!(M.5a);m(L.88)L.1V=L[L.4O?\'8P\':\'6V\']=1h;17 m(M.77&&!M.8O&&!8J.8I)L.2Y=L[L.2O?\'8K\':\'57\']=1h;17 m(M.8N!=1d)L.68=1h;L.9e=L.2Y;5x.N=$N;m(4D 3K==\'6W\'){o 3K=k(){};m(L.2Y)M.6S("a2");3K.1p=(L.2Y)?L["[[a9.1p]]"]:{}}3K.1p.3d=k(){};m(L.6V)3b{M.ac("ag",14,1h)}3m(e){};o 1i=k(2k){o 3E=k(){h(15[0]!==1d&&c.1F&&$B(c.1F)==\'k\')?c.1F.3q(c,15):c};$N(3E,c);3E.1p=2k;3E.6T=1i;h 3E};1i.1M=k(){};1i.1p={N:k(2k){o 52=Y c(1d);J(o F 1j 2k){o 6U=52[F];52[F]=1i.6Z(6U,2k[F])}h Y 1i(52)},5I:k(){J(o i=0,l=15.O;i<l;i++)$N(c.1p,15[i])}};1i.6Z=k(2P,1B){m(2P&&2P!=1B){o B=$B(1B);m(B!=$B(2P))h 1B;1L(B){P\'k\':o 5o=k(){c.1J=15.70.1J;h 1B.3q(c,15)};5o.1J=2P;h 5o;P\'2h\':h $2p(2P,1B)}}h 1B};o 6k=Y 1i({9H:k(K){c.36=c.36||[];c.36.1a(K);h c},6r:k(){m(c.36&&c.36.O)c.36.7e().1O(10,c)},9J:k(){c.36=[]}});o 2e=Y 1i({2G:k(B,K){m(K!=1i.1M){c.$V=c.$V||{};c.$V[B]=c.$V[B]||[];c.$V[B].5E(K)}h c},1N:k(B,18,1O){m(c.$V&&c.$V[B]){c.$V[B].1A(k(K){K.2b({\'U\':c,\'1O\':1O,\'15\':18})()},c)}h c},5p:k(B,K){m(c.$V&&c.$V[B])c.$V[B].2W(K);h c}});o 6j=Y 1i({4M:k(){c.C=$2p.3q(1d,[c.C].N(15));m(c.2G){J(o 2C 1j c.C){m($B(c.C[2C]==\'k\')&&(/^6b[A-Z]/).28(2C))c.2G(2C,c.C[2C])}}h c}});1U.N({4L:k(K,U){J(o i=0,j=c.O;i<j;i++)K.1R(U,c[i],i,c)},2t:k(K,U){o 3e=[];J(o i=0,j=c.O;i<j;i++){m(K.1R(U,c[i],i,c))3e.1a(c[i])}h 3e},25:k(K,U){o 3e=[];J(o i=0,j=c.O;i<j;i++)3e[i]=K.1R(U,c[i],i,c);h 3e},4U:k(K,U){J(o i=0,j=c.O;i<j;i++){m(!K.1R(U,c[i],i,c))h 14}h 1h},9L:k(K,U){J(o i=0,j=c.O;i<j;i++){m(K.1R(U,c[i],i,c))h 1h}h 14},3h:k(2n,T){o 3a=c.O;J(o i=(T<0)?1e.2J(0,3a+T):T||0;i<3a;i++){m(c[i]===2n)h i}h-1},75:k(1H,O){1H=1H||0;m(1H<0)1H=c.O+1H;O=O||(c.O-1H);o 5y=[];J(o i=0;i<O;i++)5y[i]=c[1H++];h 5y},2W:k(2n){o i=0;o 3a=c.O;4C(i<3a){m(c[i]===2n){c.4i(i,1);3a--}17{i++}}h c},19:k(2n,T){h c.3h(2n,T)!=-1},9K:k(1z){o Q={},O=1e.2X(c.O,1z.O);J(o i=0;i<O;i++)Q[1z[i]]=c[i];h Q},N:k(1g){J(o i=0,j=1g.O;i<j;i++)c.1a(1g[i]);h c},2p:k(1g){J(o i=0,l=1g.O;i<l;i++)c.5E(1g[i]);h c},5E:k(2n){m(!c.19(2n))c.1a(2n);h c},9I:k(){h c[$5F(0,c.O-1)]||1d},76:k(){h c[c.O-1]||1d}});1U.1p.1A=1U.1p.4L;1U.1A=1U.4L;k $A(1g){h 1U.75(1g)};k $1A(2N,K,U){m(2N&&4D 2N.O==\'43\'&&$B(2N)!=\'2h\'){1U.4L(2N,K,U)}17{J(o 1m 1j 2N)K.1R(U||2N,2N[1m],1m)}};1U.1p.28=1U.1p.19;4q.N({28:k(4R,1Z){h(($B(4R)==\'1G\')?Y 5Q(4R,1Z):4R).28(c)},4P:k(){h 3I(c,10)},72:k(){h 3V(c)},5L:k(){h c.2A(/-\\D/g,k(2d){h 2d.5b(1).6t()})},6L:k(){h c.2A(/\\w[A-Z]/g,k(2d){h(2d.5b(0)+\'-\'+2d.5b(1).3Z())})},6C:k(){h c.2A(/\\b[a-z]/g,k(2d){h 2d.6t()})},5N:k(){h c.2A(/^\\s+|\\s+$/g,\'\')},5R:k(){h c.2A(/\\s{2,}/g,\' \').5N()},51:k(1g){o 22=c.2d(/\\d{1,3}/g);h(22)?22.51(1g):14},4p:k(1g){o 30=c.2d(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);h(30)?30.74(1).4p(1g):14},19:k(1G,s){h(s)?(s+c+s).3h(s+1G+s)>-1:c.3h(1G)>-1},8p:k(){h c.2A(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});1U.N({51:k(1g){m(c.O<3)h 14;m(c.O==4&&c[3]==0&&!1g)h\'9P\';o 30=[];J(o i=0;i<3;i++){o 3g=(c[i]-0).3A(16);30.1a((3g.O==1)?\'0\'+3g:3g)}h 1g?30:\'#\'+30.1w(\'\')},4p:k(1g){m(c.O!=3)h 14;o 22=[];J(o i=0;i<3;i++){22.1a(3I((c[i].O==1)?c[i]+c[i]:c[i],16))}h 1g?22:\'22(\'+22.1w(\',\')+\')\'}});5w.N({2b:k(C){o K=c;C=$2p({\'U\':K,\'H\':14,\'15\':1d,\'1O\':14,\'2T\':14,\'4F\':14},C);m($3U(C.15)&&$B(C.15)!=\'1g\')C.15=[C.15];h k(H){o 18;m(C.H){H=H||L.H;18=[(C.H===1h)?H:Y C.H(H)];m(C.15)18.N(C.15)}17 18=C.15||15;o 2y=k(){h K.3q($3y(C.U,K),18)};m(C.1O)h 7O(2y,C.1O);m(C.2T)h 9Q(2y,C.2T);m(C.4F)3b{h 2y()}3m(9G){h 14};h 2y()}},9F:k(18,U){h c.2b({\'15\':18,\'U\':U})},4F:k(18,U){h c.2b({\'15\':18,\'U\':U,\'4F\':1h})()},U:k(U,18){h c.2b({\'U\':U,\'15\':18})},9x:k(U,18){h c.2b({\'U\':U,\'H\':1h,\'15\':18})},1O:k(1O,U,18){h c.2b({\'1O\':1O,\'U\':U,\'15\':18})()},2T:k(73,U,18){h c.2b({\'2T\':73,\'U\':U,\'15\':18})()}});71.N({4P:k(){h 3I(c)},72:k(){h 3V(c)},9s:k(2X,2J){h 1e.2X(2J,1e.2J(2X,c))},3j:k(3W){3W=1e.2U(10,3W||0);h 1e.3j(c*3W)/3W},9z:k(K){J(o i=0;i<c;i++)K(i)}});o I=Y 1i({1F:k(q,1s){m($B(q)==\'1G\'){m(L.1V&&1s&&(1s.1m||1s.B)){o 1m=(1s.1m)?\' 1m="\'+1s.1m+\'"\':\'\';o B=(1s.B)?\' B="\'+1s.B+\'"\':\'\';5D 1s.1m;5D 1s.B;q=\'<\'+q+1m+B+\'>\'}q=M.6S(q)}q=$(q);h(!1s||!q)?q:q.2s(1s)}});o 1C=Y 1i({1F:k(R){h(R)?$N(R,c):c}});1C.N=k(1s){J(o 1y 1j 1s){c.1p[1y]=1s[1y];c[1y]=$3p.4S(1y)}};k $(q){m(!q)h 1d;m(q.3d)h 1Q.3r(q);m([L,M].19(q))h q;o B=$B(q);m(B==\'1G\'){q=M.4y(q);B=(q)?\'1b\':14}m(B!=\'1b\')h 1d;m(q.3d)h 1Q.3r(q);m([\'2h\',\'9E\'].19(q.4G.3Z()))h q;$N(q,I.1p);q.3d=k(){};h 1Q.3r(q)};M.4X=M.2c;k $$(){o R=[];J(o i=0,j=15.O;i<j;i++){o 1q=15[i];1L($B(1q)){P\'1b\':R.1a(1q);P\'9D\':1r;P 14:1r;P\'1G\':1q=M.4X(1q,1h);6p:R.N(1q)}}h $$.3F(R)};$$.3F=k(1g){o R=[];J(o i=0,l=1g.O;i<l;i++){m(1g[i].$4N)78;o 1b=$(1g[i]);m(1b&&!1b.$4N){1b.$4N=1h;R.1a(1b)}}J(o n=0,d=R.O;n<d;n++)R[n].$4N=1d;h Y 1C(R)};1C.4o=k(F){h k(){o 18=15;o 1f=[];o R=1h;J(o i=0,j=c.O,2y;i<j;i++){2y=c[i][F].3q(c[i],18);m($B(2y)!=\'1b\')R=14;1f.1a(2y)};h(R)?$$.3F(1f):1f}};I.N=k(2k){J(o F 1j 2k){3K.1p[F]=2k[F];I.1p[F]=2k[F];I[F]=$3p.4S(F);o 6R=(1U.1p[F])?F+\'1C\':F;1C.1p[6R]=1C.4o(F)}};I.N({2s:k(1s){J(o 1y 1j 1s){o 33=1s[1y];1L(1y){P\'af\':c.6K(33);1r;P\'V\':m(c.5g)c.5g(33);1r;P\'2k\':c.7s(33);1r;6p:c.4Z(1y,33)}}h c},3n:k(q,6H){q=$(q);1L(6H){P\'6I\':q.2m.6u(c,q);1r;P\'6G\':o 3v=q.6M();m(!3v)q.2m.69(c);17 q.2m.6u(c,3v);1r;P\'2w\':o 6o=q.62;m(6o){q.6u(c,6o);1r}6p:q.69(c)}h c},ai:k(q){h c.3n(q,\'6I\')},am:k(q){h c.3n(q,\'6G\')},aj:k(q){h c.3n(q,\'5v\')},ak:k(q){h c.3n(q,\'2w\')},aa:k(){o R=[];$1A(15,k(6F){R=R.61(6F)});$$(R).3n(c);h c},2W:k(){h c.2m.7q(c)},a1:k(6D){o q=$(c.9Z(6D!==14));m(!q.$V)h q;q.$V={};J(o B 1j c.$V)q.$V[B]={\'1z\':$A(c.$V[B].1z),\'29\':$A(c.$V[B].29)};h q.4g()},9W:k(q){q=$(q);c.2m.9X(q,c);h q},7p:k(1t){c.69(M.a3(1t));h c},5S:k(1n){h c.1n.19(1n,\' \')},6J:k(1n){m(!c.5S(1n))c.1n=(c.1n+\' \'+1n).5R();h c},6E:k(1n){c.1n=c.1n.2A(Y 5Q(\'(^|\\\\s)\'+1n+\'(?:\\\\s|$)\'),\'$1\').5R();h c},a7:k(1n){h c.5S(1n)?c.6E(1n):c.6J(1n)},45:k(F,G){1L(F){P\'1P\':h c.6P(3V(G));P\'ao\':F=(L.1V)?\'8M\':\'8L\'}F=F.5L();1L($B(G)){P\'43\':m(![\'8U\',\'6O\'].19(F))G+=\'41\';1r;P\'1g\':G=\'22(\'+G.1w(\',\')+\')\'}c.1k[F]=G;h c},6K:k(2i){1L($B(2i)){P\'2h\':I.4h(c,\'45\',2i);1r;P\'1G\':c.1k.5W=2i}h c},6P:k(1P){m(1P==0){m(c.1k.4J!="5q")c.1k.4J="5q"}17{m(c.1k.4J!="6Q")c.1k.4J="6Q"}m(!c.55||!c.55.8F)c.1k.6O=1;m(L.1V)c.1k.2t=(1P==1)?\'\':"8x(1P="+1P*8w+")";c.1k.1P=c.$2Q.1P=1P;h c},2H:k(F){F=F.5L();o 1l=c.1k[F];m(!$3U(1l)){m(F==\'1P\')h c.$2Q.1P;1l=[];J(o 1k 1j I.2K){m(F==1k){I.2K[1k].1A(k(s){o 1k=c.2H(s);1l.1a(3I(1k)?1k:\'7y\')},c);m(F==\'2F\'){o 4U=1l.4U(k(3g){h(3g==1l[0])});h(4U)?1l[0]:14}h 1l.1w(\' \')}}m(F.19(\'2F\')){m(I.2K.2F.19(F)){h[\'7z\',\'5V\',\'5K\'].25(k(p){h c.2H(F+p)},c).1w(\' \')}17 m(I.7d.19(F)){h[\'7v\',\'7w\',\'7m\',\'7l\'].25(k(p){h c.2H(\'2F\'+p+F.2A(\'2F\',\'\'))},c).1w(\' \')}}m(M.6N)1l=M.6N.8E(c,1d).8B(F.6L());17 m(c.55)1l=c.55[F]}m(L.1V)1l=I.7u(F,1l,c);m(1l&&F.28(/4s/i)&&1l.19(\'22\')){h 1l.4n(\'22\').4i(1,4).25(k(4s){h 4s.51()}).1w(\' \')}h 1l},8A:k(){h I.6l(c,\'2H\',15)},3L:k(4A,1H){4A+=\'9q\';o q=(1H)?c[1H]:c[4A];4C(q&&$B(q)!=\'1b\')q=q[4A];h $(q)},8X:k(){h c.3L(\'2P\')},6M:k(){h c.3L(\'3v\')},9g:k(){h c.3L(\'3v\',\'62\')},76:k(){h c.3L(\'2P\',\'9f\')},9d:k(){h $(c.2m)},9j:k(){h $$(c.77)},65:k(q){h!!$A(c.2c(\'*\')).19(q)},3z:k(F){o 2v=I.4u[F];m(2v)h c[2v];o 66=I.7b[F]||0;m(!L.1V||66)h c.9k(F,66);o 67=c.9o[F];h(67)?67.7r:1d},92:k(F){o 2v=I.4u[F];m(2v)c[2v]=\'\';17 c.8Y(F);h c},94:k(){h I.6l(c,\'3z\',15)},4Z:k(F,G){o 2v=I.4u[F];m(2v)c[2v]=G;17 c.9a(F,G);h c},7s:k(2i){h I.4h(c,\'4Z\',2i)},5f:k(){c.7o=$A(15).1w(\'\');h c},96:k(1t){o 2r=c.3t();m([\'1k\',\'21\'].19(2r)){m(L.1V){m(2r==\'1k\')c.7n.5W=1t;17 m(2r==\'21\')c.4Z(\'1t\',1t);h c}17{c.7q(c.62);h c.7p(1t)}}c[$4Y(c.5Z)?\'5Z\':\'7t\']=1t;h c},8G:k(){o 2r=c.3t();m([\'1k\',\'21\'].19(2r)){m(L.1V){m(2r==\'1k\')h c.7n.5W;17 m(2r==\'21\')h c.3z(\'1t\')}17{h c.7o}}h($3y(c.5Z,c.7t))},3t:k(){h c.4G.3Z()},1M:k(){1Q.4v(c.2c(\'*\'));h c.5f(\'\')}});I.7u=k(F,1l,1b){m($3U(3I(1l)))h 1l;m([\'5t\',\'3C\'].19(F)){o 29=(F==\'3C\')?[\'2D\',\'5B\']:[\'2w\',\'5v\'];o 3J=0;29.1A(k(G){3J+=1b.2H(\'2F-\'+G+\'-3C\').4P()+1b.2H(\'5P-\'+G).4P()});h 1b[\'bQ\'+F.6C()]-3J+\'41\'}17 m(F.28(/2F(.+)7z|7x|5P/)){h\'7y\'}h 1l};I.2K={\'2F\':[],\'5P\':[],\'7x\':[]};[\'7v\',\'7w\',\'7m\',\'7l\'].1A(k(7c){J(o 1k 1j I.2K)I.2K[1k].1a(1k+7c)});I.7d=[\'bY\',\'bW\',\'bX\'];I.6l=k(q,1E,1z){o 1l={};$1A(1z,k(1v){1l[1v]=q[1E](1v)});h 1l};I.4h=k(q,1E,6e){J(o 1v 1j 6e)q[1E](1v,6e[1v]);h q};I.4u=Y 2E({\'58\':\'1n\',\'J\':\'bM\',\'bD\':\'bE\',\'bC\':\'bB\',\'bz\':\'bA\',\'bF\':\'bG\',\'bL\':\'c2\',\'bK\':\'bJ\',\'bH\':\'bI\',\'G\':\'G\',\'5h\':\'5h\',\'5A\':\'5A\',\'5m\':\'5m\',\'6g\':\'6g\'});I.7b={\'c1\':2,\'49\':2};I.2g={48:{34:k(B,K){m(c.5z)c.5z(B,K,14);17 c.ci(\'6b\'+B,K);h c},7A:k(B,K){m(c.7a)c.7a(B,K,14);17 c.c8(\'6b\'+B,K);h c}}};L.N(I.2g.48);M.N(I.2g.48);I.N(I.2g.48);o 1Q={R:[],3r:k(q){m(!q.$2Q){1Q.R.1a(q);q.$2Q={\'1P\':1}}h q},4v:k(R){J(o i=0,j=R.O,q;i<j;i++){m(!(q=R[i])||!q.$2Q)78;m(q.$V)q.1N(\'4v\').4g();J(o p 1j q.$2Q)q.$2Q[p]=1d;J(o d 1j I.1p)q[d]=1d;1Q.R[1Q.R.3h(q)]=1d;q.3d=q.$2Q=q=1d}1Q.R.2W(1d)},1M:k(){1Q.3r(L);1Q.3r(M);1Q.4v(1Q.R)}};L.34(\'6w\',k(){L.34(\'5i\',1Q.1M);m(L.1V)L.34(\'5i\',c9)});o 26=Y 1i({1F:k(H){m(H&&H.$79)h H;c.$79=1h;H=H||L.H;c.H=H;c.B=H.B;c.3l=H.3l||H.cj;m(c.3l.5r==3)c.3l=c.3l.2m;c.7e=H.c7;c.c6=H.c3;c.c4=H.c5;c.ca=H.cb;m([\'6s\',\'4B\'].19(c.B)){c.cg=(H.7f)?H.7f/cf:-(H.ce||0)/3}17 m(c.B.19(\'1v\')){c.4b=H.7i||H.cc;J(o 1m 1j 26.1z){m(26.1z[1m]==c.4b){c.1v=1m;1r}}m(c.B==\'6A\'){o 4c=c.4b-cd;m(4c>0&&4c<13)c.1v=\'f\'+4c}c.1v=c.1v||4q.bx(c.4b).3Z()}17 m(c.B.28(/(6v|aP|aN)/)){c.aM={\'x\':H.5H||H.7k+M.23.3Y,\'y\':H.5C||H.7j+M.23.3H};c.aJ={\'x\':H.5H?H.5H-L.8b:H.7k,\'y\':H.5C?H.5C-L.8a:H.7j};c.aQ=(H.7i==3)||(H.aW==2);1L(c.B){P\'6m\':c.1D=H.1D||H.aX;1r;P\'6h\':c.1D=H.1D||H.aV}c.7g()}h c},3R:k(){h c.4a().4e()},4a:k(){m(c.H.4a)c.H.4a();17 c.H.aS=1h;h c},4e:k(){m(c.H.4e)c.H.4e();17 c.H.aI=14;h c}});26.4k={1D:k(){m(c.1D&&c.1D.5r==3)c.1D=c.1D.2m},7h:k(){3b{26.4k.1D.1R(c)}3m(e){c.1D=c.3l}}};26.1p.7g=(L.68)?26.4k.7h:26.4k.1D;26.1z=Y 2E({\'ar\':13,\'as\':38,\'at\':40,\'2D\':37,\'5B\':39,\'ay\':27,\'az\':32,\'aF\':8,\'aG\':9,\'5D\':46});I.2g.2e={2G:k(B,K){c.$V=c.$V||{};c.$V[B]=c.$V[B]||{\'1z\':[],\'29\':[]};m(c.$V[B].1z.19(K))h c;c.$V[B].1z.1a(K);o 4j=B;o 1K=I.2e[B];m(1K){m(1K.5s)1K.5s.1R(c,K);m(1K.25)K=1K.25;m(1K.B)4j=1K.B}m(!c.5z)K=K.2b({\'U\':c,\'H\':1h});c.$V[B].29.1a(K);h(I.6q.19(4j))?c.34(4j,K):c},5p:k(B,K){m(!c.$V||!c.$V[B])h c;o 1Y=c.$V[B].1z.3h(K);m(1Y==-1)h c;o 1v=c.$V[B].1z.4i(1Y,1)[0];o G=c.$V[B].29.4i(1Y,1)[0];o 1K=I.2e[B];m(1K){m(1K.2W)1K.2W.1R(c,K);m(1K.B)B=1K.B}h(I.6q.19(B))?c.7A(B,G):c},5g:k(2i){h I.4h(c,\'2G\',2i)},4g:k(B){m(!c.$V)h c;m(!B){J(o 4x 1j c.$V)c.4g(4x);c.$V=1d}17 m(c.$V[B]){c.$V[B].1z.1A(k(K){c.5p(B,K)},c);c.$V[B]=1d}h c},1N:k(B,18,1O){m(c.$V&&c.$V[B]){c.$V[B].1z.1A(k(K){K.2b({\'U\':c,\'1O\':1O,\'15\':18})()},c)}h c},6x:k(T,B){m(!T.$V)h c;m(!B){J(o 4x 1j T.$V)c.6x(T,4x)}17 m(T.$V[B]){T.$V[B].1z.1A(k(K){c.2G(B,K)},c)}h c}};L.N(I.2g.2e);M.N(I.2g.2e);I.N(I.2g.2e);I.2e=Y 2E({\'6B\':{B:\'6m\',25:k(H){H=Y 26(H);m(H.1D!=c&&!c.65(H.1D))c.1N(\'6B\',H)}},\'6z\':{B:\'6h\',25:k(H){H=Y 26(H);m(H.1D!=c&&!c.65(H.1D))c.1N(\'6z\',H)}},\'4B\':{B:(L.68)?\'6s\':\'4B\'}});I.6q=[\'6v\',\'bk\',\'bp\',\'bq\',\'4B\',\'6s\',\'6m\',\'6h\',\'bw\',\'6A\',\'bu\',\'bt\',\'7H\',\'5i\',\'6w\',\'bs\',\'bh\',\'bg\',\'b5\',\'7Y\',\'b6\',\'b4\',\'2R\',\'b3\',\'7L\',\'b0\',\'6a\'];5w.N({b2:k(U,18){h c.2b({\'U\':U,\'15\':18,\'H\':26})}});1C.N({bf:k(2r){h Y 1C(c.2t(k(q){h(I.3t(q)==2r)}))},8r:k(1n,1T){o R=c.2t(k(q){h(q.1n&&q.1n.19(1n,\' \'))});h(1T)?R:Y 1C(R)},8n:k(2Z,1T){o R=c.2t(k(q){h(q.2Z==2Z)});h(1T)?R:Y 1C(R)},7B:k(1m,5n,G,1T){o R=c.2t(k(q){o 1B=I.3z(q,1m);m(!1B)h 14;m(!5n)h 1h;1L(5n){P\'=\':h(1B==G);P\'*=\':h(1B.19(G));P\'^=\':h(1B.6y(0,G.O)==G);P\'$=\':h(1B.6y(1B.O-G.O)==G);P\'!=\':h(1B!=G);P\'~=\':h 1B.19(G,\' \')}h 14});h(1T)?R:Y 1C(R)}});k $E(1q,2t){h($(2t)||M).8h(1q)};k $bb(1q,2t){h($(2t)||M).4X(1q)};$$.2z={\'3P\':/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([!*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/,\'2O\':{64:k(1f,2f,W,i){o 1X=[2f.ba?\'5T:\':\'\',W[1]];m(W[2])1X.1a(\'[@2Z="\',W[2],\'"]\');m(W[3])1X.1a(\'[19(61(" ", @58, " "), " \',W[3],\' ")]\');m(W[4]){m(W[5]&&W[6]){1L(W[5]){P\'*=\':1X.1a(\'[19(@\',W[4],\', "\',W[6],\'")]\');1r;P\'^=\':1X.1a(\'[b9-bc(@\',W[4],\', "\',W[6],\'")]\');1r;P\'$=\':1X.1a(\'[bd(@\',W[4],\', 1G-O(@\',W[4],\') - \',W[6].O,\' + 1) = "\',W[6],\'"]\');1r;P\'=\':1X.1a(\'[@\',W[4],\'="\',W[6],\'"]\');1r;P\'!=\':1X.1a(\'[@\',W[4],\'!="\',W[6],\'"]\')}}17{1X.1a(\'[@\',W[4],\']\')}}1f.1a(1X.1w(\'\'));h 1f},63:k(1f,2f,1T){o R=[];o 2O=M.5a(\'.//\'+1f.1w(\'//\'),2f,$$.2z.8m,be.b7,1d);J(o i=0,j=2O.b1;i<j;i++)R.1a(2O.br(i));h(1T)?R:Y 1C(R.25($))}},\'8s\':{64:k(1f,2f,W,i){m(i==0){m(W[2]){o q=2f.4y(W[2]);m(!q||((W[1]!=\'*\')&&(I.3t(q)!=W[1])))h 14;1f=[q]}17{1f=$A(2f.2c(W[1]))}}17{1f=$$.2z.2c(1f,W[1]);m(W[2])1f=1C.8n(1f,W[2],1h)}m(W[3])1f=1C.8r(1f,W[3],1h);m(W[4])1f=1C.7B(1f,W[4],W[5],W[6],1h);h 1f},63:k(1f,2f,1T){h(1T)?1f:$$.3F(1f)}},8m:k(8j){h(8j==\'5T\')?\'bv://7J.bj.bi/bl/5T\':14},2c:k(2f,4G){o 5O=[];J(o i=0,j=2f.O;i<j;i++)5O.N(2f[i].2c(4G));h 5O}};$$.2z.1E=(L.2O)?\'2O\':\'8s\';I.2g.6d={4w:k(1q,1T){o 1f=[];1q=1q.5N().4n(\' \');J(o i=0,j=1q.O;i<j;i++){o 8t=1q[i];o W=8t.2d($$.2z.3P);m(!W)1r;W[1]=W[1]||\'*\';o 1X=$$.2z[$$.2z.1E].64(1f,c,W,i);m(!1X)1r;1f=1X}h $$.2z[$$.2z.1E].63(1f,c,1T)},8h:k(1q){h $(c.4w(1q,1h)[0]||14)},4X:k(1q,1T){o R=[];1q=1q.4n(\',\');J(o i=0,j=1q.O;i<j;i++)R=R.61(c.4w(1q[i],1h));h(1T)?R:$$.3F(R)}};I.N({4y:k(2Z){o q=M.4y(2Z);m(!q)h 14;J(o 1J=q.2m;1J!=c;1J=1J.2m){m(!1J)h 14}h q},bm:k(1n){h c.4w(\'.\'+1n)}});M.N(I.2g.6d);I.N(I.2g.6d);I.N({35:k(){1L(c.3t()){P\'2R\':o 29=[];$1A(c.C,k(2C){m(2C.6g)29.1a($3y(2C.G,2C.1t))});h(c.5m)?29:29[0];P\'7N\':m(!(c.5A&&[\'bo\',\'bn\'].19(c.B))&&![\'5q\',\'1t\',\'aZ\'].19(c.B))1r;P\'7R\':h c.G}h 14},7S:k(){h $$(c.2c(\'7N\'),c.2c(\'2R\'),c.2c(\'7R\'))},3w:k(){o 3k=[];c.7S().1A(k(q){o 1m=q.1m;o G=q.35();m(G===14||!1m||q.5h)h;o 5c=k(33){3k.1a(1m+\'=\'+4I(33))};m($B(G)==\'1g\')G.1A(5c);17 5c(G)});h 3k.1w(\'&\')}});I.N({aY:k(x,y){c.3Y=x;c.3H=y},89:k(){h{\'6a\':{\'x\':c.3Y,\'y\':c.3H},\'3J\':{\'x\':c.5k,\'y\':c.5e},\'8g\':{\'x\':c.4d,\'y\':c.4m}}},3D:k(2o){2o=2o||[];o q=c,2D=0,2w=0;aC{2D+=q.aB||0;2w+=q.aA||0;q=q.aD}4C(q);2o.1A(k(1b){2D-=1b.3Y||0;2w-=1b.3H||0});h{\'x\':2D,\'y\':2w}},aE:k(2o){h c.3D(2o).y},au:k(2o){h c.3D(2o).x},av:k(2o){o 5u=c.3D(2o);o Q={\'3C\':c.5k,\'5t\':c.5e,\'2D\':5u.x,\'2w\':5u.y};Q.5B=Q.2D+Q.3C;Q.5v=Q.2w+Q.5t;h Q}});I.2e.59={5s:k(K){m(L.4f){K.1R(c);h}o 3S=k(){m(L.4f)h;L.4f=1h;L.1W=$6n(L.1W);c.1N(\'59\')}.U(c);m(M.3M&&L.2Y){L.1W=k(){m([\'4f\',\'7G\'].19(M.3M))3S()}.2T(50)}17 m(M.3M&&L.1V){m(!$(\'5G\')){o 49=(L.ax.aw==\'aH:\')?\'://0\':\'7M:by(0)\';M.aU(\'<21 2Z="5G" aR 49="\'+49+\'"><\\/21>\');$(\'5G\').4T=k(){m(c.3M==\'7G\')3S()}}}17{L.34("7H",3S);M.34("aL",3S)}}};L.aK=k(K){h c.2G(\'59\',K)};L.N({8c:k(){m(c.57)h c.aO;m(c.7W)h M.4l.7K;h M.23.7K},8d:k(){m(c.57)h c.ch;m(c.7W)h M.4l.7X;h M.23.7X},8f:k(){m(c.1V)h 1e.2J(M.23.5k,M.23.4d);m(c.2Y)h M.4l.4d;h M.23.4d},8e:k(){m(c.1V)h 1e.2J(M.23.5e,M.23.4m);m(c.2Y)h M.4l.4m;h M.23.4m},87:k(){h c.8b||M.23.3Y},81:k(){h c.8a||M.23.3H},89:k(){h{\'3J\':{\'x\':c.8c(),\'y\':c.8d()},\'8g\':{\'x\':c.8f(),\'y\':c.8e()},\'6a\':{\'x\':c.87(),\'y\':c.81()}}},3D:k(){h{\'x\':0,\'y\':0}}});o 1c={};1c.4r=Y 1i({C:{86:1i.1M,3s:1i.1M,6f:1i.1M,1x:k(p){h-(1e.80(1e.5U*p)-1)/2},2M:bN,2j:\'41\',44:1h,83:50},1F:k(C){c.1b=c.1b||1d;c.4M(C);m(c.C.1F)c.C.1F.1R(c)},82:k(){o 2x=$2x();m(2x<c.2x+c.C.2M){c.7Z=c.C.1x((2x-c.2x)/c.C.2M);c.4z();c.47()}17{c.3R(1h);c.2s(c.12);c.1N(\'3s\',c.1b,10);c.6r()}},2s:k(12){c.1S=12;c.47();h c},4z:k(){c.1S=c.3G(c.T,c.12)},3G:k(T,12){h(12-T)*c.7Z+T},1H:k(T,12){m(!c.C.44)c.3R();17 m(c.1W)h c;c.T=T;c.12=12;c.7Y=c.12-c.T;c.2x=$2x();c.1W=c.82.2T(1e.3j(8o/c.C.83),c);c.1N(\'86\',c.1b);h c},3R:k(4t){m(!c.1W)h c;c.1W=$6n(c.1W);m(!4t)c.1N(\'6f\',c.1b);h c},1K:k(T,12){h c.1H(T,12)},c0:k(4t){h c.3R(4t)}});1c.4r.5I(Y 6k,Y 2e,Y 6j);1c.2L={2R:k(F,12){m(F.28(/4s/i))h c.5K;o B=$B(12);m((B==\'1g\')||(B==\'1G\'&&12.19(\' \')))h c.4o;h c.85},2l:k(q,F,3c){m(!3c.1a)3c=[3c];o T=3c[0],12=3c[1];m(!$3U(12)){12=T;T=q.2H(F)}o 1u=c.2R(F,12);h{\'T\':1u.2l(T),\'12\':1u.2l(12),\'1u\':1u}}};1c.2L.85={2l:k(G){h 3V(G)},3u:k(T,12,3f){h 3f.3G(T,12)},35:k(G,2j,F){m(2j==\'41\'&&F!=\'1P\')G=1e.3j(G);h G+2j}};1c.2L.4o={2l:k(G){h G.1a?G:G.4n(\' \').25(k(v){h 3V(v)})},3u:k(T,12,3f){o 1S=[];J(o i=0;i<T.O;i++)1S[i]=3f.3G(T[i],12[i]);h 1S},35:k(G,2j,F){m(2j==\'41\'&&F!=\'1P\')G=G.25(1e.3j);h G.1w(2j+\' \')+2j}};1c.2L.5K={2l:k(G){h G.1a?G:G.4p(1h)},3u:k(T,12,3f){o 1S=[];J(o i=0;i<T.O;i++)1S[i]=1e.3j(3f.3G(T[i],12[i]));h 1S},35:k(G){h\'22(\'+G.1w(\',\')+\')\'}};1c.5V=1c.4r.N({1F:k(q,F,C){c.1b=$(q);c.F=F;c.1J(C)},bV:k(){h c.2s(0)},4z:k(){c.1S=c.1u.3u(c.T,c.12,c)},2s:k(12){c.1u=1c.2L.2R(c.F,12);h c.1J(c.1u.2l(12))},1H:k(T,12){m(c.1W&&c.C.44)h c;o 2a=1c.2L.2l(c.1b,c.F,[T,12]);c.1u=2a.1u;h c.1J(2a.T,2a.12)},47:k(){c.1b.45(c.F,c.1u.35(c.1S,c.C.2j,c.F))}});I.N({bU:k(F,C){h Y 1c.5V(c,F,C)}});1c.2K=1c.4r.N({1F:k(q,C){c.1b=$(q);c.1J(C)},4z:k(){J(o p 1j c.T)c.1S[p]=c.1u[p].3u(c.T[p],c.12[p],c)},2s:k(12){o 2a={};c.1u={};J(o p 1j 12){c.1u[p]=1c.2L.2R(p,12[p]);2a[p]=c.1u[p].2l(12[p])}h c.1J(2a)},1H:k(Q){m(c.1W&&c.C.44)h c;c.1S={};c.1u={};o T={},12={};J(o p 1j Q){o 2a=1c.2L.2l(c.1b,p,Q[p]);T[p]=2a.T;12[p]=2a.12;c.1u[p]=2a.1u}h c.1J(T,12)},47:k(){J(o p 1j c.1S)c.1b.45(p,c.1u[p].35(c.1S[p],c.C.2j,p))}});I.N({bO:k(C){h Y 1c.2K(c,C)}});1c.5M=k(1x,1Z){1Z=1Z||[];m($B(1Z)!=\'1g\')1Z=[1Z];h $N(1x,{bR:k(1Y){h 1x(1Y,1Z)},bT:k(1Y){h 1-1x(1-1Y,1Z)},bS:k(1Y){h(1Y<=0.5)?1x(2*1Y,1Z)/2:(2-1x(2*(1-1Y),1Z))/2}})};1c.2q=Y 2E({aq:k(p){h p}});1c.2q.N=k(5Y){J(o 1x 1j 5Y){1c.2q[1x]=Y 1c.5M(5Y[1x]);1c.2q.5J(1x)}};1c.2q.5J=k(1x){[\'aT\',\'ad\',\'8D\'].1A(k(5X){1c.2q[1x.3Z()+5X]=1c.2q[1x][\'8W\'+5X]})};1c.2q.N({9b:k(p,x){h 1e.2U(p,x[0]||6)},99:k(p){h 1e.2U(2,8*(p-1))},9h:k(p){h 1-1e.84(1e.97(p))},98:k(p){h 1-1e.84((1-p)*1e.5U/2)},9l:k(p,x){x=x[0]||1.9n;h 1e.2U(p,2)*((x+1)*p-x)},9p:k(p){o G;J(o a=0,b=1;1;a+=b,b/=2){m(p>=(7-4*a)/11){G=-1e.2U((11-6*a-11*p)/4,2)+b*b;1r}}h G},9i:k(p,x){h 1e.2U(2,10*--p)*1e.80(20*p*1e.5U*(x[0]||1)/3)}});[\'8C\',\'8z\',\'8v\',\'8u\'].1A(k(1x,i){1c.2q[1x]=Y 1c.5M(k(p){h 1e.2U(p,[i+2])});1c.2q.5J(1x)});o 6i=Y 1i({C:{1E:\'3i\',7C:1h,7E:1i.1M,3x:1i.1M,4E:1i.1M,7I:1h,3N:\'8H-8\',8i:14,2V:{}},6c:k(){c.1I=(L.4O)?Y 4O():(L.1V?Y 88(\'a5.a4\'):14);h c},1F:k(C){c.6c().4M(C);c.C.3Q=c.C.3Q||c.3Q;c.2V={};m(c.C.7I&&c.C.1E==\'3i\'){o 3N=(c.C.3N)?\'; 9r=\'+c.C.3N:\'\';c.3X(\'7U-B\',\'7T/x-7J-9Y-a0\'+3N)}m(c.C.1F)c.C.1F.1R(c)},7D:k(){m(c.1I.3M!=4||!c.3o)h;c.3o=14;o 2S=0;3b{2S=c.1I.2S}3m(e){};m(c.C.3Q.1R(c,2S))c.3x();17 c.4E();c.1I.4T=1i.1M},3Q:k(2S){h((2S>=al)&&(2S<an))},3x:k(){c.2I={\'1t\':c.1I.ah,\'3O\':c.1I.ab};c.1N(\'3x\',[c.2I.1t,c.2I.3O]);c.6r()},4E:k(){c.1N(\'4E\',c.1I)},3X:k(1m,G){c.2V[1m]=G;h c},4V:k(2B,1o){m(c.C.8i)c.7F();17 m(c.3o)h c;c.3o=1h;m(1o&&c.C.1E==\'5l\'){2B=2B+(2B.19(\'?\')?\'&\':\'?\')+1o;1o=1d}c.1I.ae(c.C.1E.6t(),2B,c.C.7C);c.1I.4T=c.7D.U(c);m((c.C.1E==\'3i\')&&c.1I.9V)c.3X(\'9U\',\'9B\');$N(c.2V,c.C.2V);J(o B 1j c.2V)3b{c.1I.9A(B,c.2V[B])}3m(e){};c.1N(\'7E\');c.1I.4V($3y(1o,1d));h c},7F:k(){m(!c.3o)h c;c.3o=14;c.1I.7L();c.1I.4T=1i.1M;c.6c();c.1N(\'6f\');h c}});6i.5I(Y 6k,Y 2e,Y 6j);o 7Q=6i.N({C:{1o:1d,5j:1d,3s:1i.1M,4Q:14,5d:14},1F:k(2B,C){c.2G(\'3x\',c.3s);c.4M(C);c.C.1o=c.C.1o||c.C.9C;m(![\'3i\',\'5l\'].19(c.C.1E)){c.3T=\'3T=\'+c.C.1E;c.C.1E=\'3i\'}c.1J();c.3X(\'X-9y-9t\',\'4O\');c.3X(\'9u\',\'1t/7M, 1t/9v, 7T/3O, 1t/3O, */*\');c.2B=2B},3s:k(){m(c.C.5j)$(c.C.5j).1M().5f(c.2I.1t);m(c.C.4Q||c.C.5d)c.4Q();c.1N(\'3s\',[c.2I.1t,c.2I.3O],20)},8q:k(1o){1o=1o||c.C.1o;1L($B(1o)){P\'1b\':1o=$(1o).3w();1r;P\'2h\':1o=5x.3w(1o)}m(c.3T)1o=(1o)?[c.3T,1o].1w(\'&\'):c.3T;h c.4V(c.2B,1o)},4Q:k(){o 21,2u;m(c.C.5d||(/(9R|9S)21/).28(c.7P(\'7U-B\')))2u=c.2I.1t;17{2u=[];o 3P=/<21[^>]*>([\\s\\S]*?)<\\/21>/9T;4C((21=3P.9O(c.2I.1t)))2u.1a(21[1]);2u=2u.1w(\'\\n\')}m(2u)(L.7V)?L.7V(2u):L.7O(2u,0)},7P:k(1m){3b{h c.1I.9M(1m)}3m(e){};h 1d}});5x.3w=k(2i){o 3k=[];J(o F 1j 2i)3k.1a(4I(F)+\'=\'+4I(2i[F]));h 3k.1w(\'&\')};I.N({4V:k(C){h Y 7Q(c.3z(\'a8\'),$2p({1o:c.3w()},C,{1E:\'3i\'})).8q()}});o 9N=Y 2E({C:{4H:14,56:14,2M:14,42:14},2s:k(1v,G,C){C=$2p(c.C,C);G=4I(G);m(C.4H)G+=\'; 4H=\'+C.4H;m(C.56)G+=\'; 56=\'+C.56;m(C.2M){o 4W=Y 8l();4W.9w(4W.8k()+C.2M*24*60*60*8o);G+=\'; a6=\'+4W.8V()}m(C.42)G+=\'; 42\';M.31=1v+\'=\'+G;h $N(C,{\'1v\':1v,\'G\':G})},5l:k(1v){o G=M.31.2d(\'(?:^|;)\\\\s*\'+1v.8p()+\'=([^;]*)\');h G?9m(G[1]):14},2W:k(31,C){m($B(31)==\'2h\')c.2s(31.1v,\'\',$2p(31,{2M:-1}));17 c.2s(31,\'\',$2p(C,{2M:-1}))}});o 4K={3A:k(Q){1L($B(Q)){P\'1G\':h\'"\'+Q.2A(/(["\\\\])/g,\'\\\\$1\')+\'"\';P\'1g\':h\'[\'+Q.25(4K.3A).1w(\',\')+\']\';P\'2h\':o 1G=[];J(o F 1j Q)1G.1a(4K.3A(F)+\':\'+4K.3A(Q[F]));h\'{\'+1G.1w(\',\')+\'}\';P\'43\':m(bP(Q))1r;P 14:h\'1d\'}h 4q(Q)},5a:k(53,42){h(($B(53)!=\'1G\')||(42&&!53.28(/^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+b8-u \\n\\r\\t])+?$/)))?1d:bZ(\'(\'+53+\')\')}};',62,764,'||||||||||||this|||||return|||function||if||var||el|||||||||||type|options|||property|value|event|Element|for|fn|window|document|extend|length|case|obj|elements||from|bind|events|param||new||||to||false|arguments||else|args|contains|push|element|Fx|null|Math|items|array|true|Class|in|style|result|name|className|data|prototype|selector|break|props|text|css|key|join|transition|prop|keys|each|current|Elements|relatedTarget|method|initialize|string|start|transport|parent|custom|switch|empty|fireEvent|delay|opacity|Garbage|call|now|nocash|Array|ie|timer|temp|pos|params||script|rgb|documentElement||map|Event||test|values|parsed|create|getElementsByTagName|match|Events|context|Methods|object|source|unit|properties|parse|parentNode|item|overflown|merge|Transitions|tag|set|filter|scripts|index|top|time|returns|shared|replace|url|option|left|Abstract|border|addEvent|getStyle|response|max|Styles|CSS|duration|iterable|xpath|previous|tmp|select|status|periodical|pow|headers|remove|min|webkit|id|hex|cookie||val|addListener|getValue|chains||||len|try|fromTo|htmlElement|results|fx|bit|indexOf|post|round|queryString|target|catch|inject|running|native|apply|collect|onComplete|getTag|getNow|next|toQueryString|onSuccess|pick|getProperty|toString|mix|width|getPosition|klass|unique|compute|scrollTop|parseInt|size|HTMLElement|walk|readyState|encoding|xml|regexp|isSuccess|stop|domReady|_method|chk|parseFloat|precision|setHeader|scrollLeft|toLowerCase||px|secure|number|wait|setStyle||increase|Listeners|src|stopPropagation|code|fKey|scrollWidth|preventDefault|loaded|removeEvents|setMany|splice|realType|fix|body|scrollHeight|split|Multi|hexToRgb|String|Base|color|end|Properties|trash|getElements|evType|getElementById|setNow|brother|mousewheel|while|typeof|onFailure|attempt|tagName|domain|encodeURIComponent|visibility|Json|forEach|setOptions|included|XMLHttpRequest|toInt|evalScripts|regex|generic|onreadystatechange|every|send|date|getElementsBySelector|defined|setProperty||rgbToHex|proto|str|mp|currentStyle|path|webkit419|class|domready|evaluate|charAt|qs|evalResponse|offsetHeight|setHTML|addEvents|disabled|unload|update|offsetWidth|get|multiple|operator|merged|removeEvent|hidden|nodeType|add|height|position|bottom|Function|Object|newArray|addEventListener|checked|right|pageY|delete|include|random|ie_ready|pageX|implement|compat|Color|camelCase|Transition|trim|found|padding|RegExp|clean|hasClass|xhtml|PI|Style|cssText|easeType|transitions|innerText||concat|firstChild|getItems|getParam|hasChild|flag|node|gecko|appendChild|scroll|on|setTransport|Dom|pairs|onCancel|selected|mouseout|XHR|Options|Chain|getMany|mouseover|clear|first|default|NativeEvents|callChain|DOMMouseScroll|toUpperCase|insertBefore|click|beforeunload|cloneEvents|substr|mouseleave|keydown|mouseenter|capitalize|contents|removeClass|argument|after|where|before|addClass|setStyles|hyphenate|getNext|defaultView|zoom|setOpacity|visible|elementsProperty|createElement|constructor|pp|ie6|undefined|picked|head|Merge|callee|Number|toFloat|interval|slice|copy|getLast|childNodes|continue|extended|removeEventListener|PropertiesIFlag|direction|borderShort|shift|wheelDelta|fixRelatedTarget|relatedTargetGecko|which|clientY|clientX|Left|Bottom|styleSheet|innerHTML|appendText|removeChild|nodeValue|setProperties|textContent|fixStyle|Top|Right|margin|0px|Width|removeListener|filterByAttribute|async|onStateChange|onRequest|cancel|complete|load|urlEncoded|www|clientWidth|abort|javascript|input|setTimeout|getHeader|Ajax|textarea|getFormElements|application|Content|execScript|opera|clientHeight|change|delta|cos|getScrollTop|step|fps|sin|Single|onStart|getScrollLeft|ActiveXObject|getSize|pageYOffset|pageXOffset|getWidth|getHeight|getScrollHeight|getScrollWidth|scrollSize|getElement|autoCancel|prefix|getTime|Date|resolver|filterById|1000|escapeRegExp|request|filterByClass|normal|sel|Quint|Quart|100|alpha|floor|Cubic|getStyles|getPropertyValue|Quad|InOut|getComputedStyle|hasLayout|getText|utf|taintEnabled|navigator|webkit420|cssFloat|styleFloat|getBoxObjectFor|all|ie7|clearInterval|clearTimeout|Window|Document|zIndex|toGMTString|ease|getPrevious|removeAttribute|version|nodeName|textnode|removeProperty|whitespace|getProperties|MooTools|setText|acos|Sine|Expo|setAttribute|Pow|collection|getParent|khtml|lastChild|getFirst|Circ|Elastic|getChildren|getAttribute|Back|decodeURIComponent|618|attributes|Bounce|Sibling|charset|limit|With|Accept|html|setTime|bindAsEventListener|Requested|times|setRequestHeader|close|postBody|boolean|embed|pass|err|chain|getRandom|clearChain|associate|some|getResponseHeader|Cookie|exec|transparent|setInterval|ecma|java|gi|Connection|overrideMimeType|replaceWith|replaceChild|form|cloneNode|urlencoded|clone|iframe|createTextNode|XMLHTTP|Microsoft|expires|toggleClass|action|DOMElement|adopt|responseXML|execCommand|Out|open|styles|BackgroundImageCache|responseText|injectBefore|injectInside|injectTop|200|injectAfter|300|float||linear|enter|up|down|getLeft|getCoordinates|protocol|location|esc|space|offsetTop|offsetLeft|do|offsetParent|getTop|backspace|tab|https|returnValue|client|onDomReady|DOMContentLoaded|page|menu|innerWidth|mouse|rightClick|defer|cancelBubble|In|write|toElement|button|fromElement|scrollTo|password|contextmenu|snapshotLength|bindWithEvent|error|reset|blur|submit|UNORDERED_NODE_SNAPSHOT_TYPE|Eaeflnr|starts|namespaceURI|ES|with|substring|XPathResult|filterByTag|focus|move|org|w3|dblclick|1999|getElementsByClassName|radio|checkbox|mouseup|mousedown|snapshotItem|resize|keyup|keypress|http|mousemove|fromCharCode|void|accesskey|accessKey|rowSpan|rowspan|colspan|colSpan|tabindex|tabIndex|frameborder|frameBorder|readOnly|readonly|maxlength|htmlFor|500|effects|isFinite|offset|easeIn|easeInOut|easeOut|effect|hide|borderStyle|borderColor|borderWidth|eval|clearTimer|href|maxLength|ctrlKey|alt|altKey|control|shiftKey|detachEvent|CollectGarbage|meta|metaKey|keyCode|111|detail|120|wheel|innerHeight|attachEvent|srcElement'.split('|'),0,{}))
/* observer.js */
/**
 * Observer - Observe formelements for changes
 *
 * @version		1.0rc1
 *
 * @license		MIT-style license
 * @author		Harald Kirschner <mail [at] digitarald.de>
 * @copyright	Author
 */
var Observer = new Class({

	options: {
		periodical: false,
		delay: 1000
	},

	initialize: function(el, onFired, options){
		this.setOptions(options);
		this.addEvent('onFired', onFired);
		this.element = $(el);
		this.listener = this.fired.bind(this);
		this.value = this.element.getValue();
		if (this.options.periodical) this.timer = this.listener.periodical(this.options.periodical);
		else this.element.addEvent('keyup', this.listener);
	},

	fired: function() {
		var value = this.element.getValue();
		if (this.value == value) return;
		this.clear();
		this.value = value;
		this.timeout = this.fireEvent.delay(this.options.delay, this, ['onFired', [value]]);
	},

	clear: function() {
		$clear(this.timeout);
		return this;
	}
});

Observer.implement(new Options);
Observer.implement(new Events);/* autocompleter.js */
/**
 * Autocompleter
 *
 * @version		1.0rc4
 *
 * @license		MIT-style license
 * @author		Harald Kirschner <mail [at] digitarald.de>
 * @copyright	Author
 */
var Autocompleter = {};

Autocompleter.Base = new Class({

	options: {
		minLength: 1,
		useSelection: true,
		markQuery: true,
		inheritWidth: true,
		maxChoices: 10,
		injectChoice: null,
		onSelect: Class.empty,
		onShow: Class.empty,
		onHide: Class.empty,
		customTarget: null,
		className: 'autocompleter-choices',
		zIndex: 42,
		observerOptions: {},
		fxOptions: {},
		overflown: []
	},

	initialize: function(el, options) {
		this.setOptions(options);
		this.element = $(el);
		this.build();
		this.observer = new Observer(this.element, this.prefetch.bind(this), $merge({
			delay: 400
		}, this.options.observerOptions));
		this.value = this.observer.value;
		this.queryValue = null;
	},

	/**
	 * build - Initialize DOM
	 *
	 * Builds the html structure for choices and appends the events to the element.
	 * Override this function to modify the html generation.
	 */
	build: function() {
		if ($(this.options.customTarget)) this.choices = this.options.customTarget;
		else {
			this.choices = new Element('ul', {
				'class': this.options.className,
				styles: {zIndex: this.options.zIndex}
			}).injectInside(document.body);
			this.fix = new OverlayFix(this.choices);
		}
		this.fx = this.choices.effect('opacity', $merge({
			wait: false,
			duration: 200
		}, this.options.fxOptions))
			.addEvent('onStart', function() {
				if (this.fx.now) return;
				this.choices.setStyle('display', '');
				this.fix.show();
			}.bind(this))
			.addEvent('onComplete', function() {
				if (this.fx.now) return;
				this.choices.setStyle('display', 'none');
				this.fix.hide();
			}.bind(this)).set(0);
		this.element.setProperty('autocomplete', 'off')
			.addEvent(window.ie ? 'keydown' : 'keypress', this.onCommand.bindWithEvent(this))
			.addEvent('mousedown', this.onCommand.bindWithEvent(this, [true]))
			.addEvent('focus', this.toggleFocus.bind(this, [true]))
			.addEvent('blur', this.toggleFocus.bind(this, [false]))
			.addEvent('trash', this.destroy.bind(this));
	},

	destroy: function() {
		this.choices.remove();
	},

	toggleFocus: function(state) {
		this.focussed = state;
		if (!state) this.hideChoices();
	},

	onCommand: function(e, mouse) {
		if (mouse && this.focussed) this.prefetch();
		if (e.key && !e.shift) switch (e.key) {
			case 'enter':
				if (this.selected && this.visible) {
					this.choiceSelect(this.selected);
					e.stop();
				} return;
			case 'up': case 'down':
				if (this.observer.value != (this.value || this.queryValue)) this.prefetch();
				else if (this.queryValue === null) break;
				else if (!this.visible) this.showChoices();
				else {
					this.choiceOver((e.key == 'up')
						? this.selected.getPrevious() || this.choices.getLast()
						: this.selected.getNext() || this.choices.getFirst() );
					this.setSelection();
				}
				e.stop(); return;
			case 'esc': this.hideChoices(); return;
		}
		this.value = false;
	},

	setSelection: function() {
		if (!this.options.useSelection) return;
		var startLength = this.queryValue.length;
		if (this.element.value.indexOf(this.queryValue) != 0) return;
		var insert = this.selected.inputValue.substr(startLength);
		if (document.getSelection) {
			this.element.value = this.queryValue + insert;
			this.element.selectionStart = startLength;
			this.element.selectionEnd = this.element.value.length;
		} else if (document.selection) {
			var sel = document.selection.createRange();
			sel.text = insert;
			sel.move("character", - insert.length);
			sel.findText(insert);
			sel.select();
		}
		this.value = this.observer.value = this.element.value;
	},

	hideChoices: function() {
		if (!this.visible) return;
		this.visible = this.value = false;
		this.observer.clear();
		this.fx.start(0);
		this.fireEvent('onHide', [this.element, this.choices]);
	},

	showChoices: function() {
		if (this.visible || !this.choices.getFirst()) return;
		this.visible = true;
		var pos = this.element.getCoordinates(this.options.overflown);
		this.choices.setStyles({
			left: pos.left,
			top: pos.bottom
		});
		if (this.options.inheritWidth) this.choices.setStyle('width', pos.width);
		this.fx.start(1);
		this.choiceOver(this.choices.getFirst());
		this.fireEvent('onShow', [this.element, this.choices]);
	},

	prefetch: function() {
		if (this.element.value.length < this.options.minLength) this.hideChoices();
		else if (this.element.value == this.queryValue) this.showChoices();
		else this.query();
	},

	updateChoices: function(choices) {
		this.choices.empty();
		this.selected = null;
		if (!choices || !choices.length) return;
		if (this.options.maxChoices < choices.length) choices.length = this.options.maxChoices;
		choices.each(this.options.injectChoice || function(choice, i){
			var el = new Element('li').setHTML(this.markQueryValue(choice));
			el.inputValue = choice;
			this.addChoiceEvents(el).injectInside(this.choices);
		}, this);
		this.showChoices();
	},

	choiceOver: function(el) {
		if (this.selected) this.selected.removeClass('autocompleter-selected');
		this.selected = el.addClass('autocompleter-selected');
	},

	choiceSelect: function(el) {
		this.observer.value = this.element.value = el.inputValue;
		this.hideChoices();
		this.fireEvent('onSelect', [this.element], 20);
	},

	/**
	 * markQueryValue
	 *
	 * Marks the queried word in the given string with <span class="autocompleter-queried">*</span>
	 * Call this i.e. from your custom parseChoices, same for addChoiceEvents
	 *
	 * @param		{String} Text
	 * @return		{String} Text
	 */
	markQueryValue: function(txt) {
		return (this.options.markQuery && this.queryValue) ? txt.replace(new RegExp('(' + this.queryValue.escapeRegExp() + ')', 'i'), '<span class="autocompleter-queried">$1</span>') : txt;
	},

	/**
	 * addChoiceEvents
	 *
	 * Appends the needed event handlers for a choice-entry to the given element.
	 *
	 * @param		{Element} Choice entry
	 * @return		{Element} Choice entry
	 */
	addChoiceEvents: function(el) {
		return el.addEvents({
			mouseover: this.choiceOver.bind(this, [el]),
			mousedown: this.choiceSelect.bind(this, [el])
		});
	}
});

Autocompleter.Base.implement(new Events);
Autocompleter.Base.implement(new Options);

Autocompleter.Local = Autocompleter.Base.extend({

	options: {
		minLength: 0,
		filterTokens : null
	},

	initialize: function(el, tokens, options) {
		this.parent(el, options);
		this.tokens = tokens;
		if (this.options.filterTokens) this.filterTokens = this.options.filterTokens.bind(this);
	},

	query: function() {
		this.hideChoices();
		this.queryValue = this.element.value;
		this.updateChoices(this.filterTokens());
	},

	filterTokens: function(token) {
		var regex = new RegExp(this.queryValue.escapeRegExp(), 'i');
		return this.tokens.filter(function(token) {
			return regex.test(token);
		});
	}

});

Autocompleter.Ajax = {};

Autocompleter.Ajax.Base = Autocompleter.Base.extend({

	options: {
		postVar: 'value',
		postData: {},
		ajaxOptions: {},
		onRequest: Class.empty,
		onComplete: Class.empty
	},

	initialize: function(el, url, options) {
		this.parent(el, options);
		this.ajax = new Ajax(url, $merge({
			autoCancel: true
		}, this.options.ajaxOptions));
		this.ajax.addEvent('onComplete', this.queryResponse.bind(this));
		this.ajax.addEvent('onFailure', this.queryResponse.bind(this, [false]));
	},

	query: function(){
		var data = $extend({}, this.options.postData);
		data[this.options.postVar] = this.element.value;
		this.fireEvent('onRequest', [this.element, this.ajax]);
		this.ajax.request(data);
	},

	/**
	 * queryResponse - abstract
	 *
	 * Inherated classes have to extend this function and use this.parent(resp)
	 *
	 * @param		{String} Response
	 */
	queryResponse: function(resp) {
		this.value = this.queryValue = this.element.value;
		this.selected = false;
		this.hideChoices();
		this.fireEvent(resp ? 'onComplete' : 'onFailure', [this.element, this.ajax], 20);
	}

});

Autocompleter.Ajax.Json = Autocompleter.Ajax.Base.extend({

	queryResponse: function(resp) {
		this.parent(resp);
		var choices = Json.evaluate(resp || false);
		if (!choices || !choices.length) return;
		this.updateChoices(choices);
	}

});

Autocompleter.Ajax.Xhtml = Autocompleter.Ajax.Base.extend({

	options: {
		parseChoices: null
	},

	queryResponse: function(resp) {
		this.parent(resp);
		if (!resp) return;
		this.choices.setHTML(resp).getChildren().each(this.options.parseChoices || this.parseChoices, this);
		this.showChoices();
	},

	parseChoices: function(el) {
		var value = el.innerHTML;
		el.inputValue = value;
		el.setHTML(this.markQueryValue(value));
	}

});


var OverlayFix = new Class({

	initialize: function(el) {
		this.element = $(el);
		if (window.ie){
			this.element.addEvent('trash', this.destroy.bind(this));
			this.fix = new Element('iframe', {
				properties: {
					frameborder: '0',
					scrolling: 'no',
					src: 'javascript:false;'
				},
				styles: {
					position: 'absolute',
					border: 'none',
					display: 'none',
					filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
				}
			}).injectAfter(this.element);
		}
	},

	show: function() {
		if (this.fix) this.fix.setStyles($extend(
			this.element.getCoordinates(), {
				display: '',
				zIndex: (this.element.getStyle('zIndex') || 1) - 1
			}));
		return this;
	},

	hide: function() {
		if (this.fix) this.fix.setStyle('display', 'none');
		return this;
	},

	destroy: function() {
		this.fix.remove();
	}

});/* bumeran.js */
/* ***********************
* bumeran js v202
* 2007, icograma.com
* **********************/

/* debug */
var annoy=true; function debug(m){if(annoy){annoy=confirm(m);};};

function rmHintEv(){ rmHint(this); }
function rmHint(what){
	if( !($(what)) ){ what=this; }

	//for mootools
	if( $(what).hasClass('hint') ){
		what.value="";
		what.removeClass('hint');
	}

}

function addHintEv(){ addHint(this); }
function addHint(what){
	if( !($(what)) ){ what=this; }
	if(what.title.indexOf("*")==0){
		var t = what.title.substring(1);
		if(what.value=="" || what.value == t){
			what.value = t;
			what.addClass("hint"); //moo
		}
	}
}

function dynLayoutEv(){ dynLayout( window.getWidth() ); }//moo
function dynLayout(w){
	var sizes=new Array( 755, "w800", 860, "w1024" );
	var sizeClass = sizes[1];
	var b=document.getElementsByTagName("HTML")[0];
	for(var i=sizes.length-2;i>=0;i-=2){ if(w >= sizes[i] ){ sizeClass = sizes[i+1]; break;  } }
	b.className = sizeClass;
	Cookie.set("browserWidth",w);
}



function init(){
	dynLayoutEv();

	//shortcuts para usuarios
	if($chk($('header_shortcuts'))) {
		var  divRespuesta = $('header_shortcuts');
		var  url = '/presentacion/postulantes/client/pos_shortcuts.ngmf';
		divRespuesta.empty();
		new Ajax(url, {
			method: 'get',
			update: divRespuesta
		}).request();
	}
	//fin shortcuts para usuarios

	for( var f=0; f<document.forms.length; f++){
		var fs = document.forms[f].elements;

		for ( var j=0; j<fs.length; j++ ){
			if( $(fs[j]).type == "text" ){
				addHint( $(fs[j]) );

				// for mootools
				$(fs[j]).addEvent( "blur", addHint );
				$(fs[j]).addEvent( "focus", rmHint );
				$(fs[j]).addEvent( "change", rmHint );
				$(fs[j]).addEvent( "click", rmHint );

			}//end type==text
		}//end j
	}//end f

	//hack para Firefox
	if(window.gecko){
		//valido que exista el div que va a contener la respuesta
		if($chk($('paginador'))) {
			$('paginador').addClass('paginador-fix-ff');
		}
	}

	//hack para IE
	if(window.ie){
		if($chk($('mainbody'))) {
			///$('mainbody').addClass('main-fix-ie');
		}
	}



	//caja de newsletter con AJAX
	/*	Variable que guarda el elemento de Formulario */
	var miFormu = $('news_form');
	//valido que exista el formulario

	if($chk(miFormu)) {
		/*	Agregamos nuestra funcion al evento enviar 'submit' */
		miFormu.addEvent('submit', function(e) {
			/*	Evitamos el Evento submit natural */
			new Event(e).stop();

			//if(checkForm(miFormu)){
			if(checkForm(this)){
				/* enviar con cuidado de enconding y retornar una instancia de Ajax. */
				var  divRespuesta = $('news_subscribe');
				var  url = '/aplicantes/a_newsadd.ngmf?email='+ $('email').value;
				divRespuesta.empty().addClass('ajax-loading');
				divRespuesta.setHTML('<br/><br/>');
				new Ajax(url, {
					method: 'get',
					onComplete: function() {
						divRespuesta.removeClass('ajax-loading');
					},
					update: divRespuesta
				}).request();
			}
		});
	}

	//caja de busqueda
	/*	Variable que guarda el elemento de Formulario */
	var miFormu = $('BUS_POS');
	//valido que exista el formulario
	if($chk(miFormu)) {
		/*	Agregamos nuestra funcion al evento enviar 'submit' */
		miFormu.addEvent('submit', function(e) {
			/*	Evitamos el Evento submit natural */
			new Event(e).stop();
			var keyword = $('KEYWORD');
			rmHint(keyword);
			if (keyword.value == ''){
				window.location = $('BUS_POS').action + '.html';
			}else{
				window.location = $('BUS_POS').action +'_'+escape(keyword.value)+'.html';
			}
		});
	}

	//encuesta con ajax
	var miFormu = $('formalter');
	//valido que exista el formulario
	if($chk(miFormu)) {
		/*	Agregamos nuestra funcion al evento enviar 'submit' */
		miFormu.addEvent('submit', function(e) {
			/*	Evitamos el Evento submit natural*/
			new Event(e).stop();

			var alternativa=0;
			for (t=0; t<miFormu.length && alternativa==0; t++) {
				if (miFormu.ALTERNATIVAS[t].checked)
				alternativa = miFormu.ALTERNATIVAS[t].value;
			}

			var  divRespuesta = $('encuestadiv');
			if($('encuestaTipo').value==1) {
				var url ="/aplicantes/contenidos/encuestas/a_encuestas.ngmf?ENCUESTA=" + $('encuestaId').value + "&ALTERNA=" + alternativa;
			} else {
				var url ="/empresas/contenidos/encuestas/e_encuestas.ngmf?ENCUESTA=" + $('encuestaId').value + "&ALTERNA=" + alternativa;
			}
			divRespuesta.empty().addClass('ajax-loading');
			divRespuesta.setHTML('<br/><br/><br/><br/>');
			new Ajax(url, {
				method: 'get',
				onComplete: function() {
					divRespuesta.removeClass('ajax-loading');
				},
				update: divRespuesta
			}).request();
		});
	}
	//colocamos el foco en la caja de busqueda
	if($chk($('UUSERNAME'))) {
		$('UUSERNAME').focus();
		if((Cookie.get('BMN_USERNAME'))){
			var value = Cookie.get('BMN_USERNAME');
			$('UUSERNAME').value = value;
		}

	}else{
		if($chk($('KEYWORD'))){
			$('KEYWORD').focus();
		}
	}

	//breadcrumb de busquedas en avisos
	if($chk($('breadcrumbBusqueda'))) {
		if((Cookie.get('BUSQUEDA_CAMINO'))){
			var value = (Cookie.get('BUSQUEDA_CAMINO'));
			value = value.replace(/\+/g, ' ');
			$('breadcrumbBusqueda').innerHTML = value;
		}
	}

	//suggest
	var input      = $('KEYWORD');
    var completer2 = new Autocompleter.Ajax.Json(input, '/2008/ajax/sugerirAvisos/', {postVar: 'keyword', minLength: 3} );
    //fin suggest

}//end init fn

dynLayout( Cookie.get("browserWidth") );
window.addEvent('domready', init);
window.addEvent("resize",dynLayoutEv)




/* --- FORMS ---- */

function checkForm(f){ /* for mootools */

	if(!document.getElementById){ return true; }
	var oktosend=true; var fs=f.elements;

	for(var i=0;i<fs.length;i++){
		if(fs[i].type&&fs[i].name){

			//get field value
			var ftype=fs[i].type; var efilter=false;
			if(ftype=="text"||ftype=="textarea"){
				v=fs[i].value && !$(fs[i]).hasClass("hint");
				/*
				if( fs[i].hasClass("hint") ){
				v = false;
				}
				*/
			}else if(ftype=="select-one"||ftype=="select-multiple"){
				v=fs[i][fs[i].selectedIndex].value;
			}else if(ftype=="checkbox"){
				v=fs[i].checked;
			}else{
				v="!";//other types, don't check
			}
			var isfilled = isvalid = (v!="");

			//special fields:
			if(fs[i].name&&fs[i].name.indexOf("mail")>-1){ ftype="email";efilter=true; }
			if(efilter){ isvalid=isValidField(fs[i].value,ftype); }

			//is required, or need to check if filled?
			var reqelm = FindTagClassUp(fs[i],".required","form");

			if(!reqelm&&efilter&&isfilled){
				reqelm=FindTagClassUp(fs[i],".field","form");
				if(!reqelm){reqelm=fs[i];}
			};

			if(!isvalid&&reqelm){
				if(oktosend&&(ftype.indexOf("mail")>-1||ftype.indexOf("text")>-1||ftype.indexOf("select")>-1) ){ fs[i].select(); }
				oktosend=false;
				fs[i].onclick=rmErrorClass; fs[i].onkeydown=rmErrorClass;
				reqelm.addClass("error");
			}

		}//end filter fs
	}//end for i in fs
	//	}
	return oktosend;

}

function rmErrorClass(event){
	var elm=this;var etag=FindTagClassUp(elm,".error","form");if(!etag){etag=FindTagClassUp(elm,".field","form");};if(!etag){etag=elm}
	if(etag){
		etag.removeClass("error");
		elm.onclick=null;elm.onfocus=null;elm.onkeyup=null}
}

function isValidField(t,k){
	if(k=="email"){
		if( t.indexOf("@example.com")>-1){return false;};
		var emailFilter=/^.+@.+\..{2,}$/;
		var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
		if(!(emailFilter.test(t))||t.match(illegalChars)){return(false);}else{return (true);}
		return false
	}//end email
}

/* --- DOM --- */

function FindTagClassUp(elm,tcsearch,tclimit){ // for mootools
	var elm= $(elm);
	var tc=( tcsearch+"." ).split("."); tc[0]=tc[0].toUpperCase();
	if(!tclimit){tclimit="BODY";};
	var tz=( tclimit+"." ).split("."); tz[0]=tz[0].toUpperCase();
	while( n = elm.nodeName ){
		if(tc[0]==""||n==tc[0]){
			if( tc[1]=="" || $(elm).hasClass(tc[1]) ){ return elm; }; };
			if(tz[0]==""||n==tz[0]){
				if( tz[1]=="" || $(elm).hasClass(tz[1]) ){ return false; }; };
				elm=elm.parentNode;
	};
	debug("No se pudo obtener NODENAME para: ",elm);
	return false;
};


function $path(e,c){
	var e=$(e);
	c=c.split(" ");

	for(var i=0;i<c.length;i++){
		var cis = c[i].split(":")
		var num = cis[1]?cis[1]:"0"
		var ci=cis[0]

		if(ci=="<"){
			e=e.parentNode;
		}else if(ci.charAt(0)=="#"){
			e=$( ci.substring(1) );
			if(!e){return false;};
		}else if(ci.charAt(0)=="."){
			var a=e.childNodes;var t=ci.substring(1);var d=false;
			for(var b=0;b<a.length;b++){
				if(a[b].hasClass(t)){d=a[b];break;};
			};
			if(d){e=d;}else{return false;};
		}else if(ci.charAt(0)=="<"){
			e=FindTagClassUp(e.parentNode,ci.substring(1),"BODY");
			if(!e){return false;};
		}else{
			var a = e.getElementsByTagName( ci.toLowerCase() );
			if(a.length>0){
				if(num=="0"){e=a[0];
				}else if(num=="last"||num>a.length){
					e=a[a.length-1]
				}else{
					e=a[num]
				}
			}else{
				var a = document.getElementsByName(ci);
				if( a[0] ){ e=a[0]; }else{return false;};
			};
		};
	};
	return e;
};

//caja de busqueda
function Buscar() {
	var keyword = $('KEYWORD');
	var form	= $('BUS_POS');
	rmHint(keyword);
	if (keyword.value == ''){
		window.location = '/aplicantes/listado_postings_completo.html';
		//form.action = '/aplicantes/listado_postings_completo.html';
		//form.method = 'POST';
		return false;
	}else{
		form.action = '/aplicantes/a_listadopostings.ngmf';
		form.method = 'GET';
		return true;
	}
}

//caja de Avisos Similares AJAX
function CargarSimilares(idaviso){

	var  divRespuesta = $('avisosSimilares');
	//valido que exista el div que va a contener la respuesta
	if($chk(divRespuesta)) {
		var url = "/presentacion/avisos/client/avi_avisossimilaresbox.ngmf?idpost="+idaviso;
		divRespuesta.empty().addClass('ajax-loading');
		divRespuesta.setHTML('<br/><br/>');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
				divRespuesta.removeClass('ajax-loading');
			},
			update: divRespuesta
		}).request();

	}
}

//caja de Avisos Visitados AJAX
function CargarVisitados(idaviso,puesto,empresa){
	var  divRespuesta = $('avisosVisitados');
	//valido que exista el div que va a contener la respuesta
	if($chk(divRespuesta)) {
		var url = '/presentacion/avisos/client/avi_avisosvisitadosbox.ngmf?idpost='+idaviso+'&puesto='+escape(puesto)+'&empresa='+escape(empresa);
		divRespuesta.empty().addClass('ajax-loading');
		divRespuesta.setHTML('<br/><br/>');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
				divRespuesta.removeClass('ajax-loading');
			},
			update: divRespuesta
		}).request();

	}
}

//funcion para contar vistas de un posting por ajax
function ContarVistaAviso(idaviso) {
	var url = '/aplicantes/a_posting_count.ngmf?idpost='+idaviso;
	new Ajax(url, {
		method: 'get'
	}).request();
}

/***** DIV POPUP ****/

function desplHiddenValues(id){
	var obj = document.getElementById(id).style;
	if(obj.display=='none'||obj .display==''){
		obj .display = 'block';
	}else{
		obj .display = 'none';
	}
}


function openWindow(windowID,link){
	var loadingDiv = document.getElementById( windowID );

	var cwidth = "415";
	var cheight= "320";

	var cleft = 170;
	var ctop = 150;

	if( loadingDiv.style.setAttribute ){ //IE

		loadingDiv.style.setAttribute('position',	'absolute');
		loadingDiv.style.setAttribute('left', parseInt(cleft));
		loadingDiv.style.setAttribute('top', parseInt(ctop));
		loadingDiv.style.setAttribute('visibility','visible');

	}else{
		loadingDiv.setAttribute('style',"position:absolute;left:"+cleft+"px;top:"+ctop+"px;visibility:visible");
	}

	shownWindow = loadingDiv;


}

function hideWindow(){
	if (shownWindow == null) return ;
	if( shownWindow.style.setAttribute ){//IE
		shownWindow.style.setAttribute( "visibility" , "hidden" );
	}else{
		shownWindow.setAttribute("style","visibility:hidden;position:absolute");
	}
	shownWindow = null;
}

function setContentLoaded(){
	document.onclick = executeClick;
	contentLoaded = true;
}

function executeClick(e){

	if (window.event) e = window.event;
	var srcEl = e.srcElement? e.srcElement : e.target;
	hideWindowByClick(srcEl);

}

function hideWindowByClick(srcElement){
	var parent=srcElement;
	while( parent != null ){
		if (parent.id == 'shownWindow') return ;
		parent = parent.offsetParent;
	}
	hideWindow();
}


function EnviarValidacion(){
	if(isValidField($('emailValid').value,'email')){
		var  divRespuesta = $('respuestaValidacion');
		var  url = '/aplicantes/a_validaremail.ngmf?emailValid='+$('emailValid').value;
		divRespuesta.empty().addClass('ajax-loading');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
					divRespuesta.removeClass('ajax-loading');
				},
			update: divRespuesta
		}).request();
	}else{
		alert('Su email no parece ser correcto');
	}
}
function EnviarValidacionZona(){

		var  divRespuesta = $('respuestaValidacion');
		var  url = '/aplicantes/a_validarzona.ngmf?zonaValid='+$('zonaValid').value;
		divRespuesta.empty().addClass('ajax-loading');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
					divRespuesta.removeClass('ajax-loading');
				},
			update: divRespuesta
		}).request();

}
function AddOptionToSelect (Value, Field) {
	var Option1 = new Option (Value,Value);
	Field.options[Field.options.length] = Option1;
}
function RemoveAllOptionToSelect (Field) {
	while (Field.options[0] != null) {
		Field.options[0] = null;
	}
}

function AddFromSelectToSelect (SelectionID, DestinationID, RemoveOption, IsMultiple, Max, Msg, Alert) {
	/*
	DL - (26 Agosto 2005)

	RemoveOption.  Si es true, elimina la opci\u00F3n agregada de las opciones de Selection
	IsMultiple.  Boolean.  Si el select tiene la propiedad m\u00FAltiple (selecci\u00F3n m\u00FAltiple) o no.
	Max.  Boolean.  Cantidad m\u00E1xima de opciones en el select destino.  -1 si no hay l\u00EDmite.
	Msg.  String.  Nombre del dato para mostrar en el alert en caso de que se haya llegado a Max.
	Alert.  Boolean.  Para mostrar o no un alert en caso de que se haya llegado a Max.

	*/

	Selection = document.getElementById (SelectionID);
	Destination = document.getElementById (DestinationID);

	if (IsMultiple) {
		//Voy a buscar todos los seleccionados
		for (i=0; i<Selection.options.length; i++) {

			//Encuentro uno seleccionado
			if (Selection.options[i].selected) {

				if (!ChkSelectOptions (Destination, -1, Max, Msg, Alert)) {
					return false;
				}
				else {
					if (AddOptionToSelectAndValidate (Selection, i, Destination, RemoveOption)) {
						//Tengo que disminuir el contador porque la cantidad de opciones ha disminuido
						i--;
					}
				}

			}

		}
	}

	else {
		if (!ChkSelectOptions (Destination, -1, Max, Msg, Alert)) {
			return false;
		}
		else {
			i=Selection.selectedIndex;
			AddOptionToSelectAndValidate (Selection, i, Destination, RemoveOption);
		}
	}
	SortSelectOptions (Destination, 1);

}

function AddOptionToSelectAndValidate (Selection, i, Destination, RemoveOption) {
	/*
	DL (31 de agosto 2005)

	Agrega la opci\u00F3n a un select, pero v\u00E1lida que esa opci\u00F3n no est\u00E9 en el select donde ser\u00E1 copiada.

	*/

	//Voy a buscar si el seleccionado, ya fue agregado anteriormente (validate)
	for (j=0; j<Destination.options.length; j++) {

		//Si el agregado anteriormente es igual al seleccionado, no agrego al seleccionado
		if (Destination.options[j].text == Selection.options[i].text) {
			return false;
		}
	}

	AddOptionToSelect (Selection.options[i].text, Destination);
	//Si hay que eliminar el dato agregado de la lista de opciones
	if (RemoveOption) {
		Selection.options[i] = null;
		return true;
	}

	return false;
}

function RemoveOptionFromSelect (SelectionID, DestinationID, AddOption, IsMultiple) {
	/*
	DL - (26 Agosto 2005)
	Elimina de DestinationId las opciones que est\u00E1n seleccionadas.

	DestinationID.  Id del select del cual se eliminar\u00E1 la opci\u00F3n.
	SelectionID.  Id del select al cual se enviar\u00E1 la opci\u00F3n eliminada.  Si AddOption == false, este parametro no tiene efecto.
	AddOption.  True, agrega la opci\u00F3n eliminada, a las opciones de Selection
	IsMultiple.  Boolean.  Si el select tiene la propiedad m\u00FAltiple (selecci\u00F3n m\u00FAltiple) o no.
	*/
	Selection = document.getElementById (SelectionID);
	Destination = document.getElementById (DestinationID);

	if (IsMultiple) {
		for (i=0; i<Destination.options.length; i++) {
			if (Destination.options[i].selected) {
				if (AddOption) {
					AddOptionToSelect (Destination.options[i].text, Selection);
				}
				Destination.options[i] = null;
				//Tengo que disminuir el contador porque la cantidad de opciones ha disminuido
				i--;
			}

		}
	}
	else {
		if (AddOption) {
			AddOptionToSelect (Destination.options[Destination.selectedIndex].text, Selection);
		}
		Destination.options[Destination.selectedIndex] = null;

	}
	SortSelectOptions (Selection);
}

function SortSelectOptions (Field, SortOptions) {
/*
	DL (31 de agosto 2005)

	Ordena las opciones del select de ascendentemente

	SortOptions est\u00E1 pensado para en un futuro realizar ordenes m\u00E1s complejos.
	Para permitir futuras modificaciones, en este parametro hay que pasar un 1.
	El 1 significar\u00EDa orden ascendente.

*/
	OptionsArray = new Array (0);

	for (i=0; i<Field.options.length; i++) {
		OptionsArray.length += 1;
		OptionsArray[OptionsArray.length-1] = Field.options[i].text;

	}

	OptionsArray=OptionsArray.sort();

	RemoveAllOptionToSelect (Field);

	for (i=0; i<OptionsArray.length; i++) {
		AddOptionToSelect (OptionsArray[i], Field);
	}

}
function ChkSelectOptions (Field, Min, Max, Msg, Alert) {
/*
DL, 31 de Agosto del 2005

Chequea que la cantidad de opciones de un campo select.

Field es el campo select
Min es la cantidad m\u00EDnima de opciones
Max es la cantidad m\u00E1xima de opciones.  Si Max = -1, no hay l\u00EDmite.
Msg es para completar el mensaje de error
Alert es para indicar si mostrar el mensaje de error o no
*/
	if (Max == -1) {
		Max = Field.options.length + 1;
	}
	if (Field.options.length <= Min || Field.options.length >= Max) {
		if (Alert) {
			if (Field.options.length == 0) alert ("Ingrese el dato " + Msg);
			else if (Field.options.length <= Min) alert ("El m\u00EDnimo de opciones del dato " + Msg + " es " + Min);
			else alert ("El m\u00E1ximo de opciones del dato " + Msg + " es " + Max);
			Field.focus();
		}
		return false;
	}

	return true;
}

function ChkEmpty(s,n){
   if (ltrim(s.value)=="")
      alert ("Indique un valor para el dato "+n);
   else return true;
   setFocus(s);
   return false;
}

function ChkRadioEmpty(s,n){
var r=false;
	for (var i in s) {
		alert(s[i].checked)
		if (s[i].checked=="1")
			r = true;
	}
   if (r==false)
      alert ("Indique un valor para el dato "+n);
   else
	return true;

//   s.focus();
   return false;
}

function ChkRadioEmpty2 (Field, Msg) {
/*
DL - (26 agosto 2005)

La funci\u00F3n ChkRadioEmpty no me serv\u00EDa por esta linea:
"alert(s[i].checked)"

Parece que la linea corresponde a alg\u00FAn debug.  No s\u00E9 si alguien la utliza.  Supongo que no.

*/
	i=0;
	entro = false;

	while (Field[i] != null) {
		if (Field[i].checked) entro = true;
		i++;
	}

	if (!entro) {
		alert ("Indique un valor para el dato "+ Msg);
		Field[0].focus();
		return false;
	}
	else return true;
}

function ChkCheck (Field, Msg) {
	entro = false;
	for (i=0;i<Field.length;i++) {
		if (Field[i].checked) entro = true;
	}

	if (!entro) {
		if (Msg != "") {
			alert ("Debe indicar el dato " + Msg);
			Field[0].focus();
		}
		return false;
	}
	return true;
}

function Chk(s,n,re,a,v){
   if (v&ltrim(s.value)=="")
      alert ("Indique un valor para el dato "+n);
   else if (re.test(s.value))
      alert (a+n);
   else return true;
   setFocus(s);
   return false;
}

function ChkID(s,n,v,s2) {
      if (s.value.length<5){
         alert ("El nombre de usuario es corto. Ingrese uno que tenga minimo 5 letras");
         setFocus(s);
         return false;
       }
       else {
       		if (s.value.toLowerCase() == s2.value.toLowerCase()) {
       		    	alert ("El nombre de usuario no puede coincidir con su primer nombre.");
         			setFocus(s);
         			return false;
       		}
       		else {
		          return Chk(s,n,/\W/i,"Indique solo letras y/o n\u00FAmeros en el dato ",v);
       			}
       }
}
function ChkNum(s,n,v) {
   return Chk(s,n,/\D/i,"Indique solo n\u00FAmeros en el dato ",v);
}
function ChkChars(s,n,v) {
   return Chk(s,n,/[^ a-z0-9]/i,"Indique solo letras y/o n\u00FAmeros en el dato ",v);
}
function ChkTel(s,n,v) {
   return Chk(s,n,/[^ \-0-9]/i,"Indique solo n\u00FAmeros en el dato ",v);
}
function ChkMail(m){
   re1=/@/;
   var s=m.value
  // i=s.search(re1);
   i = 0;
	pos = s.indexOf("@");
	pos2 = s.indexOf(",");
	pos3 = s.indexOf(" ");

	while ( pos != -1 ) {
		i++;
		pos = s.indexOf("@",pos+1);
	}

 if (pos2 > 0 || pos3 > 0) {
 	alert("Ingrese una direcci\u00F3n de email correcta.")
 	IsOK=false;
 }
 else {
   	if (i==1) {
     	return true;
   	}
   	else   {
   		if (i<1) {
			alert("Ingrese una direcci\u00F3n de email.")
			IsOK=false;
		}
		else {
			alert("Solo puede ingresar una direcci\u00F3n de email.")
         	 	IsOK=false;
		}
   	 }
   }

 if (IsOK == false) {
   		setFocus(m);
   		return false;
  }
}

function SelectAllList(){

var CANTIDAD = document.getElementById ('CANTIDAD_GCONOCIMIENTOS').value;
var frm = document.ALTA_CURRICULUM;
var Proceso='';
var vacio='SI';
	for (var j = 0;j<CANTIDAD;j++){

		    Proceso = frm['NIVELTO'+j+'[]'];
		    if (Proceso.length > 0) {
	    		vacio='NO';
				for(i=0; i<Proceso.length; ++i) {
		        	Proceso.options[i].selected = true;
	    		}
			}
	}
	if(vacio=='SI'){
		document.getElementById ('cvsigncontext').innerHTML="<p><img src='/images/loginAplicantes/cross.gif'> <strong>Han ocurrido errores</strong><br/><p>Debes seleccionar al menos un conocimiento para acceder al paso 2</p>";
		document.getElementById ('cvsign').style.display="block";

	}else{
		document.ALTA_CURRICULUM.ESTADO_ALTA.value='Siguiente';
		document.ALTA_CURRICULUM.submit();
	}
}

function validar_tecnologias(){
    var seleccion = false;
    var GRUPOS_IDS = document.getElementById ('GRUPOS_IDS_GUARDAR').value;
    GRUPOS_IDS = GRUPOS_IDS.split(",");

    for (var i=0;i<GRUPOS_IDS.length;i++){
        var GRUPO_ID = 'GRUPO_'+GRUPOS_IDS[i];
        var select_grupo = document.getElementById(GRUPO_ID).options;
        for(f = 0; f < select_grupo.length; f++){
            if (select_grupo[f].selected){
                seleccion = true;
            }
        }
    }

    if(!seleccion){
       /* alert('no hay nada seleccionado');*/
       if(document.getElementById ('cvsigncontext')){
        document.getElementById ('cvsigncontext').innerHTML="<p>Debes seleccionar al menos un conocimiento.</p>";
		document.getElementById ('cvsign').style.display="block";
       }else{
         document.getElementById ('errores_tecno_bolsa').innerHTML="<p style='color:red; font-weight:bold;'>Debes seleccionar al menos un conocimiento.</p>";
         document.getElementById ('errores_tecno_bolsa').style.display="block";
       }
    }else{
        document.ALTA_CURRICULUM.submit();
    }

}
function validar_niveles(){

	var cant_total=document.getElementById ('IDTECITEMTOTAL').value;
	var vacio='';
	for (var i=0;i < cant_total;i++ )
	{
		if (!document.getElementById ('NIVELSEL'+i).value)
		{
			vacio='SI';
		}
	}

	if(vacio=='SI'){
		document.getElementById ('cvsigncontext').innerHTML="<p><img src='/images/loginAplicantes/cross.gif'> <strong>Han ocurrido errores</strong><br/><p>Debes indicar el nivel para cada uno de los items que has seleccionado</p>";
		document.getElementById ('cvsign').style.display="block";
	}else{
		document.TECNO2.ACCION.value='GRABAR';
		document.TECNO2.submit();
	}
}
function validar_estudios(accion,codigo){


var error='';
var errores='';

		if (document.ALTA_CURRICULUM.PAIS.value==0)
		{
			errores = errores + "<p>Debe seleccionar un pais</p> ";
			error=1;
		}

		if (document.ALTA_CURRICULUM.TIPODEESTUDIO.value==0)
		{
			errores = errores + "<p>Debe seleccionar un nivel de estudios</p> ";
			error=1;
		}

		if (document.ALTA_CURRICULUM.RESULTADOINST.value == 0 && document.ALTA_CURRICULUM.OTRAINSTITUCION.value=='') {
			errores = errores + "<p>Debe seleccionar una institucion en el caso de encontrarla tipeala en el campo otra</p> ";
			error=1;
		}

		if (document.ALTA_CURRICULUM.RESULTADOINST.value != 0 && document.ALTA_CURRICULUM.OTRAINSTITUCION.value!='') {
			errores = errores + "<p>Solo debe indicar otra institucion en el caso de no poder indicar la institucion desde el combo</p> ";
			error=1;
		}
		if (document.ALTA_CURRICULUM.AREA.value==0)
		{
			errores = errores + "<p>Debe seleccionar un area de estudios</p> ";
			error=1;
		}
		if (document.ALTA_CURRICULUM.OTROTITULO.value=='')
		{
			errores = errores + "<p>Debe indicar un titulo</p> ";
			error=1;
		}
		if(document.ALTA_CURRICULUM.FINICIO_A.value=='0' || document.ALTA_CURRICULUM.FINICIO_M.value=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
		if(document.ALTA_CURRICULUM.FINICIO_A.value=='0' && document.ALTA_CURRICULUM.FINICIO_M.value!='0' || document.ALTA_CURRICULUM.FINICIO_A.value!='0' && document.ALTA_CURRICULUM.FINICIO_M.value=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}

		if(document.ALTA_CURRICULUM.FFIN_A.value=='0' && document.ALTA_CURRICULUM.FFIN_M.value!='0' || document.ALTA_CURRICULUM.FFIN_A.value!='0' && document.ALTA_CURRICULUM.FFIN_M.value=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}
		if (document.ALTA_CURRICULUM.MATERIASCARRERA.value=='')
		{
			errores = errores + "<p>Debe indicar la cantidad de materias de la carrera</p> ";
			error=1;
		}
		if (!IsNumeric(document.ALTA_CURRICULUM.MATERIASCARRERA.value))
		{
			errores = errores + "<p>El campo cantidad de materias de la carrera solo debe contener n&uacute;meros</p> ";
			error=1;
		}
		if (!IsNumeric(document.ALTA_CURRICULUM.MATERIASAPROBADAS.value))
		{
			errores = errores + "<p>El campo cantidad de materias aprobadas solo debe contener n&uacute;meros</p> ";
			error=1;
		}
		if (document.ALTA_CURRICULUM.MATERIASAPROBADAS.value=='')
		{
			errores = errores + "<p>Debe indicar la cantidad de materias aprobadas de la carrera</p> ";
			error=1;
		}
		if (document.ALTA_CURRICULUM.PROMEDIO.value!='' && document.ALTA_CURRICULUM.RANGOS.value==0)
		{
			errores = errores + "<p>Al indicar un promedio debe especificar un rango para ese promedio</p> ";
			error=1;
		}
		if (document.ALTA_CURRICULUM.PROMEDIO.value=='' && document.ALTA_CURRICULUM.RANGOS.value!=0)
		{
			errores = errores + "<p>Debe indicar el promedio para ese rango</p> ";
			error=1;
		}

        if (document.ALTA_CURRICULUM.PROMEDIO.value!='' && document.ALTA_CURRICULUM.RANGOS.value!=0)
		{
            switch(document.ALTA_CURRICULUM.RANGOS.value)
            {
                case "10":
                    if (!IsNumeric(document.ALTA_CURRICULUM.PROMEDIO.value)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (document.ALTA_CURRICULUM.PROMEDIO.value<0 || document.ALTA_CURRICULUM.PROMEDIO.value>10) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 10</p> ";
                            error=1;
                        }
                    }
                break;
                case "11":
                    if (!IsNumeric(document.ALTA_CURRICULUM.PROMEDIO.value)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (document.ALTA_CURRICULUM.PROMEDIO.value<0 || document.ALTA_CURRICULUM.PROMEDIO.value >100) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 100</p> ";
                            error=1;
                        }
                    }
                break;
                case "12":
                    var PROMEDIO_MAYUSCULA;
                    PROMEDIO_MAYUSCULA = document.ALTA_CURRICULUM.PROMEDIO.value.toUpperCase();
                    switch(PROMEDIO_MAYUSCULA) {
                        case 'A':   break;
                        case 'A+':  break;
                        case 'A-':  break;
                        case 'B':   break;
                        case 'B+':  break;
                        case 'B-':  break;
                        case 'C':   break;
                        case 'C+':  break;
                        case 'C-':  break;
                        case 'D':   break;
                        case 'D+':  break;
                        case 'D-':  break;
                        case 'E':   break;
                        case 'E+':  break;
                        case 'E-':  break;
                        case 'F':   break;
                        case 'F+':  break;
                        case 'F-':  break;
                        default:
                            errores = errores + "<p>Debe ingresar una letra en promedio en el rango de A a F</p> ";
                            error=1;
                    }
                break;
                case "13":
                    if (!IsNumeric(document.ALTA_CURRICULUM.PROMEDIO.value)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (document.ALTA_CURRICULUM.PROMEDIO.value<0 || document.ALTA_CURRICULUM.PROMEDIO.value >7) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 7</p> ";
                            error=1;
                        }
                    }
                break;
                case "14":
                    if (!IsNumeric(document.ALTA_CURRICULUM.PROMEDIO.value)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (document.ALTA_CURRICULUM.PROMEDIO.value<0 || document.ALTA_CURRICULUM.PROMEDIO.value >5) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 5</p> ";
                            error=1;
                        }
                    }
                break;
                case "15":
                    if (!IsNumeric(document.ALTA_CURRICULUM.PROMEDIO.value)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (document.ALTA_CURRICULUM.PROMEDIO.value<0 || document.ALTA_CURRICULUM.PROMEDIO.value >20) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 20</p> ";
                            error=1;
                        }
                    }
                break;
            }

        }

		if (error)
		{
			var alerta= '';

				alerta = "<br/>" + errores;


                if (document.getElementById ('cvsign')){
                    document.getElementById('cvsigncontext').innerHTML= alerta;
                    document.getElementById ('cvsign').style.display="block";
                }
                if (document.getElementById ('cvsignestu')){
                    document.getElementById('cvsigncontextestu').innerHTML= alerta;
                    document.getElementById ('cvsignestu').style.display="block";
                }


		}else {
                if (document.getElementById ('cvsign')){
                    document.getElementById('cvsigncontext').innerHTML= "";
                    document.getElementById ('cvsign').style.display="none";
                }
                if (document.getElementById ('cvsignestu')){
                    document.getElementById('cvsigncontextestu').innerHTML= "";
                    document.getElementById ('cvsignestu').style.display="none";
                }


                OTRAINSTITUCION = document.ALTA_CURRICULUM.OTRAINSTITUCION.value.replace(/&/g, "%26");
                OTROTITULO = document.ALTA_CURRICULUM.OTROTITULO.value.replace(/&/g, "%26");

				var campos=document.ALTA_CURRICULUM.PAIS.value;
				campos=campos +'|'+document.ALTA_CURRICULUM.TIPODEESTUDIO.value +'|'+document.ALTA_CURRICULUM.RESULTADOINST.value;
				campos=campos +'|'+OTRAINSTITUCION;
				campos=campos +'|'+document.ALTA_CURRICULUM.AREA.value+'|'+OTROTITULO;
				campos=campos +'|'+document.ALTA_CURRICULUM.FINICIO_A.value+'|'+document.ALTA_CURRICULUM.FINICIO_M.value+'|'+document.ALTA_CURRICULUM.FFIN_A.value+'|'+document.ALTA_CURRICULUM.FFIN_M.value;
				campos=campos +'|'+document.ALTA_CURRICULUM.MATERIASCARRERA.value+'|'+document.ALTA_CURRICULUM.MATERIASAPROBADAS.value;
				campos=campos +'|'+document.ALTA_CURRICULUM.PROMEDIO.value+'|'+document.ALTA_CURRICULUM.RANGOS.value;
				//Debug  alert(campos);

				switch(accion){
					case 'A':
							accion_ajax ("POST","estudios_ajax.ngmf","callback_guardar_estudios","campos="+campos+"&accion="+accion);
                            document.getElementById('cvsign').style.display = 'none';
				            break;
                    case 'X':
                            accion_ajax ("POST","/aplicantes/estudios_ajax.ngmf","callback_guardar_estudios_postulantes","campos="+campos+"&accion="+accion);
                            break;
				}
		}

}

function validar_estudios_modificar(codigo,numeroformulario){

var accion='M';
var error='';
var errores='';

var PAIS = document.getElementById('PAIS'+numeroformulario).options[document.getElementById('PAIS'+numeroformulario).selectedIndex].value;
var TIPODEESTUDIO = document.getElementById('TIPODEESTUDIO'+numeroformulario).options[document.getElementById('TIPODEESTUDIO'+numeroformulario).selectedIndex].value;
var RESULTADOINST = document.getElementById('RESULTADOINST'+numeroformulario).options[document.getElementById('RESULTADOINST'+numeroformulario).selectedIndex].value;
var OTRAINSTITUCION = document.getElementById('OTRAINSTITUCION'+numeroformulario).value;
var AREA = document.getElementById('AREA'+numeroformulario).options[document.getElementById('AREA'+numeroformulario).selectedIndex].value;
var OTROTITULO = document.getElementById('OTROTITULO'+numeroformulario).value;
var FINICIO_A = document.getElementById('FINICIO_A'+numeroformulario).options[document.getElementById('FINICIO_A'+numeroformulario).selectedIndex].value;
var FINICIO_M = document.getElementById('FINICIO_M'+numeroformulario).options[document.getElementById('FINICIO_M'+numeroformulario).selectedIndex].value;
var FFIN_A = document.getElementById('FFIN_A'+numeroformulario).options[document.getElementById('FFIN_A'+numeroformulario).selectedIndex].value;
var FFIN_M = document.getElementById('FFIN_M'+numeroformulario).options[document.getElementById('FFIN_M'+numeroformulario).selectedIndex].value;
var MATERIASCARRERA = document.getElementById('MATERIASCARRERA'+numeroformulario).value;
var MATERIASAPROBADAS = document.getElementById('MATERIASAPROBADAS'+numeroformulario).value;
var PROMEDIO = document.getElementById('PROMEDIO'+numeroformulario).value;
var RANGOS = document.getElementById('RANGOS'+numeroformulario).options[document.getElementById('RANGOS'+numeroformulario).selectedIndex].value;


		if (PAIS==0)
		{
			errores = errores + "<p>Debe seleccionar un pais</p> ";
			error=1;
		}

		if (TIPODEESTUDIO==0)
		{
			errores = errores + "<p>Debe seleccionar un nivel de estudios</p> ";
			error=1;
		}

		if (RESULTADOINST == 0 && OTRAINSTITUCION=='') {
			errores = errores + "<p>Debe seleccionar una institucion en el caso de encontrarla tipeala en el campo otra</p> ";
			error=1;
		}

		if (RESULTADOINST != 0 && OTRAINSTITUCION!='') {
			errores = errores + "<p>Solo debe indicar otra institucion en el caso de no poder indicar la institucion desde el combo</p> ";
			error=1;
		}
        if (AREA==0)
		{
			errores = errores + "<p>Debe seleccionar un area de estudios</p> ";
			error=1;
		}
        if (OTROTITULO=='')
		{
			errores = errores + "<p>Debe indicar un titulo</p> ";
			error=1;
		}
        if(FINICIO_A=='0' || FINICIO_M=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
        if(FINICIO_A=='0' && FINICIO_M!='0' || FINICIO_A!='0' && FINICIO_M=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
        if(FFIN_A=='0' && FFIN_M!='0' || FFIN_A!='0' && FFIN_M=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}
        if (MATERIASCARRERA=='')
		{
			errores = errores + "<p>Debe indicar la cantidad de materias de la carrera</p> ";
			error=1;
		}
        if (!IsNumeric(MATERIASCARRERA))
		{
			errores = errores + "<p>El campo cantidad de materias de la carrera solo debe contener n&uacute;meros</p> ";
			error=1;
		}
        if (!IsNumeric(MATERIASAPROBADAS))
		{
			errores = errores + "<p>El campo cantidad de materias aprobadas solo debe contener n&uacute;meros</p> ";
			error=1;
		}
        if (MATERIASAPROBADAS=='')
		{
			errores = errores + "<p>Debe indicar la cantidad de materias aprobadas de la carrera</p> ";
			error=1;
		}
        if (PROMEDIO!='' && RANGOS==0)
		{
			errores = errores + "<p>Al indicar un promedio debe especificar un rango para ese promedio</p> ";
			error=1;
		}
        if (PROMEDIO=='' && RANGOS!=0)
		{
			errores = errores + "<p>Debe imdicar el promedio para ese rango</p> ";
			error=1;
		}

        if (PROMEDIO!='' && RANGOS!=0)
		{
            switch(RANGOS)
            {
                case "10":
                    if (!IsNumeric(PROMEDIO)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (PROMEDIO<0 || PROMEDIO>10) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 10</p> ";
                            error=1;
                        }
                    }
                break;
                case "11":
                    if (!IsNumeric(PROMEDIO)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (PROMEDIO<0 || PROMEDIO >100) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 100</p> ";
                            error=1;
                        }
                    }
                break;
                case "12":
                    var PROMEDIO_MAYUSCULA;
                    PROMEDIO_MAYUSCULA = PROMEDIO.toUpperCase();
                    switch(PROMEDIO_MAYUSCULA) {
                        case 'A':   break;
                        case 'A+':  break;
                        case 'A-':  break;
                        case 'B':   break;
                        case 'B+':  break;
                        case 'B-':  break;
                        case 'C':   break;
                        case 'C+':  break;
                        case 'C-':  break;
                        case 'D':   break;
                        case 'D+':  break;
                        case 'D-':  break;
                        case 'E':   break;
                        case 'E+':  break;
                        case 'E-':  break;
                        case 'F':   break;
                        case 'F+':  break;
                        case 'F-':  break;
                        default:
                            errores = errores + "<p>Debe ingresar una letra en promedio en el rango de A a F</p> ";
                            error=1;
                    }
                break;
                case "13":
                    if (!IsNumeric(PROMEDIO)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (PROMEDIO<0 || PROMEDIO >7) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 7</p> ";
                            error=1;
                        }
                    }
                break;
                case "14":
                    if (!IsNumeric(PROMEDIO)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (PROMEDIO<0 || PROMEDIO >5) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 5</p> ";
                            error=1;
                        }
                    }
                break;
                case "15":
                    if (!IsNumeric(PROMEDIO)) {
                        errores = errores + "<p>Debe ingresar un numero en promedio para ese rango</p> ";
                        error=1;
                    } else {
                        if (PROMEDIO<0 || PROMEDIO >20) {
                            errores = errores + "<p>Debe ingresar un numero en promedio en el rango de 1 a 20</p> ";
                            error=1;
                        }
                    }
                break;
            }

        }


		if (error)
		{

			var alerta= '';

				alerta = "<br/>" + errores;
				document.getElementById('cvsigncontext').innerHTML= alerta;
				document.getElementById ('cvsign').style.display="block";
		}else {

				document.getElementById('cvsigncontext').innerHTML= "";
				document.getElementById ('cvsign').style.display="none";
                OTRAINSTITUCION = OTRAINSTITUCION.replace(/&/g, "%26");
                OTROTITULO = OTROTITULO.replace(/&/g, "%26");
				var campos=PAIS;
				campos=campos +'|'+TIPODEESTUDIO +'|'+RESULTADOINST;
				campos=campos +'|'+OTRAINSTITUCION;
				campos=campos +'|'+AREA+'|'+OTROTITULO;
				campos=campos +'|'+FINICIO_A+'|'+FINICIO_M+'|'+FFIN_A+'|'+FFIN_M;
				campos=campos +'|'+MATERIASCARRERA+'|'+MATERIASAPROBADAS;
				campos=campos +'|'+PROMEDIO+'|'+RANGOS;
				//Debug  alert(campos);

				document.getElementById('formulario_estudios').style.display = 'block';
                accion_ajax ("POST","estudios_ajax.ngmf","callback_estudios_modificar","campos="+campos+"&codigo="+codigo+"&accion="+accion);



		}

}

function callback_estudios_modificar(){
        document.getElementById('cargar_nuevo').style.display = 'none';
        if (xml.readyState==1){
            document.getElementById('CargandoEstudios').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:40%; font-size:14px;">Cargando Estudios</p>';
        }
        if (xml.readyState==4 && xml.status==200){

           Refresh_EstudiosCargados();

        }




  }

function validar_experiencias(accion,codigo){
var error='';
var errores='';

		if (document.ALTA_EXPERIENCIA.PAIS.value==0)
		{
			errores = errores + "<p>Debe seleccionar un pais</p> ";
			error=1;
		}

		if (trim(document.ALTA_EXPERIENCIA.OTRAEMPRESA.value)=='') {
			errores = errores + "<p>Debe indicar el nombre de la empresa</p> ";
			error=1;
		}

		if (trim(document.ALTA_EXPERIENCIA.PUESTO.value)=='')
		{
			errores = errores + "<p>Debe indicar el nombre del puesto</p> ";
			error=1;
		}

		if (document.ALTA_EXPERIENCIA.PUESTOCOMBO.value == 0) {
			errores = errores + "<p>Debe seleccionar el tipo de puesto</p> ";
			error=1;
		}
		if (document.ALTA_EXPERIENCIA.AREA.value==0)
		{
			errores = errores + "<p>Debe seleccionar el area de la experiencia</p> ";
			error=1;
		}
		if (document.ALTA_EXPERIENCIA.INDUSTRIA.value==0)
		{
			errores = errores + "<p>Debe seleccionar la industria de la experiencia</p> ";
			error=1;
		}
		if(document.ALTA_EXPERIENCIA.FINICIO_A.value=='0' || document.ALTA_EXPERIENCIA.FINICIO_M.value=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
		if(document.ALTA_EXPERIENCIA.FINICIO_A.value=='0' && document.ALTA_EXPERIENCIA.FINICIO_M.value!='0' || document.ALTA_EXPERIENCIA.FINICIO_A.value!='0' && document.ALTA_EXPERIENCIA.FINICIO_M.value=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}

		if(document.ALTA_EXPERIENCIA.FFIN_A.value=='0' && document.ALTA_EXPERIENCIA.FFIN_M.value!='0' || document.ALTA_EXPERIENCIA.FFIN_A.value!='0' && document.ALTA_EXPERIENCIA.FFIN_M.value=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}
		if(document.ALTA_EXPERIENCIA.FFIN_A.value=='0' && document.ALTA_EXPERIENCIA.FFIN_M.value!='0' || document.ALTA_EXPERIENCIA.FFIN_A.value!='0' && document.ALTA_EXPERIENCIA.FFIN_M.value=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}
		if(document.ALTA_EXPERIENCIA.PERSONASACARGO.value && !IsNumeric(document.ALTA_EXPERIENCIA.PERSONASACARGO.value)){
			errores = errores + "<p>El campo de personas a cargo debe ser numerico </p>";
			error=1;
		}
		var str=document.ALTA_EXPERIENCIA.DESCRIPCION.value;
		if (str.search(/<[^>]+>/g) != -1)
		{
			errores = errores + "<p>No se permite ingresar etiquetas HTML en la descripci&oacute;n </p>";
			error=1;
		}

		if (error)
		{
			var alerta= '';

				alerta = "<br/>"+errores;


                if(document.getElementById ('cvsign')){
                    document.getElementById('cvsigncontext').innerHTML= alerta;
                    document.getElementById ('cvsign').style.display="block";
                }
                if (document.getElementById ('cvsignexpe')){
                    document.getElementById('cvsigncontextexpe').innerHTML= alerta;
                    document.getElementById ('cvsignexpe').style.display="block";
                }
		}else {
                if(document.getElementById ('cvsign')){
                    document.getElementById('cvsigncontext').innerHTML='';
                    document.getElementById ('cvsign').style.display="none";
                }
                if (document.getElementById ('cvsignexpe')){
                    document.getElementById('cvsigncontextexpe').innerHTML= '';
                    document.getElementById ('cvsignexpe').style.display="none";
                }


         var campos=document.ALTA_EXPERIENCIA.PAIS.value;
				//////////
				// Se "emprolija" el get con un metodo vulgar para disminuir la cantidad de errores actuales en las transacciones cuando llega un &
				// TO DO: Mejorar esta funcion.....
				EMPRESA = document.ALTA_EXPERIENCIA.OTRAEMPRESA.value.replace(/&/g, "%26");
				PUESTO = document.ALTA_EXPERIENCIA.PUESTO.value.replace(/&/g, "%26");
				DESCRIPCION = document.ALTA_EXPERIENCIA.DESCRIPCION.value.replace(/&/g, "%26");
				campos=campos +'|'+EMPRESA +'|'+PUESTO;
				campos=campos +'|'+document.ALTA_EXPERIENCIA.PUESTOCOMBO.value;
				campos=campos +'|'+document.ALTA_EXPERIENCIA.AREA.value+'|'+document.ALTA_EXPERIENCIA.INDUSTRIA.value;
				campos=campos +'|'+document.ALTA_EXPERIENCIA.FINICIO_A.value+'|'+document.ALTA_EXPERIENCIA.FINICIO_M.value+'|'+document.ALTA_EXPERIENCIA.FFIN_A.value+'|'+document.ALTA_EXPERIENCIA.FFIN_M.value;
				campos=campos +'|'+document.ALTA_EXPERIENCIA.PERSONASACARGO.value+'|'+document.ALTA_EXPERIENCIA.MANEJAPRESUPUESTO.value;
				campos=campos +'|'+DESCRIPCION;
                campos=campos +'|'+document.ALTA_EXPERIENCIA.SENORITY.value;
	/*Debug			alert(campos);*/
				switch(accion){
					case 'A':
							accion_ajax ("POST","experiencias_ajax.ngmf","callback_guardar_experiencias","campos="+campos+"&accion="+accion);
                            document.getElementById('cvsign').style.display = 'none';
				            break;
                    case 'X':
							accion_ajax ("POST","/aplicantes/experiencias_ajax.ngmf","callback_guardar_experiencias_postulantes","campos="+campos+"&codigo="+codigo+"&accion="+accion);
				            break;
				}
		}

}

function validar_experiencias_modificar(codigo,numeroformulario){

var accion='M';
var error='';
var errores='';

var PAIS = document.getElementById('PAIS'+numeroformulario).options[document.getElementById('PAIS'+numeroformulario).selectedIndex].value;
var OTRAEMPRESA = document.getElementById('OTRAEMPRESA'+numeroformulario).value;
var PUESTO = document.getElementById('PUESTO'+numeroformulario).value;
var PUESTOCOMBO = document.getElementById('PUESTOCOMBO'+numeroformulario).options[document.getElementById('PUESTOCOMBO'+numeroformulario).selectedIndex].value;
var SENORITY = document.getElementById('SENORITY'+numeroformulario).value;
var AREA = document.getElementById('AREA'+numeroformulario).options[document.getElementById('AREA'+numeroformulario).selectedIndex].value;
var INDUSTRIA = document.getElementById('INDUSTRIA'+numeroformulario).options[document.getElementById('INDUSTRIA'+numeroformulario).selectedIndex].value;
var FINICIO_A = document.getElementById('FINICIO_A'+numeroformulario).options[document.getElementById('FINICIO_A'+numeroformulario).selectedIndex].value;
var FINICIO_M = document.getElementById('FINICIO_M'+numeroformulario).options[document.getElementById('FINICIO_M'+numeroformulario).selectedIndex].value;
var FFIN_A = document.getElementById('FFIN_A'+numeroformulario).options[document.getElementById('FFIN_A'+numeroformulario).selectedIndex].value;
var FFIN_M = document.getElementById('FFIN_M'+numeroformulario).options[document.getElementById('FFIN_M'+numeroformulario).selectedIndex].value;
var PERSONASACARGO = document.getElementById('PERSONASACARGO'+numeroformulario).value;
var DESCRIPCION = document.getElementById('DESCRIPCION'+numeroformulario).value;
var MANEJAPRESUPUESTO = document.getElementById('MANEJAPRESUPUESTO'+numeroformulario).checked;
if(MANEJAPRESUPUESTO){
    MANEJAPRESUPUESTO=1;
}else{
    MANEJAPRESUPUESTO=0;
}

		if (PAIS==0)
		{
			errores = errores + "<p>Debe seleccionar un pais</p> ";
			error=1;
		}

		if (trim(OTRAEMPRESA)=='') {
			errores = errores + "<p>Debe indicar el nombre de la empresa</p> ";
			error=1;
		}

		if (trim(PUESTO)=='')
		{
			errores = errores + "<p>Debe indicar el nombre del puesto</p> ";
			error=1;
		}

		if (PUESTOCOMBO == 0) {
			errores = errores + "<p>Debe seleccionar el tipo de puesto</p> ";
			error=1;
		}
		if (AREA==0)
		{
			errores = errores + "<p>Debe seleccionar el area de la experiencia</p> ";
			error=1;
		}
		if (INDUSTRIA==0)
		{
			errores = errores + "<p>Debe seleccionar la industria de la experiencia</p> ";
			error=1;
		}
		if(FINICIO_A=='0' || FINICIO_M=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
		if(FINICIO_A=='0' && FINICIO_M!='0' || FINICIO_A!='0' && FINICIO_M=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}

		if(FFIN_A=='0' && FFIN_M!='0' || FFIN_A!='0' && FFIN_M=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}
		if(FFIN_A=='0' && FFIN_M!='0' || FFIN_A!='0' && FFIN_M=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}
		if(PERSONASACARGO && !IsNumeric(PERSONASACARGO)){
			errores = errores + "<p>El campo de personas a cargo debe ser numerico </p>";
			error=1;
		}
		var str=DESCRIPCION;
		if (str.search(/<[^>]+>/g) != -1)
		{
			errores = errores + "<p>No se permite ingresar etiquetas HTML en la descripci&oacute;n </p>";
			error=1;
		}

		if (error)
		{
			var alerta= '';

				alerta = "<br/>" + errores;
				document.getElementById('cvsigncontext').innerHTML= alerta;
				document.getElementById ('cvsign').style.display="block";
		}else {

				document.getElementById('cvsigncontext').innerHTML='';
				document.getElementById ('cvsign').style.display="none";

         var campos=PAIS;
				//////////
				// Se "emprolija" el get con un m�todo vulgar para disminuir la cantidad de errores actuales en las transacciones cuando llega un &
				// TO DO: Mejorar esta funcion.....
				EMPRESA = OTRAEMPRESA.replace(/&/g, "%26");
				PUESTO = PUESTO.replace(/&/g, "%26");
				DESCRIPCION = DESCRIPCION.replace(/&/g, "%26");
				campos=campos +'|'+EMPRESA +'|'+PUESTO;
				campos=campos +'|'+PUESTOCOMBO;
                campos=campos +'|'+AREA+'|'+INDUSTRIA;
				campos=campos +'|'+FINICIO_A+'|'+FINICIO_M+'|'+FFIN_A+'|'+FFIN_M;
				campos=campos +'|'+PERSONASACARGO+'|'+MANEJAPRESUPUESTO;
				campos=campos +'|'+DESCRIPCION;
                campos=campos +'|'+SENORITY;
                /*Debug alert(campos);*/
                document.getElementById('formulario_experiencia').style.display = 'block';
				accion_ajax ("POST","experiencias_ajax.ngmf","callback_experiencias_modificar","campos="+campos+"&codigo="+codigo+"&accion="+accion);
		}

}

function callback_experiencias_modificar(){
        document.getElementById('cargar_nuevo').style.display = 'none';
        if (xml.readyState==1){
            document.getElementById('CargandoExperiencias').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:38%; font-size:14px;">Cargando Experiencias</p>';
        }
        if (xml.readyState==4 && xml.status==200){

           Refresh_ExperienciaCargados();

        }




  }

function validar_cursos(accion,codigo){
var error='';
var errores='';

		if(document.ALTA_CONOCIMIENTOS.FINICIO_A.value=='0' || document.ALTA_CONOCIMIENTOS.FINICIO_M.value=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
		if(document.ALTA_CONOCIMIENTOS.FINICIO_A.value=='0' && document.ALTA_CONOCIMIENTOS.FINICIO_M.value!='0' || document.ALTA_CONOCIMIENTOS.FINICIO_A.value!='0' && document.ALTA_CONOCIMIENTOS.FINICIO_M.value=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}

		if(document.ALTA_CONOCIMIENTOS.FFIN_A.value=='0' && document.ALTA_CONOCIMIENTOS.FFIN_M.value!='0' || document.ALTA_CONOCIMIENTOS.FFIN_A.value!='0' && document.ALTA_CONOCIMIENTOS.FFIN_M.value=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}

		if (document.ALTA_CONOCIMIENTOS.PAIS.value==0)
		{
			errores = errores + "<p>Debe seleccionar un pais</p> ";
			error=1;
		}
		if (document.ALTA_CONOCIMIENTOS.TITULO.value=="")
		{
			errores = errores + "<p>Debe indicar el nombre del curso</p>";
			error=1;

		}
	    if(!document.ALTA_CONOCIMIENTOS.CERTIFICACION[0].checked && !document.ALTA_CONOCIMIENTOS.CERTIFICACION[1].checked){
			errores = errores + "<p>Debe indicar si tiene certificaci&oacute;n </p>";
			error=1;
		}
		if (document.ALTA_CONOCIMIENTOS.DESCRIPCION.value=="")
		{
			errores = errores + "<p>Debe indicar una descripcion </p>";
			error=1;
		}
		var str=document.ALTA_CONOCIMIENTOS.DESCRIPCION.value;
		if (str.search(/<[^>]+>/g) != -1)
		{
			errores = errores + "<p>No se permite ingresar etiquetas HTML en la descripci&oacute;n </p>";
			error=1;
		}
		if (error)
		{
			var alerta= '';

				alerta = '<br/>' + errores;
				document.getElementById('cvsigncontext').innerHTML= alerta;
				document.getElementById ('cvsign').style.display="block";
		}else {

				document.getElementById('cvsigncontext').innerHTML= '';
				document.getElementById ('cvsign').style.display="none";

            TITULO = document.ALTA_CONOCIMIENTOS.TITULO.value.replace(/&/g, "%26");
            DESCRIPCION = document.ALTA_CONOCIMIENTOS.DESCRIPCION.value.replace(/&/g, "%26");

			var campos=TITULO;

				  for(var i=0; i <document.ALTA_CONOCIMIENTOS.CERTIFICACION.length; i++){
					    if(document.ALTA_CONOCIMIENTOS.CERTIFICACION[i].checked){
						      var certificacion = document.ALTA_CONOCIMIENTOS.CERTIFICACION[i].value;
					    }
				  }

				campos=campos +'|'+document.ALTA_CONOCIMIENTOS.PAIS.value +'|'+certificacion;
				campos=campos +'|'+DESCRIPCION+'|'+document.ALTA_CONOCIMIENTOS.FINICIO_A.value;
				campos=campos +'|'+ document.ALTA_CONOCIMIENTOS.FINICIO_M.value+'|'+document.ALTA_CONOCIMIENTOS.FFIN_A.value+'|'+document.ALTA_CONOCIMIENTOS.FFIN_M.value;
			/*Debug	alert(campos);*/
				switch(accion){
					case 'M':
							//accion_ajax ("POST","conoc_abiertos_ajax.ngmf","callback_cursos","campos="+campos+"&codigo="+codigo+"&accion="+accion);
				            break;
					case 'A':
							accion_ajax ("POST","conoc_abiertos_ajax.ngmf","callback_cursos","campos="+campos+"&accion="+accion);
                            document.getElementById('cvsign').style.display = 'none';
				            break;
				}
		}

}

function validar_cursos_modificar(codigo,numeroformulario){

var accion='M';
var error='';
var errores='';
var FINICIO_A = document.getElementById('FINICIO_A'+numeroformulario).options[document.getElementById('FINICIO_A'+numeroformulario).selectedIndex].value;
var FINICIO_M = document.getElementById('FINICIO_M'+numeroformulario).options[document.getElementById('FINICIO_M'+numeroformulario).selectedIndex].value;
var FFIN_A = document.getElementById('FFIN_A'+numeroformulario).options[document.getElementById('FFIN_A'+numeroformulario).selectedIndex].value;
var FFIN_M = document.getElementById('FFIN_M'+numeroformulario).options[document.getElementById('FFIN_M'+numeroformulario).selectedIndex].value;
var PAIS = document.getElementById('PAIS'+numeroformulario).options[document.getElementById('PAIS'+numeroformulario).selectedIndex].value;
var TITULO = document.getElementById('TITULO'+numeroformulario).value;
var DESCRIPCION = document.getElementById('DESCRIPCION'+numeroformulario).value;
var CERTIFICACIONSI = document.getElementById('CERTIFICACIONSI'+numeroformulario).checked;
var CERTIFICACIONNO = document.getElementById('CERTIFICACIONNO'+numeroformulario).checked;

        if(FINICIO_A=='0' || FINICIO_M=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}
		if(FINICIO_A=='0' && FINICIO_M!='0' || FINICIO_A!='0' && FINICIO_M=='0')
		{
			errores = errores + "<p>La fecha de inicio no es valida </p>";
			error=1;
		}

		if(FFIN_A=='0' && FFIN_M!='0' || FFIN_A!='0' && FFIN_M=='0')
		{
			errores = errores + "<p>La fecha de fin no es valida </p>";
			error=1;

		}

		if (PAIS==0)
		{
			errores = errores + "<p>Debe seleccionar un pais</p> ";
			error=1;
		}
		if (TITULO=="")
		{
			errores = errores + "<p>Debe indicar el nombre del curso</p>";
			error=1;

		}
	    /*if(!CERTIFICACION[0].checked && !CERTIFICACION[1].checked){
			errores = errores + "<p>Debe indicar si tiene certificaci&oacute;n </p>";
			error=1;
		}*/

        if(!CERTIFICACIONSI && !CERTIFICACIONNO){
			errores = errores + "<p>Debe indicar si tiene certificaci&oacute;n </p>";
			error=1;
        }

		if (DESCRIPCION=="")
		{
			errores = errores + "<p>Debe indicar una descripcion </p>";
			error=1;
		}
		var str=DESCRIPCION;

		if (str.search(/<[^>]+>/g) != -1)
		{
			errores = errores + "<p>No se permite ingresar etiquetas HTML en la descripci&oacute;n </p>";
			error=1;
		}
		if (error)
		{
			var alerta= '';
				alerta = '<br/>' + errores;
				document.getElementById('cvsigncontext').innerHTML= alerta;
				document.getElementById ('cvsign').style.display="block";
		}else {

				document.getElementById('cvsigncontext').innerHTML= '';
				document.getElementById ('cvsign').style.display="none";
			DESCRIPCION = DESCRIPCION.replace(/&/g, "%26");
            TITULO = TITULO.replace(/&/g, "%26");
            var campos=TITULO;
                var certificacion;
                 if(CERTIFICACIONSI){
                     certificacion = 1;
                 }

                 if(CERTIFICACIONNO){
                     certificacion = 2;
                 }
				campos=campos +'|'+PAIS +'|'+certificacion;
				campos=campos +'|'+DESCRIPCION+'|'+FINICIO_A;
				campos=campos +'|'+FINICIO_M+'|'+FFIN_A+'|'+FFIN_M;
			/*Debug	alert(campos);*/

                document.getElementById('formulario_curso').style.display = 'block';
				accion_ajax ("POST","conoc_abiertos_ajax.ngmf","callback_cursos_modificar","campos="+campos+"&accion="+accion+"&codigo="+codigo);
                document.getElementById('cvsign').style.display = 'none';
		}


}

function callback_cursos_modificar(){
        document.getElementById('cargar_nuevo').style.display = 'none';
        if (xml.readyState==1){
            document.getElementById('CargandoCursos').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:41%; font-size:14px;">Cargando Cursos</p>';
        }
        if (xml.readyState==4 && xml.status==200){

           Refresh_CursoCargados();

        }
}


   var xml;
function accion_ajax(metodo,url,funcion,valores)
    {

        if (window.XMLHttpRequest){
            xml= new XMLHttpRequest();
        }
        else if(window.ActiveXObject){
                xml = new ActiveXObject("Microsoft.XMLHTTP");
        }

		if (metodo=="GET" ){
            xml.open("GET",url,true);
            xml.onreadystatechange =eval(funcion);
            xml.send(null);
		}
		if (metodo=='POST')
		{
            xml.open('POST',url,true);
            xml.onreadystatechange = eval(funcion);
            xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xml.send(valores);
		}
    }
function callback_cursos(){

        if (xml.readyState==1){
            //document.getElementById('loader').innerHTML='<img src="../images/ajax/ajax-loader.gif" />';
            document.getElementById('CargandoCursos').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:41%; font-size:14px;">Cargando Cursos</p>';
        }
        if (xml.readyState==4 && xml.status==200){


                document.getElementById('alerta_js').innerHTML='';
                /*document.getElementById('conten_datos').innerHTML='';*/
                resetear_campos(document.getElementById('pagina').value);
                Refresh_CursoCargados();


        }

  }

function callback_guardar_experiencias(){

        if (xml.readyState==1){
            document.getElementById('CargandoExperiencias').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:38%; font-size:14px;">Cargando Experiencias</p>';
        }
        if (xml.readyState==4 && xml.status==200){

			document.getElementById('alerta_js').innerHTML='';
			/*document.getElementById('conten_datos').innerHTML='';*/
			resetear_campos(document.getElementById('pagina').value);
            Refresh_ExperienciaCargados();

        }

}

function callback_guardar_experiencias_postulantes(){

        if (xml.readyState==1){
            jQuery("#guardarexpe").hide();
            jQuery("#volverexpe").hide();
        }
        if (xml.readyState==4 && xml.status==200){
            validar_estudios_experiencia(2);
        }
}

function callback_guardar_estudios(){

        if (xml.readyState==1){
            document.getElementById('CargandoEstudios').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:40%; font-size:14px;">Cargando Estudios</p>';
        }
        if (xml.readyState==4 && xml.status==200){
            document.getElementById('alerta_js').innerHTML='';
			resetear_campos(document.getElementById('pagina').value);
            Refresh_EstudiosCargados();
        }
}

function callback_guardar_estudios_postulantes(){

        if (xml.readyState==1){
            jQuery("#guardarestu").hide();
            jQuery("#volverestu").hide();
        }
        if (xml.readyState==4 && xml.status==200){
            jQuery("#formulario_estudios").dialog( 'destroy' );
            document.aviso.submit();
        }
}

function callback_eliminar_cursos(){

        if (xml.readyState==1){
            document.getElementById('loader').innerHTML='<img src="../images/ajax/ajax-loader-wheel.gif" />';
        }
        if (xml.readyState==4 && xml.status==200){
            document.getElementById('loader').innerHTML='';
			if (xml.responseText!=false)
			{
				document.getElementById('alerta_js').innerHTML='';
				document.getElementById('conten_datos').innerHTML=xml.responseText;
				resetear_campos(document.getElementById('pagina').value);
			}else{
					document.getElementById('alerta_js').innerHTML='Hubo un error en al transaccion intentelo nuevamente'+xml.responseText;
			     }
        }

}
function callback_logueo(){

   if (xml.readyState==1){
       document.getElementById('loader').innerHTML='<img src="../images/ajax/ajax-loader-wheel.gif" />';
   }
	if (xml.readyState==4 && xml.status==200){
            document.getElementById('loader').innerHTML='';

				var string=xml.responseText;
				if (xml.responseText==1)
				{
					document.getElementById('alerta_js').style.visibility="hidden";
					window.location='e_panel.ngmf';
				}else{
					var rta=string.split(',');

					switch(rta[0])
					{

						case 'bloqueada':
								document.getElementById('alerta_js').innerHTML=rta[1];
								document.getElementById('alerta_js').style.visibility='visible';
								break;
						case 'error':
								document.getElementById('alerta_js').style.visibility='visible';
								break;
						default :
								document.getElementById('alerta_js').innerHTML='Hubo un error en al transaccion intentelo nuevamente'+xml.responseText;
								document.getElementById('alerta_js').style.visibility='visible';
								break;
					}
			    }
    }
}
function resetear_campos(pagina){
var miFechaActual = new Date();
anoActual = miFechaActual.getFullYear() ;
	switch (pagina)
	{
	case 'cursos':
					document.ALTA_CONOCIMIENTOS.TITULO.value='';
					document.ALTA_CONOCIMIENTOS.PAIS.value=0;
					document.ALTA_CONOCIMIENTOS.FINICIO_A.value=anoActual;
					document.ALTA_CONOCIMIENTOS.FINICIO_M.value=1;
					document.ALTA_CONOCIMIENTOS.FFIN_A.value=0;
					document.ALTA_CONOCIMIENTOS.FFIN_M.value=0;
					document.ALTA_CONOCIMIENTOS.DESCRIPCION.value='';
					break;

	case 'estudios':
					document.ALTA_CURRICULUM.PAIS.value=0;
					document.ALTA_CURRICULUM.TIPODEESTUDIO.value=0;
					document.ALTA_CURRICULUM.RESULTADOINST.value =0;
					document.ALTA_CURRICULUM.OTRAINSTITUCION.value='';
					document.ALTA_CURRICULUM.AREA.value=0;
					document.ALTA_CURRICULUM.OTROTITULO.value='';
					document.ALTA_CURRICULUM.FINICIO_A.value=anoActual;
					document.ALTA_CURRICULUM.FINICIO_M.value=1;
					document.ALTA_CURRICULUM.FFIN_A.value=0;
					document.ALTA_CURRICULUM.FFIN_M.value=0;
					document.ALTA_CURRICULUM.MATERIASCARRERA.value='';
					document.ALTA_CURRICULUM.MATERIASAPROBADAS.value='';
					document.ALTA_CURRICULUM.PROMEDIO.value='';
					document.ALTA_CURRICULUM.RANGOS.value=0;
					break;

	case 'experiencias':
					document.ALTA_EXPERIENCIA.PAIS.value=0;
					document.ALTA_EXPERIENCIA.OTRAEMPRESA.value='';
					document.ALTA_EXPERIENCIA.PUESTO.value='';
					document.ALTA_EXPERIENCIA.PUESTOCOMBO.value =0;
					document.ALTA_EXPERIENCIA.AREA.value=0;
					document.ALTA_EXPERIENCIA.INDUSTRIA.value=0;
					document.ALTA_EXPERIENCIA.FINICIO_M.value=1;
					document.ALTA_EXPERIENCIA.FINICIO_A.value=anoActual;
					document.ALTA_EXPERIENCIA.FFIN_A.value=0;
					document.ALTA_EXPERIENCIA.FFIN_M.value=0;
					document.ALTA_EXPERIENCIA.PERSONASACARGO.value='';
					document.ALTA_EXPERIENCIA.DESCRIPCION.value='';
					document.ALTA_EXPERIENCIA.MANEJAPRESUPUESTO.value='';
					document.ALTA_EXPERIENCIA.MANEJAPRESUPUESTO.checked=false;
                    document.ALTA_EXPERIENCIA.SENORITY.value=0;
	}//Fin switch


}

function trim(S)
{
var A = S;
var i;
var P1 = 1;
var P2 = A.length;

for (i=1; i <= A.length; i++)
{
  if (A.charAt(i) != ' ')
   {
    P1 = i;
    break;
   }
}

for (i = A.length; i >= 1; i--)
{
   if (A.charAt(i) != ' ')
   {
    P2 = i;
    break;
   }
}

A = A.substring(P1, P2);

return A;
}

function IsNumeric(valor)
{
	var log=valor.length; var sw="S";
	for (x=0; x<log; x++)
		{
			v1=valor.substr(x,1);
			v2 = parseInt(v1);
			//Compruebo si es un valor num�rico
			if (isNaN(v2)) { sw= "N";}
			}
				if (sw=="S") {
					return true;
				} else {
					return false; }
}

var x = 0;
var y = 0;
function setVisible(obj, imagen)
{
	//document.getElementById('expandir'+obj).innerHTML='';
	obj = document.getElementById(obj);
	if (obj.style.display == 'block'){
		imagen.src="/images/add-naranja.gif";
		obj.style.display = 'none';
	}else{
		obj.style.display = 'block';
		imagen.src="/images/remove-naranja.gif";
	}
}
function placeIt(obj)
{
	 obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += x;
	theTop += y;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;

}
function loguear_emp_ajax(){
	document.getElementById('alerta_js').style.visibility='hidden';
	accion_ajax("POST","/empresas/e_login_ajax.ngmf","callback_logueo","UUSERNAME="+document.getElementById('UUSERNAME').value+"&PPASSWORD="+document.getElementById('PPASSWORD').value+"&ENVIAR="+document.getElementById('enviar').value+"&ENCRIPTADA="+document.getElementById('ENCRIPTADA').value);
}

function autenticar_postulante(){
 var pwd=document.getElementById('PPASSWORD').value;
	 document.getElementById('loader').innerHTML='<img src="../images/ajax/ajax-loader-wheel.gif" />';;
	accion_ajax('GET','autenticar.ngmf?PWD='+pwd,'pwd_encriptada','');

}

function pwd_encriptada (){
	if (xml.readyState==4 && xml.status==200){
		document.getElementById('loader').innerHTML='';

			var rta=xml.responseText;
			if (rta==false)
			{

				/*pmd5=traslate_md5(document.getElementById('PPASSWORD').value);
				document.getElementById('PPASSWORD').value=pmd5;*/
				document.FLOGIN.submit();
			}else{

				document.getElementById('ENCRIPTADA').value=rta;
				document.FLOGIN.submit();
			}
	}
}


function traslate_md5(pwd){

return hex_md5(pwd);

}
function refreshSenority(){

var item=document.BUSQUEDAS_FILTROS.TECITEMS.value;

	if (item!=0)
	{
		accion_ajax("POST","/empresas/e_refresh-combos.ngmf","callback_refresh_senority","TECGRUPO=1&NIVEL=SI");
	}
}
function refreshTecitems(){
//var grupo=document.BUSQUEDAS_FILTROS.TECGRUPOS.value;
var select =document.BUSQUEDAS_FILTROS.SELECT_TECGRUPOS;
	agregar_todas = false;

	var string = "";
	var elegir_todas = false;
	var seleccionados = select;
	var string_todas = "";
	var string_descr = "";
	for (loop=0; loop < seleccionados.options.length; loop++) {
		if (seleccionados.options[loop].selected==true) {
			if (seleccionados.options[loop].value=="0") {
				elegir_todas = true;
			} else {
				string += (string!=""?",":"") + seleccionados.options[loop].value;
				//string_descr += (string_descr!=""?", ":"") + seleccionados.options[loop].text;
			}
		}
		if( agregar_todas && loop > 0 ) {
			string_todas += (string_todas!=""?",":"") + seleccionados.options[loop].value;
		}
	}



	accion_ajax("POST","/empresas/e_refresh-combos.ngmf","callback_refresh_combo","TECGRUPO="+string+"&NIVEL=NO");
}
function callback_refresh_combo(){

   if (xml.readyState==1){
       document.getElementById('combo_tecno').innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
   }
	if (xml.readyState==4 && xml.status==200){
            document.getElementById('combo_tecno').innerHTML=xml.responseText;
	}
}

function callback_refresh_senority(){

   if (xml.readyState==1){
       document.getElementById('combo_senority').innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
   }
	if (xml.readyState==4 && xml.status==200){
            document.getElementById('combo_senority').innerHTML=xml.responseText;
            document.getElementById('conten_senority').style.display='block';
	}

}

function refreshPais(idPais,idFormulario){

   idFormPais = idFormulario;
   if (idPais!=0)
	{
        accion_ajax("POST","/aplicantes/estudios_ajax.ngmf","callback_refresh_Pais","PAIS="+idPais+"&IDFORM="+idFormPais+"&REFRESHPAIS=1");

    }

}


function callback_refresh_Pais(){


   if (xml.readyState==1){
        if (typeof idFormPais == "undefined" || idFormPais == 0){
            document.getElementById('ComboTipoEstudio').innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
            document.getElementById('ComboInstituciones').innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
            document.getElementById('bloque_otrainstitucion').innerHTML='';
            document.getElementById('ComboArea').innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
        }else{
            document.getElementById('ComboTipoEstudio'+idFormPais).innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
            document.getElementById('ComboInstituciones'+idFormPais).innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
            document.getElementById('bloque_otrainstitucion'+idFormPais).innerHTML='';
            document.getElementById('ComboArea'+idFormPais).innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
        }
   }
	if (xml.readyState==4 && xml.status==200){

            response = new Array();
            response = xml.responseText.split("|||");
            if (typeof idFormPais == "undefined" || idFormPais == 0){
                document.getElementById('ComboTipoEstudio').innerHTML=response[0];
                document.getElementById('ComboInstituciones').innerHTML=response[1];
                document.getElementById('bloque_otrainstitucion').innerHTML=response[2];
                document.getElementById('ComboArea').innerHTML=response[3];
            }else{
                document.getElementById('ComboTipoEstudio'+idFormPais).innerHTML=response[0];
                document.getElementById('ComboInstituciones'+idFormPais).innerHTML=response[1];
                document.getElementById('bloque_otrainstitucion'+idFormPais).innerHTML=response[2];
                document.getElementById('ComboArea'+idFormPais).innerHTML=response[3];
            }
    }
}
/*******************************************************/
function addHighlight(div){
	if(div.id == 'aviso_platinum'){
		//div.style.backgroundPosition = 'bottom';
		//div.style.border="1px solid #c9c9c9";
		//div.style.border.top="1px solid  #c9c9c9";
	}
	if(div.id == 'aviso_destacado'){
		//div.style.backgroundPosition = 'bottom';
	}

}
function removeHighlight(div){

	if(div.id == 'aviso_platinum'){
		div.style.backgroundPosition = 'top';
		//div.style.border="1px solid #FFEFD7";
		div.style.border.top="1px solid #FFEFD7";
	}
	if(div.id == 'aviso_destacado'){
		//div.style.backgroundPosition = 'top';
	}
}
function Refresh_TipodeEstudio(idTipoEstudio,idPais,idFormularioTiEst){

    idFormTiEst = idFormularioTiEst;

   if (idTipoEstudio!=0)
	{
        accion_ajax("POST","/aplicantes/estudios_ajax.ngmf","callback_refresh_TipodeEstudio","TIPOESTUDIO="+idTipoEstudio+"&IDFORM="+idFormTiEst+"&PAIS="+idPais+"&REFRESHTIPODEESTUDIO=1");

    }

}

function callback_refresh_TipodeEstudio(){

   if (xml.readyState==1){

         if (idFormTiEst == 0){
            document.getElementById('ComboInstituciones').innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
         }else{
            document.getElementById('ComboInstituciones'+idFormTiEst).innerHTML='<img src="/images/ajax/ajax-loader-wheel.gif" />';
         }
   }
	if (xml.readyState==4 && xml.status==200){
       response = new Array();
       response = xml.responseText.split("|||");
       if (typeof idFormTiEst == "undefined" || idFormTiEst == 0){

           document.getElementById('ComboInstituciones').innerHTML=response[0];

           if(typeof response[1] != "undefined"){
                document.getElementById('bloque_otrainstitucion').innerHTML=response[1];
           }else{
               document.getElementById('bloque_otrainstitucion').innerHTML="";
           }
       }else{

           document.getElementById('ComboInstituciones'+idFormTiEst).innerHTML=response[0];

           if(typeof response[1] != "undefined"){
                document.getElementById('bloque_otrainstitucion'+idFormTiEst).innerHTML=response[1];
           }else{
               document.getElementById('bloque_otrainstitucion'+idFormTiEst).innerHTML="";
           }
       }
    }
}

function Refresh_Instituciones(idInstituciones,idFormularioInst){

    idFormInst = idFormularioInst;

    accion_ajax("POST","/aplicantes/estudios_ajax.ngmf","callback_refresh_Instituciones","INSTITUCIONES="+idInstituciones+"&IDFORM="+idFormInst+"&REFRESHINSTITUCIONES=1");
}

function callback_refresh_Instituciones(){

   if (xml.readyState==1){

      if (typeof idFormInst == "undefined" || idFormInst == 0){
        document.getElementById('bloque_otrainstitucion').innerHTML='';
      }else{
        document.getElementById('bloque_otrainstitucion'+idFormInst).innerHTML='';
      }
   }
	if (xml.readyState==4 && xml.status==200){
        if (typeof idFormInst == "undefined" || idFormInst == 0){
            document.getElementById('bloque_otrainstitucion').innerHTML=xml.responseText;
        }else{
            document.getElementById('bloque_otrainstitucion'+idFormInst).innerHTML=xml.responseText;
        }
    }
}

function Refresh_EstudiosCargados(){

    accion_ajax("POST","/aplicantes/estudios_ajax.ngmf","callback_refresh_EstudiosCargados","REFRESHESTUDIOSCARGADOS=1");
}

function callback_refresh_EstudiosCargados(){

   if (xml.readyState==1){

      document.getElementById('CargandoEstudios').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:40%; font-size:14px;">Cargando Estudios</p>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('CargandoEstudios').innerHTML=xml.responseText;

    }
}

function Refresh_EstudiosCargados2(idEstudio){

    idEstudioModificar =idEstudio;
    accion_ajax("POST","/aplicantes/estudios_ajax.ngmf","callback_refresh_EstudiosCargados2","REFRESHESTUDIOSCARGADOS=1&IDESTUDIOMODIFICAR="+idEstudioModificar);
}

function callback_refresh_EstudiosCargados2(){

   if (xml.readyState==1){

      document.getElementById('CargandoEstudios').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:40%; font-size:14px;">Cargando Estudios</p>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('CargandoEstudios').innerHTML=xml.responseText;

        var y=jQuery("#formulario_estudios");
        var z=jQuery("#cargar_nuevo");
        y.slideUp(1500);
        z.show();
    }
}

function Refresh_ExperienciaCargados(){

    accion_ajax("POST","/aplicantes/experiencias_ajax.ngmf","callback_refresh_ExperienciaCargados","REFRESHEXPERIENCIASCARGADOS=1");
}

function callback_refresh_ExperienciaCargados(){

   if (xml.readyState==1){

      document.getElementById('CargandoExperiencias').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:38%; font-size:14px;">Cargando Experiencias</p>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('CargandoExperiencias').innerHTML=xml.responseText;

    }
}

function Refresh_ExperienciaCargados2(idExperiencia){

    idExperienciaModificar =idExperiencia;
    accion_ajax("POST","/aplicantes/experiencias_ajax.ngmf","callback_refresh_ExperienciaCargados2","REFRESHEXPERIENCIASCARGADOS=1&IDEXPERIENCIAMODIFICAR="+idExperienciaModificar);
}

function callback_refresh_ExperienciaCargados2(){

   if (xml.readyState==1){

      document.getElementById('CargandoExperiencias').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:38%; font-size:14px;">Cargando Experiencias</p>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('CargandoExperiencias').innerHTML=xml.responseText;

        var y=jQuery("#formulario_experiencia");
        var z=jQuery("#cargar_nuevo");
        y.slideUp(1500);
        z.show();
    }
}
/****/
function Refresh_CursoCargados(){

    accion_ajax("POST","/aplicantes/conoc_abiertos_ajax.ngmf","callback_refresh_CursoCargados","REFRESHCURSOSCARGADOS=1");
}

function callback_refresh_CursoCargados(){

   if (xml.readyState==1){

      document.getElementById('CargandoCursos').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:41%; font-size:14px;">Cargando Cursos</p>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('CargandoCursos').innerHTML=xml.responseText;

    }
}

function Refresh_CursoCargados2(idCurso){

    idCursoModificar =idCurso;
    accion_ajax("POST","/aplicantes/conoc_abiertos_ajax.ngmf","callback_refresh_CursoCargados2","REFRESHCURSOSCARGADOS=1&IDCURSOSMODIFICAR="+idCursoModificar);
}

function callback_refresh_CursoCargados2(){

   if (xml.readyState==1){

      document.getElementById('CargandoCursos').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-bar.gif" /><p style="margin-left:41%; font-size:14px;">Cargando Cursos</p>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('CargandoCursos').innerHTML=xml.responseText;


        var y=jQuery("#formulario_curso");
        var z=jQuery("#cargar_nuevo");
        y.slideUp(1500);
        z.show();
    }

}

function exportar_segmentacion(idbusqueda){
    accion_ajax("POST","/empresas/exportacion_segmentacion.ngmf","callback_exportar_segmentacion","IDBUSQUEDA="+idbusqueda);
}

function callback_exportar_segmentacion(){
    if (xml.readyState==1){

      document.getElementById('segmentacion').innerHTML='<img style="margin-left:40%;" src="/images/ajax/ajax-loader-wheel.gif" /><span style="margin-left:10px; font-size:11px;">Generando Segmentacion</span>';
   }
	if (xml.readyState==4 && xml.status==200){

       document.getElementById('segmentacion').innerHTML=xml.responseText;

    }
}





/* md5.js */
/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }

/*
 * Perform a simple self-test to see if the VM is working
 */
function md5_vm_test()
{
  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

/*
 * Calculate the MD5 of an array of little-endian words, and a bit length
 */
function core_md5(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << ((len) % 32);
  x[(((len + 64) >>> 9) << 4) + 14] = len;

  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  return Array(a, b, c, d);

}

/*
 * These functions implement the four basic operations the algorithm uses.
 */
function md5_cmn(q, a, b, x, s, t)
{
  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Calculate the HMAC-MD5, of a key and some data
 */
function core_hmac_md5(key, data)
{
  var bkey = str2binl(key);
  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
  return core_md5(opad.concat(hash), 512 + 128);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function bit_rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert a string to an array of little-endian words
 * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
 */
function str2binl(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
  return bin;
}

/*
 * Convert an array of little-endian words to a string
 */
function binl2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
  return str;
}

/*
 * Convert an array of little-endian words to a hex string.
 */
function binl2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of little-endian words to a base-64 string
 */
function binl2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}
/* rounded_corners_lite.inc.js */

 /****************************************************************
  *                                                              *
  *  curvyCorners                                                *
  *  ------------                                                *
  *                                                              *
  *  This script generates rounded corners for your divs.        *
  *                                                              *
  *  Version 1.2.9                                               *
  *  Copyright (c) 2006 Cameron Cooke                            *
  *  By: Cameron Cooke and Tim Hutchison.                        *
  *                                                              *
  *                                                              *
  *  Website: http://www.curvycorners.net                        *
  *  Email:   info@totalinfinity.com                             *
  *  Forum:   http://www.curvycorners.net/forum/                 *
  *                                                              *
  *                                                              *
  *  This library is free software; you can redistribute         *
  *  it and/or modify it under the terms of the GNU              *
  *  Lesser General Public License as published by the           *
  *  Free Software Foundation; either version 2.1 of the         *
  *  License, or (at your option) any later version.             *
  *                                                              *
  *  This library is distributed in the hope that it will        *
  *  be useful, but WITHOUT ANY WARRANTY; without even the       *
  *  implied warranty of MERCHANTABILITY or FITNESS FOR A        *
  *  PARTICULAR PURPOSE. See the GNU Lesser General Public       *
  *  License for more details.                                   *
  *                                                              *
  *  You should have received a copy of the GNU Lesser           *
  *  General Public License along with this library;             *
  *  Inc., 59 Temple Place, Suite 330, Boston,                   *
  *  MA 02111-1307 USA                                           *
  *                                                              *
  ****************************************************************/
  
var isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1; var isMoz = document.implementation && document.implementation.createDocument; var isSafari = ((navigator.userAgent.toLowerCase().indexOf('safari')!=-1)&&(navigator.userAgent.toLowerCase().indexOf('mac')!=-1))?true:false; function curvyCorners()
{ if(typeof(arguments[0]) != "object") throw newCurvyError("First parameter of curvyCorners() must be an object."); if(typeof(arguments[1]) != "object" && typeof(arguments[1]) != "string") throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name."); if(typeof(arguments[1]) == "string")
{ var startIndex = 0; var boxCol = getElementsByClass(arguments[1]);}
else
{ var startIndex = 1; var boxCol = arguments;}
var curvyCornersCol = new Array(); if(arguments[0].validTags)
var validElements = arguments[0].validTags; else
var validElements = ["div"]; for(var i = startIndex, j = boxCol.length; i < j; i++)
{ var currentTag = boxCol[i].tagName.toLowerCase(); if(inArray(validElements, currentTag) !== false)
{ curvyCornersCol[curvyCornersCol.length] = new curvyObject(arguments[0], boxCol[i]);}
}
this.objects = curvyCornersCol; this.applyCornersToAll = function()
{ for(var x = 0, k = this.objects.length; x < k; x++)
{ this.objects[x].applyCorners();}
}
}
function curvyObject()
{ this.box = arguments[1]; this.settings = arguments[0]; this.topContainer = null; this.bottomContainer = null; this.masterCorners = new Array(); this.contentDIV = null; var boxHeight = get_style(this.box, "height", "height"); var boxWidth = get_style(this.box, "width", "width"); var borderWidth = get_style(this.box, "borderTopWidth", "border-top-width"); var borderColour = get_style(this.box, "borderTopColor", "border-top-color"); var boxColour = get_style(this.box, "backgroundColor", "background-color"); var backgroundImage = get_style(this.box, "backgroundImage", "background-image"); var boxPosition = get_style(this.box, "position", "position"); var boxPadding = get_style(this.box, "paddingTop", "padding-top"); this.boxHeight = parseInt(((boxHeight != "" && boxHeight != "auto" && boxHeight.indexOf("%") == -1)? boxHeight.substring(0, boxHeight.indexOf("px")) : this.box.scrollHeight)); this.boxWidth = parseInt(((boxWidth != "" && boxWidth != "auto" && boxWidth.indexOf("%") == -1)? boxWidth.substring(0, boxWidth.indexOf("px")) : this.box.scrollWidth)); this.borderWidth = parseInt(((borderWidth != "" && borderWidth.indexOf("px") !== -1)? borderWidth.slice(0, borderWidth.indexOf("px")) : 0)); this.boxColour = format_colour(boxColour); this.boxPadding = parseInt(((boxPadding != "" && boxPadding.indexOf("px") !== -1)? boxPadding.slice(0, boxPadding.indexOf("px")) : 0)); this.borderColour = format_colour(borderColour); this.borderString = this.borderWidth + "px" + " solid " + this.borderColour; this.backgroundImage = ((backgroundImage != "none")? backgroundImage : ""); this.boxContent = this.box.innerHTML; if(boxPosition != "absolute") this.box.style.position = "relative"; this.box.style.padding = "0px"; if(isIE && boxWidth == "auto" && boxHeight == "auto") this.box.style.width = "100%"; if(this.settings.autoPad == true && this.boxPadding > 0)
this.box.innerHTML = ""; this.applyCorners = function()
{ for(var t = 0; t < 2; t++)
{ switch(t)
{ case 0:
if(this.settings.tl || this.settings.tr)
{ var newMainContainer = document.createElement("DIV"); newMainContainer.style.width = "100%"; newMainContainer.style.fontSize = "1px"; newMainContainer.style.overflow = "hidden"; newMainContainer.style.position = "absolute"; newMainContainer.style.paddingLeft = this.borderWidth + "px"; newMainContainer.style.paddingRight = this.borderWidth + "px"; var topMaxRadius = Math.max(this.settings.tl ? this.settings.tl.radius : 0, this.settings.tr ? this.settings.tr.radius : 0); newMainContainer.style.height = topMaxRadius + "px"; newMainContainer.style.top = 0 - topMaxRadius + "px"; newMainContainer.style.left = 0 - this.borderWidth + "px"; this.topContainer = this.box.appendChild(newMainContainer);}
break; case 1:
if(this.settings.bl || this.settings.br)
{ var newMainContainer = document.createElement("DIV"); newMainContainer.style.width = "100%"; newMainContainer.style.fontSize = "1px"; newMainContainer.style.overflow = "hidden"; newMainContainer.style.position = "absolute"; newMainContainer.style.paddingLeft = this.borderWidth + "px"; newMainContainer.style.paddingRight = this.borderWidth + "px"; var botMaxRadius = Math.max(this.settings.bl ? this.settings.bl.radius : 0, this.settings.br ? this.settings.br.radius : 0); newMainContainer.style.height = botMaxRadius + "px"; newMainContainer.style.bottom = 0 - botMaxRadius + "px"; newMainContainer.style.left = 0 - this.borderWidth + "px"; this.bottomContainer = this.box.appendChild(newMainContainer);}
break;}
}
if(this.topContainer) this.box.style.borderTopWidth = "0px"; if(this.bottomContainer) this.box.style.borderBottomWidth = "0px"; var corners = ["tr", "tl", "br", "bl"]; for(var i in corners)
{ if(i > -1 < 4)
{ var cc = corners[i]; if(!this.settings[cc])
{ if(((cc == "tr" || cc == "tl") && this.topContainer != null) || ((cc == "br" || cc == "bl") && this.bottomContainer != null))
{ var newCorner = document.createElement("DIV"); newCorner.style.position = "relative"; newCorner.style.fontSize = "1px"; newCorner.style.overflow = "hidden"; if(this.backgroundImage == "")
newCorner.style.backgroundColor = this.boxColour; else
newCorner.style.backgroundImage = this.backgroundImage; switch(cc)
{ case "tl":
newCorner.style.height = topMaxRadius - this.borderWidth + "px"; newCorner.style.marginRight = this.settings.tr.radius - (this.borderWidth*2) + "px"; newCorner.style.borderLeft = this.borderString; newCorner.style.borderTop = this.borderString; newCorner.style.left = -this.borderWidth + "px"; break; case "tr":
newCorner.style.height = topMaxRadius - this.borderWidth + "px"; newCorner.style.marginLeft = this.settings.tl.radius - (this.borderWidth*2) + "px"; newCorner.style.borderRight = this.borderString; newCorner.style.borderTop = this.borderString; newCorner.style.backgroundPosition = "-" + (topMaxRadius + this.borderWidth) + "px 0px"; newCorner.style.left = this.borderWidth + "px"; break; case "bl":
newCorner.style.height = botMaxRadius - this.borderWidth + "px"; newCorner.style.marginRight = this.settings.br.radius - (this.borderWidth*2) + "px"; newCorner.style.borderLeft = this.borderString; newCorner.style.borderBottom = this.borderString; newCorner.style.left = -this.borderWidth + "px"; newCorner.style.backgroundPosition = "-" + (this.borderWidth) + "px -" + (this.boxHeight + (botMaxRadius + this.borderWidth)) + "px"; break; case "br":
newCorner.style.height = botMaxRadius - this.borderWidth + "px"; newCorner.style.marginLeft = this.settings.bl.radius - (this.borderWidth*2) + "px"; newCorner.style.borderRight = this.borderString; newCorner.style.borderBottom = this.borderString; newCorner.style.left = this.borderWidth + "px"
newCorner.style.backgroundPosition = "-" + (botMaxRadius + this.borderWidth) + "px -" + (this.boxHeight + (botMaxRadius + this.borderWidth)) + "px"; break;}
}
}
else
{ if(this.masterCorners[this.settings[cc].radius])
{ var newCorner = this.masterCorners[this.settings[cc].radius].cloneNode(true);}
else
{ var newCorner = document.createElement("DIV"); newCorner.style.height = this.settings[cc].radius + "px"; newCorner.style.width = this.settings[cc].radius + "px"; newCorner.style.position = "absolute"; newCorner.style.fontSize = "1px"; newCorner.style.overflow = "hidden"; var borderRadius = parseInt(this.settings[cc].radius - this.borderWidth); for(var intx = 0, j = this.settings[cc].radius; intx < j; intx++)
{ if((intx +1) >= borderRadius)
var y1 = -1; else
var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx+1), 2))) - 1); if(borderRadius != j)
{ if((intx) >= borderRadius)
var y2 = -1; else
var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius,2) - Math.pow(intx, 2))); if((intx+1) >= j)
var y3 = -1; else
var y3 = (Math.floor(Math.sqrt(Math.pow(j ,2) - Math.pow((intx+1), 2))) - 1);}
if((intx) >= j)
var y4 = -1; else
var y4 = Math.ceil(Math.sqrt(Math.pow(j ,2) - Math.pow(intx, 2))); if(y1 > -1) this.drawPixel(intx, 0, this.boxColour, 100, (y1+1), newCorner, -1, this.settings[cc].radius); if(borderRadius != j)
{ for(var inty = (y1 + 1); inty < y2; inty++)
{ if(this.settings.antiAlias)
{ if(this.backgroundImage != "")
{ var borderFract = (pixelFraction(intx, inty, borderRadius) * 100); if(borderFract < 30)
{ this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, 0, this.settings[cc].radius);}
else
{ this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, -1, this.settings[cc].radius);}
}
else
{ var pixelcolour = BlendColour(this.boxColour, this.borderColour, pixelFraction(intx, inty, borderRadius)); this.drawPixel(intx, inty, pixelcolour, 100, 1, newCorner, 0, this.settings[cc].radius, cc);}
}
}
if(this.settings.antiAlias)
{ if(y3 >= y2)
{ if (y2 == -1) y2 = 0; this.drawPixel(intx, y2, this.borderColour, 100, (y3 - y2 + 1), newCorner, 0, 0);}
}
else
{ if(y3 >= y1)
{ this.drawPixel(intx, (y1 + 1), this.borderColour, 100, (y3 - y1), newCorner, 0, 0);}
}
var outsideColour = this.borderColour;}
else
{ var outsideColour = this.boxColour; var y3 = y1;}
if(this.settings.antiAlias)
{ for(var inty = (y3 + 1); inty < y4; inty++)
{ this.drawPixel(intx, inty, outsideColour, (pixelFraction(intx, inty , j) * 100), 1, newCorner, ((this.borderWidth > 0)? 0 : -1), this.settings[cc].radius);}
}
}
this.masterCorners[this.settings[cc].radius] = newCorner.cloneNode(true);}
if(cc != "br")
{ for(var t = 0, k = newCorner.childNodes.length; t < k; t++)
{ var pixelBar = newCorner.childNodes[t]; var pixelBarTop = parseInt(pixelBar.style.top.substring(0, pixelBar.style.top.indexOf("px"))); var pixelBarLeft = parseInt(pixelBar.style.left.substring(0, pixelBar.style.left.indexOf("px"))); var pixelBarHeight = parseInt(pixelBar.style.height.substring(0, pixelBar.style.height.indexOf("px"))); if(cc == "tl" || cc == "bl"){ pixelBar.style.left = this.settings[cc].radius -pixelBarLeft -1 + "px";}
if(cc == "tr" || cc == "tl"){ pixelBar.style.top = this.settings[cc].radius -pixelBarHeight -pixelBarTop + "px";}
switch(cc)
{ case "tr":
pixelBar.style.backgroundPosition = "-" + Math.abs((this.boxWidth - this.settings[cc].radius + this.borderWidth) + pixelBarLeft) + "px -" + Math.abs(this.settings[cc].radius -pixelBarHeight -pixelBarTop - this.borderWidth) + "px"; break; case "tl":
pixelBar.style.backgroundPosition = "-" + Math.abs((this.settings[cc].radius -pixelBarLeft -1) - this.borderWidth) + "px -" + Math.abs(this.settings[cc].radius -pixelBarHeight -pixelBarTop - this.borderWidth) + "px"; break; case "bl":
pixelBar.style.backgroundPosition = "-" + Math.abs((this.settings[cc].radius -pixelBarLeft -1) - this.borderWidth) + "px -" + Math.abs((this.boxHeight + this.settings[cc].radius + pixelBarTop) -this.borderWidth) + "px"; break;}
}
}
}
if(newCorner)
{ switch(cc)
{ case "tl":
if(newCorner.style.position == "absolute") newCorner.style.top = "0px"; if(newCorner.style.position == "absolute") newCorner.style.left = "0px"; if(this.topContainer) this.topContainer.appendChild(newCorner); break; case "tr":
if(newCorner.style.position == "absolute") newCorner.style.top = "0px"; if(newCorner.style.position == "absolute") newCorner.style.right = "0px"; if(this.topContainer) this.topContainer.appendChild(newCorner); break; case "bl":
if(newCorner.style.position == "absolute") newCorner.style.bottom = "0px"; if(newCorner.style.position == "absolute") newCorner.style.left = "0px"; if(this.bottomContainer) this.bottomContainer.appendChild(newCorner); break; case "br":
if(newCorner.style.position == "absolute") newCorner.style.bottom = "0px"; if(newCorner.style.position == "absolute") newCorner.style.right = "0px"; if(this.bottomContainer) this.bottomContainer.appendChild(newCorner); break;}
}
}
}
var radiusDiff = new Array(); radiusDiff["t"] = Math.abs(this.settings.tl.radius - this.settings.tr.radius)
radiusDiff["b"] = Math.abs(this.settings.bl.radius - this.settings.br.radius); for(z in radiusDiff)
{ if(z == "t" || z == "b")
{ if(radiusDiff[z])
{ var smallerCornerType = ((this.settings[z + "l"].radius < this.settings[z + "r"].radius)? z +"l" : z +"r"); var newFiller = document.createElement("DIV"); newFiller.style.height = radiusDiff[z] + "px"; newFiller.style.width = this.settings[smallerCornerType].radius+ "px"
newFiller.style.position = "absolute"; newFiller.style.fontSize = "1px"; newFiller.style.overflow = "hidden"; newFiller.style.backgroundColor = this.boxColour; switch(smallerCornerType)
{ case "tl":
newFiller.style.bottom = "0px"; newFiller.style.left = "0px"; newFiller.style.borderLeft = this.borderString; this.topContainer.appendChild(newFiller); break; case "tr":
newFiller.style.bottom = "0px"; newFiller.style.right = "0px"; newFiller.style.borderRight = this.borderString; this.topContainer.appendChild(newFiller); break; case "bl":
newFiller.style.top = "0px"; newFiller.style.left = "0px"; newFiller.style.borderLeft = this.borderString; this.bottomContainer.appendChild(newFiller); break; case "br":
newFiller.style.top = "0px"; newFiller.style.right = "0px"; newFiller.style.borderRight = this.borderString; this.bottomContainer.appendChild(newFiller); break;}
}
var newFillerBar = document.createElement("DIV"); newFillerBar.style.position = "relative"; newFillerBar.style.fontSize = "1px"; newFillerBar.style.overflow = "hidden"; newFillerBar.style.backgroundColor = this.boxColour; newFillerBar.style.backgroundImage = this.backgroundImage; switch(z)
{ case "t":
if(this.topContainer)
{ if(this.settings.tl.radius && this.settings.tr.radius)
{ newFillerBar.style.height = topMaxRadius - this.borderWidth + "px"; newFillerBar.style.marginLeft = this.settings.tl.radius - this.borderWidth + "px"; newFillerBar.style.marginRight = this.settings.tr.radius - this.borderWidth + "px"; newFillerBar.style.borderTop = this.borderString; if(this.backgroundImage != "")
newFillerBar.style.backgroundPosition = "-" + (topMaxRadius + this.borderWidth) + "px 0px"; this.topContainer.appendChild(newFillerBar);}
this.box.style.backgroundPosition = "0px -" + (topMaxRadius - this.borderWidth) + "px";}
break; case "b":
if(this.bottomContainer)
{ if(this.settings.bl.radius && this.settings.br.radius)
{ newFillerBar.style.height = botMaxRadius - this.borderWidth + "px"; newFillerBar.style.marginLeft = this.settings.bl.radius - this.borderWidth + "px"; newFillerBar.style.marginRight = this.settings.br.radius - this.borderWidth + "px"; newFillerBar.style.borderBottom = this.borderString; if(this.backgroundImage != "")
newFillerBar.style.backgroundPosition = "-" + (botMaxRadius + this.borderWidth) + "px -" + (this.boxHeight + (topMaxRadius + this.borderWidth)) + "px"; this.bottomContainer.appendChild(newFillerBar);}
}
break;}
}
}
if(this.settings.autoPad == true && this.boxPadding > 0)
{ var contentContainer = document.createElement("DIV"); contentContainer.style.position = "relative"; contentContainer.innerHTML = this.boxContent; contentContainer.className = "autoPadDiv"; var topPadding = Math.abs(topMaxRadius - this.boxPadding); var botPadding = Math.abs(botMaxRadius - this.boxPadding); if(topMaxRadius < this.boxPadding)
contentContainer.style.paddingTop = topPadding + "px"; if(botMaxRadius < this.boxPadding)
contentContainer.style.paddingBottom = botMaxRadius + "px"; contentContainer.style.paddingLeft = this.boxPadding + "px"; contentContainer.style.paddingRight = this.boxPadding + "px"; this.contentDIV = this.box.appendChild(contentContainer);}
}
this.drawPixel = function(intx, inty, colour, transAmount, height, newCorner, image, cornerRadius)
{ var pixel = document.createElement("DIV"); pixel.style.height = height + "px"; pixel.style.width = "1px"; pixel.style.position = "absolute"; pixel.style.fontSize = "1px"; pixel.style.overflow = "hidden"; var topMaxRadius = Math.max(this.settings["tr"].radius, this.settings["tl"].radius); if(image == -1 && this.backgroundImage != "")
{ pixel.style.backgroundImage = this.backgroundImage; pixel.style.backgroundPosition = "-" + (this.boxWidth - (cornerRadius - intx) + this.borderWidth) + "px -" + ((this.boxHeight + topMaxRadius + inty) -this.borderWidth) + "px";}
else
{ pixel.style.backgroundColor = colour;}
if (transAmount != 100)
setOpacity(pixel, transAmount); pixel.style.top = inty + "px"; pixel.style.left = intx + "px"; newCorner.appendChild(pixel);}
}
function insertAfter(parent, node, referenceNode)
{ parent.insertBefore(node, referenceNode.nextSibling);}
function BlendColour(Col1, Col2, Col1Fraction)
{ var red1 = parseInt(Col1.substr(1,2),16); var green1 = parseInt(Col1.substr(3,2),16); var blue1 = parseInt(Col1.substr(5,2),16); var red2 = parseInt(Col2.substr(1,2),16); var green2 = parseInt(Col2.substr(3,2),16); var blue2 = parseInt(Col2.substr(5,2),16); if(Col1Fraction > 1 || Col1Fraction < 0) Col1Fraction = 1; var endRed = Math.round((red1 * Col1Fraction) + (red2 * (1 - Col1Fraction))); if(endRed > 255) endRed = 255; if(endRed < 0) endRed = 0; var endGreen = Math.round((green1 * Col1Fraction) + (green2 * (1 - Col1Fraction))); if(endGreen > 255) endGreen = 255; if(endGreen < 0) endGreen = 0; var endBlue = Math.round((blue1 * Col1Fraction) + (blue2 * (1 - Col1Fraction))); if(endBlue > 255) endBlue = 255; if(endBlue < 0) endBlue = 0; return "#" + IntToHex(endRed)+ IntToHex(endGreen)+ IntToHex(endBlue);}
function IntToHex(strNum)
{ base = strNum / 16; rem = strNum % 16; base = base - (rem / 16); baseS = MakeHex(base); remS = MakeHex(rem); return baseS + '' + remS;}
function MakeHex(x)
{ if((x >= 0) && (x <= 9))
{ return x;}
else
{ switch(x)
{ case 10: return "A"; case 11: return "B"; case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F";}
}
}
function pixelFraction(x, y, r)
{ var pixelfraction = 0; var xvalues = new Array(1); var yvalues = new Array(1); var point = 0; var whatsides = ""; var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x,2))); if ((intersect >= y) && (intersect < (y+1)))
{ whatsides = "Left"; xvalues[point] = 0; yvalues[point] = intersect - y; point = point + 1;}
var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y+1,2))); if ((intersect >= x) && (intersect < (x+1)))
{ whatsides = whatsides + "Top"; xvalues[point] = intersect - x; yvalues[point] = 1; point = point + 1;}
var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x+1,2))); if ((intersect >= y) && (intersect < (y+1)))
{ whatsides = whatsides + "Right"; xvalues[point] = 1; yvalues[point] = intersect - y; point = point + 1;}
var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y,2))); if ((intersect >= x) && (intersect < (x+1)))
{ whatsides = whatsides + "Bottom"; xvalues[point] = intersect - x; yvalues[point] = 0;}
switch (whatsides)
{ case "LeftRight":
pixelfraction = Math.min(yvalues[0],yvalues[1]) + ((Math.max(yvalues[0],yvalues[1]) - Math.min(yvalues[0],yvalues[1]))/2); break; case "TopRight":
pixelfraction = 1-(((1-xvalues[0])*(1-yvalues[1]))/2); break; case "TopBottom":
pixelfraction = Math.min(xvalues[0],xvalues[1]) + ((Math.max(xvalues[0],xvalues[1]) - Math.min(xvalues[0],xvalues[1]))/2); break; case "LeftBottom":
pixelfraction = (yvalues[0]*xvalues[1])/2; break; default:
pixelfraction = 1;}
return pixelfraction;}
function rgb2Hex(rgbColour)
{ try{ var rgbArray = rgb2Array(rgbColour); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); var hexColour = "#" + IntToHex(red) + IntToHex(green) + IntToHex(blue);}
catch(e){ alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");}
return hexColour;}
function rgb2Array(rgbColour)
{ var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")")); var rgbArray = rgbValues.split(", "); return rgbArray;}
function setOpacity(obj, opacity)
{ opacity = (opacity == 100)?99.999:opacity; if(isSafari && obj.tagName != "IFRAME")
{ var rgbArray = rgb2Array(obj.style.backgroundColor); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); obj.style.backgroundColor = "rgba(" + red + ", " + green + ", " + blue + ", " + opacity/100 + ")";}
else if(typeof(obj.style.opacity) != "undefined")
{ obj.style.opacity = opacity/100;}
else if(typeof(obj.style.MozOpacity) != "undefined")
{ obj.style.MozOpacity = opacity/100;}
else if(typeof(obj.style.filter) != "undefined")
{ obj.style.filter = "alpha(opacity:" + opacity + ")";}
else if(typeof(obj.style.KHTMLOpacity) != "undefined")
{ obj.style.KHTMLOpacity = opacity/100;}
}
function inArray(array, value)
{ for(var i = 0; i < array.length; i++){ if (array[i] === value) return i;}
return false;}
function inArrayKey(array, value)
{ for(key in array){ if(key === value) return true;}
return false;}
function addEvent(elm, evType, fn, useCapture) { if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true;}
else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r;}
else { elm['on' + evType] = fn;}
}
function removeEvent(obj, evType, fn, useCapture){ if (obj.removeEventListener){ obj.removeEventListener(evType, fn, useCapture); return true;} else if (obj.detachEvent){ var r = obj.detachEvent("on"+evType, fn); return r;} else { alert("Handler could not be removed");}
}
function format_colour(colour)
{ var returnColour = "#ffffff"; if(colour != "" && colour != "transparent")
{ if(colour.substr(0, 3) == "rgb")
{ returnColour = rgb2Hex(colour);}
else if(colour.length == 4)
{ returnColour = "#" + colour.substring(1, 2) + colour.substring(1, 2) + colour.substring(2, 3) + colour.substring(2, 3) + colour.substring(3, 4) + colour.substring(3, 4);}
else
{ returnColour = colour;}
}
return returnColour;}
function get_style(obj, property, propertyNS)
{ try
{ if(obj.currentStyle)
{ var returnVal = eval("obj.currentStyle." + property);}
else
{ if(isSafari && obj.style.display == "none")
{ obj.style.display = ""; var wasHidden = true;}
var returnVal = document.defaultView.getComputedStyle(obj, '').getPropertyValue(propertyNS); if(isSafari && wasHidden)
{ obj.style.display = "none";}
}
}
catch(e)
{ }
return returnVal;}
function getElementsByClass(searchClass, node, tag)
{ var classElements = new Array(); if(node == null)
node = document; if(tag == null)
tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)"); for (i = 0, j = 0; i < elsLen; i++)
{ if(pattern.test(els[i].className))
{ classElements[j] = els[i]; j++;}
}
return classElements;}
function newCurvyError(errorMessage)
{ return new Error("curvyCorners Error:\n" + errorMessage)
}
