/*
 * 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;
}

/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

if(typeof YAHOO=="undefined"){var YAHOO={};}
YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.init=function(){this.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
if(unique){ls.push(l);}}}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[],getVersion:function(name){return YAHOO.env.modules[name]||null;}};YAHOO.lang={isArray:function(obj){if(obj.constructor&&obj.constructor.toString().indexOf('Array')>-1){return true;}else{return YAHOO.lang.isObject(obj)&&obj.constructor==Array;}},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===null;},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return typeof obj=='object'||YAHOO.lang.isFunction(obj);},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){if(Object.prototype.hasOwnProperty){return obj.hasOwnProperty(prop);}
return!YAHOO.lang.isUndefined(obj[prop])&&obj.constructor.prototype[prop]!==obj[prop];},extend:function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;i=i+1){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}}};YAHOO.init();YAHOO.util.Lang=YAHOO.lang;YAHOO.augment=YAHOO.lang.augment;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.2.0",build:"127"});

/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
if(propertyCache[property]){return propertyCache[property];}
while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}
YAHOO.util.Dom={get:function(el){if(!el){return null;}
if(typeof el!='string'&&!(el instanceof Array)){return el;}
if(typeof el=='string'){return document.getElementById(el);}
else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}
return collection;}
return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}
var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}
var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}
else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}
if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}
if(el.parentNode){parentNode=el.parentNode;}
else{parentNode=null;}
while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML')
{if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}
return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
var pageXY=this.getXY(el);if(pageXY===false){return false;}
var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el['className']);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}
el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}
var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}
var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}
el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}
if(!el.id){el.id=prefix+id_counter++;}
return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}
else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}
else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}
else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}
parent=parent.parentNode;}
return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}
var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}
for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}
return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}
return method.call(scope,el,o);}
var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}
collection[collection.length]=method.call(scope,el[i],o);}
return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
return width;}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}
this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.2.0",build:"127"});

/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var lastError=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/KHTML/gi).test(navigator.userAgent),webkit:function(){var v=navigator.userAgent.match(/AppleWebKit\/([^ ]*)/);if(v&&v[1]){return v[1];}
return null;}(),isIE:(!this.webkit&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
if(!el){return false;}
if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
return false;}
var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
return id;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}
if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
j=j-1;}
l=null;EU.clearCache();}
for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}
EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
var argslength=args.length;if(!this.silent){}
for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}
var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
if(false===ret){if(!this.silent){}
return false;}}}
return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.2.0",build:"127"});

/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id)
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
{this._use_default_post_header=b;},setDefaultXhrHeader:function(b)
{this._use_default_xhr_header=b;},setPollingInterval:function(i)
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
{var obj,http;try
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
catch(e)
{for(var i=0;i<this._msxml_progid.length;++i){try
{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
catch(e){}}}
finally
{return obj;}},getConnectionObject:function()
{var o;var tId=this._transaction_id;try
{o=this.createXhrObject(tId);if(o){this._transaction_id++;}}
catch(e){}
finally
{return o;}},asyncRequest:function(method,uri,callback,postData)
{var o=this.getConnectionObject();if(!o){return null;}
else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri,postData);this.releaseObject(o);return;}
if(method.toUpperCase()=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
else{uri+="?"+this._sFormData;}}
else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)
{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){delete oConn._timeOut[o.tId];}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
{if(!callback){this.releaseObject(o);return;}
var httpStatus,responseObject;try
{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}
else{httpStatus=13030;}}
catch(e){httpStatus=13030;}
if(httpStatus>=200&&httpStatus<300){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
else{callback.success.apply(callback.scope,[responseObject]);}}}
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}
break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}}}
this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
{var obj={};var headerObj={};try
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
catch(e){}
obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
if(callbackArg){obj.argument=callbackArg;}
return obj;},initHeader:function(label,value,isDefault)
{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
else{headerObj[label]=value+","+headerObj[label];}
if(isDefault){this._has_default_headers=true;}
else{this._has_http_headers=true;}},setHeader:function(o)
{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers
this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){oForm=formId;}
else{return;}
if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
{switch(oElement.type)
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';hasSubmit=true;}
break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';break;}}}
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;if(window.ActiveXObject){var io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
else if(typeof secureURI=='string'){io.src=secureUri;}}
else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding=uploadEncoding;}
else{this._formNode.enctype=uploadEncoding;}
if(postData){var oElements=this.appendPostData(postData);}
this._formNode.submit();if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
this.resetFormState();var uploadCallback=function()
{var obj={};obj.tId=id;obj.argument=callback.argument;try
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
catch(e){}
if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
else{callback.upload.apply(callback.scope,[obj]);}}
if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
else{io.removeEventListener('load',uploadCallback,false);}
setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
{if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){delete this._timeOut[o.tId];}
this.handleTransactionResponse(o,callback,true);return true;}
else{return false;}},isCallInProgress:function(o)
{if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}
else{return false;}},releaseObject:function(o)
{o.conn=null;o=null;}};
YAHOO.register("connection", YAHOO.widget.Module, {version: "2.2.0", build: "127"});

/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/

YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}
tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
queue=[];thread=null;tweenCount=0;}
else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
tween._onTween.fire();}
else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}
return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}
var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}
return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}
val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}
else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d/2)==2){return b+c;}
if(!p){p=d*(.3*1.5);}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
control=tmp;}
if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}
if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}
else{Y.Dom.setXY(el,Y.Dom.getXY(el));}
start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}
this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}
else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.2.0",build:"127"});


// sequenza di importazione YAHOO - DOM - EVENT - CONNECT - ANIMb (tutti min)
/* Copyright (c) 2006, IconMedialab */
var sHttpRoot = "";
var errPage = "/errPage.asp";
var $ = YAHOO.util.Dom.get;
var allFormElementToValidate = new Array();
var isSubmit=0;
var idFormSubmit;
var backToPage;
var submitFormPage;
var errFormSubmit;
var errFormSubmitCorretto;
var modalDiv;
var fumettoErroreGenerale;
var fumettoErroreCampo;

errFormSubmitCorretto = "Attenzione: verifica la correttezza dei dati inseriti nei campi evidenziati in rosso e prova ad inserirli nuovamente.";

function setHeights()
{	
	$("subcontainer2").style.height = null;
	$("subcontainer2").style.height = ($("subcontainer2").offsetHeight<442)?"442px":($("subcontainer2").offsetHeight+"px");
	$("bg_soffietto").style.height = $("subcontainer2").offsetHeight-442+"px";
	$("content_bg_soffietto").style.height =  $("bg_soffietto").offsetHeight+"px";
	$("subcontainer1").style.height = $("subcontainer2").offsetHeight+"px";
	$("footer").style.top=$("subcontainer2").offsetHeight+$("subcontainer2").offsetTop-26+"px";
	
	if($("modalDiv")){
		modalDiv.style.height=eval($("footer").offsetHeight+$("footer").offsetTop+40)+"px";
		if (parseInt(document.body.clientHeight) > parseInt($("footer").offsetHeight+$("footer").offsetTop+40))
		{
			modalDiv.style.height=document.body.clientHeight+"px";
		}
		modalDiv.style.width="100%";
		YAHOO.util.Dom.setStyle(modalDiv.id, "opacity", 0.0);
		YAHOO.util.Dom.setStyle(fumettoErroreGenerale.id, "opacity", 0.0);
		YAHOO.util.Dom.setStyle(fumettoErroreCampo.id, "opacity", 0.0);
	}
	var formcontent;
	if($("preventivo_flusso")){
		if($("form_content"))
			formcontent="form_content";
		else
			formcontent="form_riepilogo_content";
		
		if ($(formcontent)){
		
			
			$(formcontent).style.height=null;
			
			if( eval($("preventivo_flusso").offsetHeight-259)>$(formcontent).offsetHeight){
				$(formcontent).style.height=eval($("preventivo_flusso").offsetHeight-259)+"px";
			}
	}
	}
	
}

function openPopup(page){
	var winLeft = (screen.width-355)/2;
	var winTop = (screen.height-540)/2;
	window.open(page,"popup","width=355px,height=540px,resizable=no,menubar=no,scrollbars=no,status=no,toolbar=no,titlebar=no,top="+winTop+",left="+winLeft);
	return false;
}

function panelManage(panelIndex,side){
	if($("form_content"))
		$("form_content").style.height=null;
	var cName = $("expPanel_"+panelIndex).className ;
	if(cName == "exp_panel_off"){
		$("expPanel_"+panelIndex).className = "exp_panel_on";
		$("expButton_"+panelIndex).src = sHttpRoot + "/images/expand_"+side+"_on.gif";
	}else if(cName == "exp_panel_on"){
		$("expPanel_"+panelIndex).className = "exp_panel_off";
		$("expButton_"+panelIndex).src = sHttpRoot + "/images/expand_"+side+"_off.gif";
	}
	setHeights();
}

	function LTrim(value) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
function RTrim(value) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
function trim(value) {
	return LTrim(RTrim(value));
}
function getY( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
	iReturnValue += oElement.offsetTop;
	oElement = oElement.offsetParent;
	}
	return iReturnValue;
}
function getX( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function cercaNeiRadio(idRadio, valueToSearch)
{
	for(var i=0;i<document.forms[$(idRadio).form.name].elements[idRadio].length;i++)
	{
		if(document.forms[$(idRadio).form.name].elements[idRadio][i].value==valueToSearch)
			document.forms[$(idRadio).form.name].elements[idRadio][i].checked=true;
	}
}

function tornaValueRadio(idRadio)
{
	for(var i=0;i<document.forms[$(idRadio).form.name].elements[idRadio].length;i++)
	{
		if(document.forms[$(idRadio).form.name].elements[idRadio][i].checked==true)
			return document.forms[$(idRadio).form.name].elements[idRadio][i].value;
	}
}

function disableRadio(idRadio)
{
	for(var i=0;i<document.forms[$(idRadio).form.name].elements[idRadio].length;i++)
	{
		if(document.forms[$(idRadio).form.name].elements[idRadio][i].disabled==false)
			document.forms[$(idRadio).form.name].elements[idRadio][i].disabled=true;
	}
}

function cercaNellaSelect(idSelect, valueToSearch){
	for(var i=0;i<$(idSelect).options.length;i++){
		if($(idSelect).options[i].value==valueToSearch)
			$(idSelect).selectedIndex=i;
	}
}
	
function showHideSelect(action) {
	if (action!="visible"){action="hidden";}
	if (navigator.appName.indexOf("MSIE")>=0 || navigator.appName.indexOf("Microsoft")>=0) {
		for (var S = 0; S < document.forms.length; S++){
			for (var R = 0; R < document.forms[S].length; R++) {
				if (document.forms[S].elements[R].options) {
					document.forms[S].elements[R].style.visibility = action;
				}
			}
		}
	}
}


var eseguisubmitform;
eseguisubmitform=true;

function firstSubmit(){
	document.body.style.cursor = "wait";
	for (var i = 0;i<allFormElementToValidate.length;i++){
		if(allFormElementToValidate[i].isInError == -1)
			allFormElementToValidate[i].AJAXValidate(this,allFormElementToValidate[i]);
	}
	$(idFormSubmit).disabled=true;
	if (!modificaContattiPolizza && !mktFormValidate){
		$(idFormSubmit).src = ($(idFormSubmit).src).replace(".gif","_off.gif");
	}
	isSubmit=1;
	recursiveSubmit();
	return false;
}
var erroregenerale = true;
var associaPreventivo = false;
var mktFormValidate = false;
var showRiepilogoAgenda = false;
var sendCometeMsg = false;
var sendMsgMail = false;
var sendMsgAbuso = false;
var sendPassalinear = false;
var mngProfiloTribu = false;
var modificaContattiPolizza = false;
var isLoadComuni = false;	
var isIntermediari = false;
var isCalcolatore = false;
var isSinistri = false;

function recursiveSubmit(){
	var t=0;
	for (var i = 0;i<allFormElementToValidate.length;i++){

		if(allFormElementToValidate[i].isInError == -1){
			allFormElementToValidate[i].AJAXValidate(this,allFormElementToValidate[i]);
			i=0;
		}
		if(allFormElementToValidate[i].isInError <= -1){
			//allFormElementToValidate[i].AJAXValidate(this,allFormElementToValidate[i]);
			return true;
		}
		if(allFormElementToValidate[i].isInError == 0){
			t++;
		}
	}
	isSubmit=0;
	if(t!=0){
		
		$(idFormSubmit).disabled=false;
		$(idFormSubmit).src = ($(idFormSubmit).src).replace("_off.gif",".gif");
		if (swapper==0) 
			swapper=1;
		isSubmit=0;
		if(erroregenerale){
			document.body.style.cursor = "auto";
			enableDisablePage("disable");
			showModalErrorBox(eval(getX($(idFormSubmit))+20),eval(getY($(idFormSubmit))-110),errFormSubmitCorretto)
		}
	}
	
	else{
		if (submitFormPage && submitFormPage.length>0){
			var callback =
			{
			    success:function(originalRequest)
				{
						document.body.style.cursor = "auto";				
						if(eseguisubmitform){
							if (trim(originalRequest.responseText) == "" || trim(originalRequest.responseText) == "0")
								location.replace($($(idFormSubmit).form.name).action);
							else
								location.replace(sHttpRoot + errPage + "?err=" + originalRequest.responseText);
						}
						else
						{
							if (associaPreventivo){
								$("err_gen").style.display="none";
						
								if (originalRequest.responseText=="2"){//Hai un codice fiscale
									$("err_login").innerHTML="";
									//associazione realizzata!
									location.replace(sHttpRoot + "/AreaRiservata/");
								}
								if (originalRequest.responseText=="3"){//PREVENTIVO PERFEZIONATO
									$("err_login").innerHTML="";
									enableDisablePage("disable");
									$("layer").style.display="block";//LAYER SCEGLIFIGURA
									window.scroll(0,0);
								}
								else
								{
									if (originalRequest.responseText=="5"){//PREVENTIVO PERFEZIONATO
										window.scroll(0,0);
										$("err_gen").style.display="inline";
									}
									else
									{
										$("err_login").innerHTML="";
									}
								}
							}
							else{
								if (mktFormValidate){
									//MKT: AGENDA, COMETE, PASSALINEAR
									if (showRiepilogoAgenda)
										showRiepilogo();
									if (sendCometeMsg){
										if(sendMsgMail){
											inviaMessaggio();
										}
										else{
											if(sendMsgAbuso){
												segnalaAbuso();
											}
										}
									}
									if(sendPassalinear){
										inviaSegnalazione();
									}	
									if(mngProfiloTribu){
										salvaProfilo();
									}									
								}
								
								if (modificaContattiPolizza){ // dettagliPolizza - Modifica Contatti
									for (i=4; i<11; i++){
										if(($("contatti_"+i))){
											($("contatti_"+i)).className="prova";
											($("contatti_"+i)).disabled=true;
										}
									}
									$("contatti_giorno").className="prova";
									$("contatti_giorno").disabled=true;
									$("contatti_mese").className="prova";
									$("contatti_mese").disabled=true;
									$("contatti_anno").className="prova";
									$("contatti_anno").disabled=true;
									$("comune_residenza").className="prova";
									$("comune_residenza").disabled=true;
									$("divlocalita").style.display="none";
									$("contraente_cap").className="prova";
									$("contraente_cap").disabled=true;
									$(idFormSubmit).disabled=false;
									$(idFormSubmit).src = sHttpRoot + "/images/btn_modifica_contatti.gif";
									var respText=originalRequest.responseText;
									var respTextArray=respText.split("|");
									if (respTextArray.length >= 3){
										val_comune_residenza = respTextArray[0];
										val_endLocalita = respTextArray[1];
										val_contraente_cap = respTextArray[2];
									}
		
								}
								
								if (isIntermediari) //registrazione Broker e agenti (layer di conferma dal riepilogo registrazione)
								{
									enableDisablePage("disable");
									$("layer").style.display="block";
									window.scroll(0,0);
									if (!(originalRequest.responseText=="0" || originalRequest.responseText==""))
									{
										$("txt_err").innerHTML="Si e' verificato un errore, la invitiamo a ripetere la procedura.";
									}
								}
								
								if (isCalcolatore) 
								{
									$("result").innerHTML= originalRequest.responseText;
								}
								
								
							}
						}
						if (!modificaContattiPolizza){	
							$(idFormSubmit).disabled=true;
						}
						if(isCalcolatore){
							$(idFormSubmit).disabled=false;
						}
						isSubmit=0;
				},
				failure:function(o)
				{
					$(idFormSubmit).disabled=false;
//					if(isCalcolatore)
//						$("result").innerHTML= "Impossibile calcolare";
					location.href = sHttpRoot + errPage + "?err=1";
				}
			};
				if(eseguisubmitform || associaPreventivo || mktFormValidate || modificaContattiPolizza || isIntermediari || isCalcolatore){
					
					//$(idFormSubmit).src = ($(idFormSubmit).src).replace(".gif","_off.gif");
					//tempfileimg = ($(idFormSubmit).src).replace(".gif","_off.gif");
					//$(idFormSubmit).src = (tempfileimg).replace("_off_off","_off");
					
					document.body.style.cursor = "wait";
					$(idFormSubmit).blur();
					$(idFormSubmit).disabled=true;
					var hashtemp = String(YAHOO.util.Connect.setForm($($(idFormSubmit).form.name))).substring(0,String(YAHOO.util.Connect.setForm($($(idFormSubmit).form.name))).length-6);

					if ($("hash"))
						$("hash").value = hex_md5(hashtemp);
					YAHOO.util.Connect.setForm($($(idFormSubmit).form.name));
					YAHOO.util.Connect.asyncRequest("GET", submitFormPage , callback);
					
					if(!mktFormValidate){
						$(idFormSubmit).disabled=true;
						for(var k=0;k<document.forms[$(idFormSubmit).form.name].length;k++){
							document.forms[$(idFormSubmit).form.name][k].disabled=true;
							//alert(k);
						}
					}
				}
				else
				{
					if (!isCalcolatore) {
						$(idFormSubmit).disabled=false;	
					}
					if (isSinistri)
					{
						document.body.style.cursor = "auto";
						$("riepDol").style.display="block";//Riepilogo
						$("startDol").style.display="none";//Riepilogo
						
						$("rTarga").innerHTML = $("targa").value;
						$("rModello").innerHTML = $("modello_span").value;
						$("rImm").innerHTML = $("imm_span").value;
						$("rPolizza").innerHTML = $("polizze_span").value;
						$("rTipoCond").innerHTML = $("conducente_radio").value;
						$("rNomeCond").innerHTML = $("nome_cond").value;
						$("rCognomeCond").innerHTML = $("cognome_cond").value;
						$("rDtNascita").innerHTML = $("g_nascita_cond").value + "/" +$("m_nascita_cond").value + "/" +$("a_nascita_cond").value;
						$("rSessoCond").innerHTML = $("sesso_cond").value;
						$("rIndCond").innerHTML = $("ind_cond").value;
						$("rComuneCond").innerHTML = $("comune_cond").value;
						$("rCapCond").innerHTML = $("cap_cond").value;
						$("rProvCond").innerHTML = $("prov_cond").value;
						$("rCodFiscCond").innerHTML = $("cf_cond").value;
						$("rPersonaContatta").innerHTML = $("persona_contattare").value;
						$("rTelefonoContatta").innerHTML = $("persona_telefono").value;
						$("rCellulareContatta").innerHTML = $("persona_cell").value;
						$("rDisponibilitaContatta").innerHTML = $("persona_disp").value;
						$("rMailContatta").innerHTML = $("persona_email").value;
						$("rDtSinistro").innerHTML = $("sinistro_giorno").value + "/" +$("sinistro_mese").value + "/" +$("sinistro_anno").value;
						$("rTipoSinistro").innerHTML = $("tipologia_sinistro").value;
						$("rDinamicaSinistro").innerHTML = $("dinamica").value;
						$("rIndSinistro").innerHTML = $("ind_sinistro").value;
						$("rComuneSinistro").innerHTML = $("comune_sinistro").value;
						$("rNumVeicoliSinistro").innerHTML = $("num_veicoli_sinistro").value;
						
						$("rTarga1").innerHTML = $("targa_veicolo_1").value;
						$("rTarga2").innerHTML = $("targa_veicolo_2").value;
						$("rTarga3").innerHTML = $("targa_veicolo_3").value;
						$("rTarga4").innerHTML = $("targa_veicolo_4").value;
						$("rTarga5").innerHTML = $("targa_veicolo_5").value;
						$("rAssic1").innerHTML = $("assic_veicolo_1").value;
						$("rAssic2").innerHTML = $("assic_veicolo_2").value;
						$("rAssic3").innerHTML = $("assic_veicolo_2").value;
						$("rAssic4").innerHTML = $("assic_veicolo_4").value;
						$("rAssic5").innerHTML = $("assic_veicolo_5").value;
						
						setHeights();
						window.scroll(0,0);
					}
					if (isReclami)
					{
						document.body.style.cursor = "auto";
						$("riepDol").style.display="block";   
						$("startDol").style.display="none";   
						$("rcognome_span").innerHTML = $("cognome_span").value;
						$("rnome_span").innerHTML = $("nome_span").value;
						$("rindirizzo_span").innerHTML = $("indirizzo_span").value;
						$("rcap_span").innerHTML = $("cap_span").value;
						$("rcitta_span").innerHTML = $("citta_span").value;
						$("rcmb_prov").innerHTML = $("cmb_prov").value;
						$("rtelefono").innerHTML = $("telefono").value;
						$("remail").innerHTML = $("email").value;
						$("rnrpolprev_span").innerHTML = $("nrpolprev_span").value;
						switch($("cmb_clienteLinear").value)	
							{
							case 'pr': 
								$("rcmb_clienteLinear").innerHTML = "Polizza/Preventivo ";
								break;    
							case 'sx': 
								$("rcmb_clienteLinear").innerHTML = "Gestione Sinistro ";
								break;    
							default: 
								$("rcmb_clienteLinear").innerHTML = "Altro "; 
								$("rnrpolprev_span").innerHTML = "";                                                                       
							}
						$("rreclamo").innerHTML = $("reclamo").value;
						$("rprivacy").innerHTML = $("privacy").value==1 ? 'Si, accetto i termini e le condizioni espresse sulla privacy' : 'No, non accetto i termini e le condizioni espresse sulla privacy'; 
						
						setHeights();
						window.scroll(0,0);
					}
				}
		}
		else
		{
			if(eseguisubmitform){
				document.forms[$(idFormSubmit).form.name].submit();
			}
				
		}
		
	}
	return false;
}


function hideSingleErrorBox()
{
	var fumErr=fumettoErroreCampo;
	var fumErrContent=$("fumetto_content_bottom");
	YAHOO.util.Dom.setStyle(fumErr, "opacity", 0.0);
	fumErrContent.innerHTML="";
	fumErr.style.display = "none";
}

function showSingleErrorBox(leftPos,topPos,errString,DxMidSx)
{
	hideSingleErrorBox();
	var fumErr=fumettoErroreCampo;
	var fumErrContent=$("fumetto_content_bottom");
	var fumErrArrow=$("fumetto_top_sx");

	if(!fumErrArrow){
		fumErrArrow=$("fumetto_top_mid");
		if(!fumErrArrow)
			fumErrArrow=$("fumetto_top_dx");
	}
	if(fumErrArrow)
		fumErrArrow.id = "fumetto_top_";
	else
		fumErrArrow=$("fumetto_top_");


	if (document.layers)
	{
		fumErr.style.top=topPos;
		fumErr.style.left=leftPos;
	}
	else
	{
		fumErr.style.top=topPos+"px";
		fumErr.style.left=leftPos+"px";
	}

	fumErrArrow.id = fumErrArrow.id + DxMidSx;
	fumErrContent.innerHTML = errString;
	YAHOO.util.Dom.setStyle(fumErr, "opacity", 0.9);
	fumErr.style.display = "block";
}

function showModalErrorBox(leftPos,topPos,errString)
{
	var fumErr=fumettoErroreGenerale;
	var fumErrContent=$("span_fumetto_content_top");

	if (document.layers)
	{
		fumErr.style.top=topPos;
		fumErr.style.left=leftPos;
	}
	else
	{
		fumErr.style.top=topPos+"px";
		fumErr.style.left=leftPos+"px";
	}
	window.scroll(0,topPos);
	fumErrContent.innerHTML = errString;

	var fadeInAnims = new YAHOO.util.Anim(fumErr, { opacity: {from: 0, to: 0.8} }, 0.3 );
	fadeInAnims.onTween.subscribe(function(){
		fumErr.style.display = "block";
	});
	fadeInAnims.animate();
}

function enableDisablePage(action)
{
	var fadeInAnim;

		if(action=="enable")
		{
			fadeInAnim = new YAHOO.util.Anim(modalDiv.id, { opacity: {to: 0.0} }, 0.1 );
			fadeInAnim.onComplete.subscribe(function(){
				showHideSelect("visible");
				modalDiv.style.display="none";
			});
		}
		else
		{
			showHideSelect("hidden");
			modalDiv.style.display="block";
			fadeInAnim = new YAHOO.util.Anim(modalDiv.id, { opacity: {to: 0.6} }, 0.2 );
		}
		fadeInAnim.animate();

}

function modalHideErrorBox()
{
	var fumerr=fumettoErroreGenerale;
	var fumerrcontent=$("span_fumetto_content_top");
	fumerrcontent.innerHTML="";
	var fadeInAnim = new YAHOO.util.Anim(fumerr.id, { opacity: {to: 0.0} }, 0.3 );
	fadeInAnim.onComplete.subscribe(function(){
		fumerr.style.display="none";
	});
	fadeInAnim.animate();
}

function forzaCmbCU(id,cu) {
	$("cu_bersani").value=cu;
	$("label_cu").innerHTML="La classe del veicolo di riferimento, e con la quale verrà calcolato il preventivo, è la seguente:";
	$(id).readOnly="readOnly";
	$(id).disabled=true;
	cercaNellaSelect(id,$("cu_bersani").value);
}

function gestisciCmbCU(tipoAtt){
	if (tipoAtt==36) {
		$("classe_merito_cb").readOnly="";
		$("classe_merito_cb").disabled=false;
		$("label_cu").innerHTML="Inserisci la classe CU presente sulla polizza del veicolo di riferimento";
	}
	if (tipoAtt==35) {
		$("targa_bersani").value="";
		$("classe_merito_cb").value=14;
	}
}

function backToNormalPage()
{
	modalHideErrorBox();
	enableDisablePage("enable");
	return false;
}


function formElementToValidate(idFormElementToValidate,errString,urlToValidatePage,arrowOffsetLeft,arrowOffsetTop,DxMidSx)
{
	var tempFormElementArray  = new Array();
	var tempVar = "";
	tempFormElementArray = idFormElementToValidate.split("|");
	if (tempFormElementArray.length > 1){
		tempVar = tempFormElementArray[1];
	}
	this.noempty = tempVar;
	this.idFormElement = tempFormElementArray[0];
	
	this.errString = errString;
	this.urlToValidatePage = sHttpRoot + "/_include/_ajaxValidate/" + urlToValidatePage;
	this.arrowOffsetLeft = arrowOffsetLeft;
	this.arrowOffsetTop = arrowOffsetTop;
	this.focusSubmit = function(e,me)
	{
		if(me.isInError==0){
			showSingleErrorBox(eval(getX($(me.idFormElement))-36+arrowOffsetLeft),eval(getY($(me.idFormElement))+18+arrowOffsetTop),me.errString,DxMidSx);
		}
	}
	this.isInError = -1;
	
	this.AJAXValidate = function(e,me)
	{
		hideSingleErrorBox();
		var target = $(me.idFormElement);

		var callback =
		{
		    success:function(originalRequest)
			{
				var respText=originalRequest.responseText;
				var respTextArray=respText.split("|");
				if(trim(respTextArray[0])=="1" && me.isInError!=1){
					me.isInError=1;
					target.className=target.type;
					if(respTextArray.length > 1){
						if(target.id=="targa_bersani") {
							if(respTextArray[5]!="0" && respTextArray[5]!="") {
								forzaCmbCU("classe_merito_cb" ,respTextArray[5]);
							}
						}else{
							allFormElementToValidate[assocFormElement[(respTextArray[1]+"mese")]].isInError=1;
							$(respTextArray[1]+"mese").className=$(respTextArray[1]+"mese").type;
							allFormElementToValidate[assocFormElement[(respTextArray[1]+"anno")]].isInError=1;
							$(respTextArray[1]+"anno").className=$(respTextArray[1]+"anno").type;
							if($(respTextArray[1]+"giorno")){
								allFormElementToValidate[assocFormElement[(respTextArray[1]+"giorno")]].isInError=1;
								$(respTextArray[1]+"giorno").className=$(respTextArray[1]+"giorno").type;
							}
						}
					}
				}
				
				if(trim(respTextArray[0])=="2" && me.isInError!=1){
					if(respTextArray.length > 1){
						me.isInError=1;
						if(allFormElementToValidate[assocFormElement[(respTextArray[1]+"mese")]].isInError!=1)
							allFormElementToValidate[assocFormElement[(respTextArray[1]+"mese")]].isInError=-1;
						$(respTextArray[1]+"mese").className=$(respTextArray[1]+"mese").type;
						if(allFormElementToValidate[assocFormElement[(respTextArray[1]+"anno")]].isInError!=1)
							allFormElementToValidate[assocFormElement[(respTextArray[1]+"anno")]].isInError=-1;
						$(respTextArray[1]+"anno").className=$(respTextArray[1]+"anno").type;
						if($(respTextArray[1]+"giorno")){
							if(allFormElementToValidate[assocFormElement[(respTextArray[1]+"giorno")]].isInError!=1)
								allFormElementToValidate[assocFormElement[(respTextArray[1]+"giorno")]].isInError=-1;
							$(respTextArray[1]+"giorno").className=$(respTextArray[1]+"giorno").type;
						}
					}
					
				}
				
				if(trim(respTextArray[0])=="0" && me.isInError!=0){
					me.isInError=0;
					target.className="error";
					if(respTextArray.length > 1){
						if(target.id=="targa_bersani") {
							//me.errString = "quellochevuoi";
						}else{
							allFormElementToValidate[assocFormElement[(respTextArray[1]+"mese")]].isInError=0;
							$(respTextArray[1]+"mese").className="error";
							allFormElementToValidate[assocFormElement[(respTextArray[1]+"anno")]].isInError=0;
							$(respTextArray[1]+"anno").className="error";
							if($(respTextArray[1]+"giorno")){
								allFormElementToValidate[assocFormElement[(respTextArray[1]+"giorno")]].isInError=0;
								$(respTextArray[1]+"giorno").className="error";
							}
						}
					}
				}
				
				if(isSubmit==1){
					recursiveSubmit();
				}
			},
			failure:function(o)
			{	
				location.href = sHttpRoot + errPage + "?err=1";
			}
		};
		if(trim($(me.idFormElement).value).length>0)
		{
			me.isInError=-2;
			YAHOO.util.Connect.setForm($($(me.idFormElement).form.name));
			YAHOO.util.Connect.asyncRequest("POST", me.urlToValidatePage, callback);
		}
		else{
			if (me.noempty != "noempty"){
				me.isInError=0;
				target.className="error";
			}
			else{
				me.isInError=-2;
				YAHOO.util.Connect.setForm($($(me.idFormElement).form.name));
				YAHOO.util.Connect.asyncRequest("POST", me.urlToValidatePage, callback);
			}
		}
	}
	YAHOO.util.Event.addListener(this.idFormElement,"blur",this.AJAXValidate,this);
	YAHOO.util.Event.addListener(this.idFormElement,"focus",this.focusSubmit,this);
	if($(this.idFormElement).tagName=="SELECT"){
		YAHOO.util.Event.addListener(this.idFormElement,"change",this.AJAXValidate,this);
		YAHOO.util.Event.addListener(this.idFormElement,"keyup",this.AJAXValidate,this);
	}
	//if($(this.idFormElement).tagName=="INPUT" && ($(this.idFormElement).type=="radio" || $(this.idFormElement).type=="checkbox"))
	//	YAHOO.util.Event.addListener(this.idFormElement,"click",this.AJAXValidate,this);
}

	YAHOO.util.Event.addListener("localita","change",cambia_localita,this);
	YAHOO.util.Event.addListener("localita","keyup",cambia_localita,this);
	YAHOO.util.Event.addListener("comune_residenza","keyup",patchValidazioneLocalita,this);

function patchValidazioneLocalita(o)
{
	allFormElementToValidate[assocFormElement["localita"]].isInError=-2;
}
function cambia_localita(o)
{
if($("localita").value!="-1"){
$("comune_residenza").value=trim(($("localita").options[$("localita").selectedIndex].text).split(" -")[0]);

}
}

function showCartaDiCredito(showHide) {
	if(showHide){//SI
		$("carta_si").style.display="block";
		allFormElementToValidate[assocFormElement["cc_nome"]].isInError = -1;
		allFormElementToValidate[assocFormElement["cc_cognome"]].isInError = -1;
		allFormElementToValidate[assocFormElement["cc_circuito"]].isInError = -1;
		allFormElementToValidate[assocFormElement["cc_numero"]].isInError = -1;
		allFormElementToValidate[assocFormElement["cc_cvv"]].isInError = -1;
		allFormElementToValidate[assocFormElement["cc_scadenza_mese"]].isInError = -1;
		allFormElementToValidate[assocFormElement["cc_scadenza_anno"]].isInError = -1;
	}
	else{//NO
		$("carta_si").style.display="none";
		allFormElementToValidate[assocFormElement["cc_nome"]].isInError = 1;
		allFormElementToValidate[assocFormElement["cc_cognome"]].isInError = 1;
		allFormElementToValidate[assocFormElement["cc_circuito"]].isInError = 1;
		allFormElementToValidate[assocFormElement["cc_numero"]].isInError = 1;
		allFormElementToValidate[assocFormElement["cc_cvv"]].isInError = 1;
		allFormElementToValidate[assocFormElement["cc_scadenza_mese"]].isInError = 1;
		allFormElementToValidate[assocFormElement["cc_scadenza_anno"]].isInError = 1;
	}
	$("cc_nome").className="text";
	$("cc_cognome").className="text";
	$("cc_circuito").className="";
	$("cc_numero").className="text";
	$("cc_cvv").className="text";
	$("cc_scadenza_mese").className="";
	$("cc_scadenza_anno").className="";
}

function validazioneCodFisc() {
	allFormElementToValidate[assocFormElement["cod_fisc"]].isInError = -1;
	$("cod_fisc").className = "text";
}	

function showRilascioPatente(showHide) {
	if(showHide){//SI
		$("patente_si").style.display="block";
		allFormElementToValidate[assocFormElement["patente_mese"]].isInError = -1;
		allFormElementToValidate[assocFormElement["patente_anno"]].isInError = -1;
	}
	else{//NO
		$("patente_si").style.display="none";
		allFormElementToValidate[assocFormElement["patente_mese"]].isInError = 1;
		allFormElementToValidate[assocFormElement["patente_anno"]].isInError = 1;
	}
	//allFormElementToValidate[assocFormElement["patente_mese"]].isInError = -1;
	//allFormElementToValidate[assocFormElement["patente_anno"]].isInError = -1;
	$("patente_mese").className="text";
	$("patente_anno").className="text";
	setHeights();
}

function showAltraPolizza(showHide) {
	if(showHide){//SI
		$("polizza_familiari_si").style.display="block";
		allFormElementToValidate[assocFormElement["polizza_familiari_numero"]].isInError = -1;
	}
	else{//NO
		$("polizza_familiari_si").style.display="none";
		allFormElementToValidate[assocFormElement["polizza_familiari_numero"]].isInError = 1;
	}
	$("polizza_familiari_numero").className="text";
}
var doChangeCap = false;
function load_comuni(e)
{
	var callback =
	{
	    success:function(originalRequest)
		{
			
			$("localita").options.length = 0;
			
			$("localita").disabled=false;
			var array_allestimenti = originalRequest.responseText.split("|");
			var temp_allestimenti;
			$("localita").options[0]=new Option("Seleziona una localita","-1");
			for (var x=0;x<array_allestimenti.length-1;x++){
				temp_allestimenti=array_allestimenti[x].split("_");
				$("localita").options[x+1]=new Option(temp_allestimenti[0],temp_allestimenti[1]);
			}
			/*
			if ($("localita").length == 2) {
				$("localita").selectedIndex = 1;
				$("divlocalita").style.display="none";
				$("comune_residenza").value=trim(($("localita").options[1].text).split(" -")[0]);
				allFormElementToValidate[assocFormElement["localita"]].isInError = 1;
				if($("contraente_cap"))
						changeCap();
			}
			*/
			if ($("localita").length > 1){
				document.body.style.cursor = "auto";
				var temp_loc;
				var exfor = true;
				for(var scorri_loc=1;(scorri_loc<$("localita").options.length)&&exfor==true;scorri_loc++)
				{
					if ((trim($("comune_residenza").value)).length == (trim(($("localita").options[scorri_loc].text).substring(0,($("localita").options[scorri_loc].text).indexOf(" -")))).length){
						exfor=false;
					}
				}
				
				if (!exfor)
				{//TROVATO UN MATCH scorri_loc - 1 e' il selectedIndex del match trovato
					$("localita").selectedIndex = scorri_loc-1;
					$("divlocalita").style.display="none";
					$("comune_residenza").value=trim(($("localita").options[$("localita").selectedIndex].text).split(" -")[0]);
					allFormElementToValidate[assocFormElement["localita"]].isInError = 1;
					$("localita").className = "select";
					if($("contraente_cap"))
							changeCap();
				}
				else{
				$("localita").selectedIndex = 0;
				$("divlocalita").style.display="block";
				allFormElementToValidate[assocFormElement["localita"]].isInError = -1;
				if($("contraente_cap"))
						changeCap();
				}
				//if(endLocalita!="")
				//	cercaNellaSelect("localita",endLocalita);
			
			}
			if ($("localita").length <= 1){
				$("divlocalita").style.display="none";
				$("localita").options.length = 0;
				allFormElementToValidate[assocFormElement["localita"]].isInError = 1;
				
			}
			if(isSubmit==1){
					recursiveSubmit();
				}
			document.body.style.cursor = "auto";
			setHeights();
		},
		failure:function(o)
		{	
			$("localita").options.length = 0;
			document.body.style.cursor = "auto";
			setHeights();
		}
	};
	
	var target = (e.srcElement)?target=e.srcElement : target=e.target;
	if(!target){
		target=$(e);
	}
	
	
	$("localita").options.length = 1;
	allFormElementToValidate[assocFormElement["localita"]].isInError = -2;
	$("localita").options[0]=new Option("CARICAMENTO LOCALITA' IN CORSO","-1");
	$("localita").selectedIndex = 0;
	document.body.style.cursor = "wait";
	YAHOO.util.Connect.setForm($(target.form.name));
	YAHOO.util.Connect.asyncRequest("POST", sHttpRoot + "/_include/_ajaxRequest/inc_j_localita.asp", callback);
	$("localita").disabled=true;
	
}

var endLocalita="";
var swapper;
function uploadImage(e){
	
	var target;
	target = (e.srcElement)?target=e.srcElement : target=e.target;
	
	var callback =
	{
	    upload:function(originalRequest)
		{
			var tempImgFile;
			document.body.style.cursor = "auto";
			if (originalRequest.responseText == "0"){
				$("esito").innerHTML="Selezionare un file di estensione jpg, gif o jpeg senza superare i 512Kb";	
			}
			else{
				tempImgFile = new Image();
				tempImgFile.src = sHttpRoot + "/images/avatar/" + originalRequest.responseText;
			
				$("avatarImage").src=tempImgFile.src;
				
				self.location.reload(true); 
			}
			

		},
		failure:function(o)
		{
			$("esito").innerHTML="Errore durante l'upload. Riprovare.";
			document.body.style.cursor = "auto";		
		}
	};
	document.body.style.cursor = "wait";
	$(target.form.name).enctype = 'multipart/form-data';
	YAHOO.util.Connect.setForm($(target.form.name),true);
	YAHOO.util.Connect.asyncRequest("POST", sHttpRoot + "/_include/_ajaxRequest/inc_j_uploadAvatar.asp", callback);
	$(target.form.name).enctype = 'application/x-www-form-urlencoded';
	return false;
}

function buono_sconto(e)
{
	var target;
	target = (e.srcElement)?target=e.srcElement : target=e.target;
	
	var callback =
	{
	    success:function(originalRequest)
		{
			var array_sconto = originalRequest.responseText.split("|");
			var cImporto = array_sconto[0];
			var iTipoSconto = array_sconto[1];
			var iStatoSconto = array_sconto[2];
			var bUsabile = array_sconto[3];
			var cPremioScontato = array_sconto[4];
			var cImportoScontoAnnuo = array_sconto[5];
			var cPremioScontatoAnnuo = array_sconto[6];
			var cPremioAnnuo = array_sconto[7];	// è l'importo annuo senza sconti 
			var sDescFraz = array_sconto[8];				// Annuale, Semestrale, Trimestrale, Temporaneo 
			var sCodScontoPrenotato = array_sconto[9];				// Annuale, Semestrale, Trimestrale, Temporaneo 
			//if (bUsabile) {
				switch (iStatoSconto) {
					case "0": 
						$("sconto").innerHTML="<p>Premio Annuale: <strong> " + cPremioAnnuo + " €</strong><br/>Premio Annuale Scontato: <strong> " + cPremioScontatoAnnuo + " €</strong><br/><br/><span style='background: yellow;'>Premio " + sDescFraz + " scontato da pagare: <strong> " + cPremioScontato + " €</strong></span></p><p>Attenzione! Cliccando sul pulsante Acquista, il Buono Sconto sarà applicato al pagamento.</p>"	;
						break;
					case "1": //Chiave non valida
						$("sconto").innerHTML="Il codice che hai inserito è errato. <br/>Verifica il codice che hai ricevuto e prova nuovamente. <br/>Se i problemi persistono vai alla pagina <a href='" + sHttpRoot + "/Contenuti/Linear_contattaci.asp' target='_blank'>contattaci</a>. ";
						break;
					case "2":
						$("sconto").innerHTML="Sconto scaduto";
						break;
					case "3":
						$("sconto").innerHTML="Questo buono sconto è già stato utilizzato su un altro preventivo.";
						break;
					case "4":
						$("sconto").innerHTML="Su questo preventivo è già stato inserito un buono sconto e non puoi utilizzarne un altro.";
						break;
					case "5":
						$("sconto").innerHTML="Non è autovettura uso privato";
						break;
					case "6":
						$("sconto").innerHTML="Ci sono sx negli ultimi 5 anni";
						break;
					case "7":
						$("sconto").innerHTML="Polizza o Multirischio Abitazione";
						break;
					case "100":
						$("sconto").innerHTML="Buono sconto COOP correttamente inserito";
						break;
					case "101":
						$("sconto").innerHTML="Codice buono COOP inesistente";
						break;
					case "102":
						$("sconto").innerHTML="Attenzione! Non hai inserito la garanzia Mini Kasko  sul tuo preventivo: <br/>per usufruire di questo buono sconto torna indietro, seleziona la garanzia e procedi su Acquista.";
						break;
					case "-1":
						$("sconto").innerHTML="Con l'applicazione dello sconto ci sarebbe un cambio di frazionamento";
						break;
					default:
						$("sconto").innerHTML="Buono sconto non valido";
				}				
			//}
			//else {
			//	$("sconto").innerHTML="Buono sconto non valido";
			//}
		},
		failure:function(o)
		{	
			$("sconto").innerHTML="Buono sconto non valido";
		}
	};
	
	$("sconto").innerHTML="";
	if ($("buonosconto").value.length == 10 || $("buonosconto").value.length == 11){
		YAHOO.util.Connect.setForm($(target.form.name));
		YAHOO.util.Connect.asyncRequest("POST", sHttpRoot + "/_include/_ajaxRequest/inc_j_buonoSconto.asp", callback);
	}
	else
		if ($("buonosconto").value.length > 4 )
			$("sconto").innerHTML="Il codice che hai inserito è errato. <br/>Verifica il codice che hai ricevuto via e-mail e prova nuovamente. <br/>Se i problemi persistono vai alla pagina <a href='" + sHttpRoot + "/Contenuti/Linear_contattaci.asp' target='_blank'>contattaci</a>. ";
}

function load_scadenze(iMonth, iYear, bReload){
	var target = $("frmCalendar");				
							
	var callback =
	{
	    success:function(o)
		{
			
			var array_rsScadenze = o.responseText.split("#");
			var rsScadenze;
			var dNow, dDate, sScadenza, sUrl, dYear, dMonth, dDay, sStyle;
			dNow = new Date();
			for (var x=0;x<array_rsScadenze.length-1;x++){
				sStyle = "";
				rsScadenze = array_rsScadenze[x].split("|");
				dYear = rsScadenze[1];
				dMonth = rsScadenze[2];
				dDay = rsScadenze[3];
				sScadenza = rsScadenze[4];
				sUrl = "|" + rsScadenze[0] + "|" + rsScadenze[4] + "|" + rsScadenze[5] + "|" + rsScadenze[6] + "|";
				//sUrl = rsScadenze[4];
				dDate = new Date(dYear, dMonth - 1, dDay);
				sStyle = "day_";
				if(dDate<dNow){
					sStyle = sStyle + "past";
				}
				else{
					sStyle = sStyle + "future";
				}
				sStyle = sStyle + "_special:day_";
				if(dDate<dNow){
					sStyle = sStyle + "past";
				}
				else{
					sStyle = sStyle + "future";
				}
				sStyle = sStyle + "_special";
				addDateLink("calendar", sStyle, "", "dd/mm/yyyy",  dDay + "/" + dMonth + "/" + dYear, sUrl);
				//addDateTips("calendar", sStyle, "", "", "", "dd/mm/yyyy",  dDay + "/" + dMonth + "/" + dYear, sScadenza);
			}
			if($("divCalendar")){
			var oDiv = $("divCalendar");
			var rimosso = document.body.removeChild(oDiv);
			}
			if (parseInt(iMonth) < 10 )
				iMonth="0"+String(iMonth);
			//addDateTips("calendar", "day_future_special:day_future_special", "", "", "", "dd/mm/yyyy",  "18/05/2007", "abababa");
			showCalendar('calendar', null, null, String(iYear) + '-' + String(iMonth) + '-01', 'agenda_box', 0, 0, 0);
			
			setHeights();
		},
		failure:function(o)
		{					
			setHeights();
			//alert(o.responseText)
		}
	};
	var sUrl = sHttpRoot + "/_include/_ajaxRequest/_agenda/inc_j_calendario.asp?Filter=M&iMonth=" + iMonth + "&iYear=" + iYear
	
	YAHOO.util.Connect.asyncRequest("GET", sUrl, callback);
}

function showTip(sUrl){
	var idEl = parseInt(sUrl.split("|")[1]);
	var sScad = sUrl.split("|")[2];
	var sTitolo = sUrl.split("|")[4];
	var sText = "<div class='tip_title'>" + sTitolo + "</div><div class='TipText'>" + sScad + "</div>";
	document.getElementById("divTipBox").innerHTML = sText;
	document.getElementById("divTipBox").style.top = getY(document.getElementById(idEl)) - 10 + "px";
	document.getElementById("divTipBox").style.left = getX(document.getElementById(idEl)) -160 + "px";
	document.getElementById("divTipBox").style.visibility = "visible";
 	//document.location.href = sPage;
}

function mostraTip(idEl,text){
	//alert(idEl+"---"+text);
	document.getElementById("divTipBox").innerHTML = text;
	document.getElementById("divTipBox").style.top = getY(document.getElementById(idEl)) + 10 + "px";
	document.getElementById("divTipBox").style.left = getX(document.getElementById(idEl)) + 10 + "px";
	document.getElementById("divTipBox").style.visibility = "visible";
	document.getElementById("divTipBox").style.width = "200px"; 
	document.getElementById("divTipBox").style.zIndex = "200";
 	//document.location.href = sPage;
}

function chiudiTip(){
	$("divTipBox").style.visibility = "hidden";
 	//document.location.href = sPage;
}

function doLogin()
{
	var callback =
	{
	    success:function(originalRequest)
		{
			document.body.style.cursor = "auto";
			if (originalRequest.responseText=="1"){
				$("err_login").innerHTML="Hai effettutato l'accesso...";
				location.replace(sHttpRoot + "/preventivo/" + flusso + "/come_procedere.asp");
			}
			else
			{
				$("err_login").innerHTML="ERRORE: Username o Password errate."; 
			}
							
		},
		failure:function(o)
		{	
			document.body.style.cursor = "auto";
			$("err_login").innerHTML="Errore di login, riprova";
		}
	};
	$("err_login").innerHTML="Sto validando le credenziali di accesso...";
	document.body.style.cursor = "wait";
	YAHOO.util.Connect.setForm($("frmLogin"));
	YAHOO.util.Connect.asyncRequest("POST", sHttpRoot + "/_include/_ajaxRequest/inc_j_doLogin.asp", callback);
	return false;	
}

function ConvertAsciiToText(pValuea)
{
	var pValue;
	pValue = String(pValuea);
	pValue = pValue.replace("&#32;", " ");
	pValue = pValue.replace("&#33;", "!");
	pValue = pValue.replace("&#34;", "\"");
	pValue = pValue.replace("&#35;", "#");
	pValue = pValue.replace("&#36;", "$");
	pValue = pValue.replace("&#37;", "%");
	pValue = pValue.replace("&#38;", "&");
	pValue = pValue.replace("&#39;", "'");
	pValue = pValue.replace("&#40;", "(");
	pValue = pValue.replace("&#41;", ")");
	pValue = pValue.replace("&#42;", "*");
	pValue = pValue.replace("&#43;", "+");
	pValue = pValue.replace("&#44;", ",");
	pValue = pValue.replace("&#45;", "-");
	pValue = pValue.replace("&#46;", ".");
	pValue = pValue.replace("&#47;", "/");
	pValue = pValue.replace("&#48;", "0");
	pValue = pValue.replace("&#49;", "1");
	pValue = pValue.replace("&#50;", "2");
	pValue = pValue.replace("&#51;", "3");
	pValue = pValue.replace("&#52;", "4");
	pValue = pValue.replace("&#53;", "5");
	pValue = pValue.replace("&#54;", "6");
	pValue = pValue.replace("&#55;", "7");
	pValue = pValue.replace("&#56;", "8");
	pValue = pValue.replace("&#57;", "9");
	pValue = pValue.replace("&#58;", ":");
	pValue = pValue.replace("&#59;", ";");
	pValue = pValue.replace("&#60;", "<");
	pValue = pValue.replace("&#61;", "=");
	pValue = pValue.replace("&#62;", ">");
	pValue = pValue.replace("&#63;", "?");
	pValue = pValue.replace("&#64;", "@");
	pValue = pValue.replace("&#65;", "A");
	pValue = pValue.replace("&#66;", "B");
	pValue = pValue.replace("&#67;", "C");
	pValue = pValue.replace("&#68;", "D");
	pValue = pValue.replace("&#69;", "E");
	pValue = pValue.replace("&#70;", "F");
	pValue = pValue.replace("&#71;", "G");
	pValue = pValue.replace("&#72;", "H");
	pValue = pValue.replace("&#73;", "I");
	pValue = pValue.replace("&#74;", "J");
	pValue = pValue.replace("&#75;", "K");
	pValue = pValue.replace("&#76;", "L");
	pValue = pValue.replace("&#77;", "M");
	pValue = pValue.replace("&#78;", "N");
	pValue = pValue.replace("&#79;", "O");
	pValue = pValue.replace("&#80;", "P");
	pValue = pValue.replace("&#81;", "Q");
	pValue = pValue.replace("&#82;", "R");
	pValue = pValue.replace("&#83;", "S");
	pValue = pValue.replace("&#84;", "T");
	pValue = pValue.replace("&#85;", "U");
	pValue = pValue.replace("&#86;", "V");
	pValue = pValue.replace("&#87;", "W");
	pValue = pValue.replace("&#88;", "X");
	pValue = pValue.replace("&#89;", "Y");
	pValue = pValue.replace("&#90;", "Z");
	pValue = pValue.replace("&#91;", "[");
	pValue = pValue.replace("&#92;", "\\");
	pValue = pValue.replace("&#93;", "]");
	pValue = pValue.replace("&#94;", "^");
	pValue = pValue.replace("&#95;", "_");
	pValue = pValue.replace("&#96;", "`");
	pValue = pValue.replace("&#97;", "a");
	pValue = pValue.replace("&#98;", "b");
	pValue = pValue.replace("&#99;", "c");
	pValue = pValue.replace("&#100;", "d");
	pValue = pValue.replace("&#101;", "e");
	pValue = pValue.replace("&#102;", "f");
	pValue = pValue.replace("&#103;", "g");
	pValue = pValue.replace("&#104;", "h");
	pValue = pValue.replace("&#105;", "i");
	pValue = pValue.replace("&#106;", "j");
	pValue = pValue.replace("&#107;", "k");
	pValue = pValue.replace("&#108;", "l");
	pValue = pValue.replace("&#109;", "m");
	pValue = pValue.replace("&#110;", "n");
	pValue = pValue.replace("&#111;", "o");
	pValue = pValue.replace("&#112;", "p");
	pValue = pValue.replace("&#113;", "q");
	pValue = pValue.replace("&#114;", "r");
	pValue = pValue.replace("&#115;", "s");
	pValue = pValue.replace("&#116;", "t");
	pValue = pValue.replace("&#117;", "u");
	pValue = pValue.replace("&#118;", "v");
	pValue = pValue.replace("&#119;", "w");
	pValue = pValue.replace("&#120;", "x");
	pValue = pValue.replace("&#121;", "y");
	pValue = pValue.replace("&#122;", "z");
	pValue = pValue.replace("&#123;", "{");
	pValue = pValue.replace("&#124;", "|");
	pValue = pValue.replace("&#125;", "}");
	pValue = pValue.replace("&#126;", "~");
	pValue = pValue.replace("&#128;", "€");
	pValue = pValue.replace("&#130;", "‚");
	pValue = pValue.replace("&#131;", "ƒ");
	pValue = pValue.replace("&#132;", "„");
	pValue = pValue.replace("&#133;", "…");
	pValue = pValue.replace("&#134;", "†");
	pValue = pValue.replace("&#135;", "‡");
	pValue = pValue.replace("&#136;", "ˆ");
	pValue = pValue.replace("&#138;", "Š");
	pValue = pValue.replace("&#139;", "‹");
	pValue = pValue.replace("&#140;", "Œ");
	pValue = pValue.replace("&#142;", "Ž");
	pValue = pValue.replace("&#145;", "‘");
	pValue = pValue.replace("&#146;", "’");
	pValue = pValue.replace("&#147;", "“");
	pValue = pValue.replace("&#148;", "”");
	pValue = pValue.replace("&#149;", "•");
	pValue = pValue.replace("&#150;", "–");
	pValue = pValue.replace("&#151;", "—");
	pValue = pValue.replace("&#152;", "˜");
	pValue = pValue.replace("&#153;", "™");
	pValue = pValue.replace("&#154;", "š");
	pValue = pValue.replace("&#155;", "›");
	pValue = pValue.replace("&#156;", "œ");
	pValue = pValue.replace("&#158;", "ž");
	pValue = pValue.replace("&#159;", "Ÿ");
	pValue = pValue.replace("&#160;", " ");
	pValue = pValue.replace("&#161;", "¡");
	pValue = pValue.replace("&#162;", "¢");
	pValue = pValue.replace("&#163;", "£");
	pValue = pValue.replace("&#164;", "¤");
	pValue = pValue.replace("&#165;", "¥");
	pValue = pValue.replace("&#166;", "¦");
	pValue = pValue.replace("&#167;", "§");
	pValue = pValue.replace("&#168;", "¨");
	pValue = pValue.replace("&#169;", "©");
	pValue = pValue.replace("&#170;", "ª");
	pValue = pValue.replace("&#171;", "«");
	pValue = pValue.replace("&#172;", "¬");
	pValue = pValue.replace("&#173;", "&shy;");
	pValue = pValue.replace("&#174;", "®");
	pValue = pValue.replace("&#175;", "¯");
	pValue = pValue.replace("&#176;", "°");
	pValue = pValue.replace("&#177;", "±");
	pValue = pValue.replace("&#178;", "²");
	pValue = pValue.replace("&#179;", "³");
	pValue = pValue.replace("&#180;", "´");
	pValue = pValue.replace("&#181;", "µ");
	pValue = pValue.replace("&#182;", "¶");
	pValue = pValue.replace("&#183;", "·");
	pValue = pValue.replace("&#184;", "¸");
	pValue = pValue.replace("&#185;", "¹");
	pValue = pValue.replace("&#186;", "º");
	pValue = pValue.replace("&#187;", "»");
	pValue = pValue.replace("&#188;", "¼");
	pValue = pValue.replace("&#189;", "½");
	pValue = pValue.replace("&#190;", "¾");
	pValue = pValue.replace("&#191;", "¿");
	pValue = pValue.replace("&#192;", "À");
	pValue = pValue.replace("&#193;", "Á");
	pValue = pValue.replace("&#194;", "Â");
	pValue = pValue.replace("&#195;", "Ã");
	pValue = pValue.replace("&#196;", "Ä");
	pValue = pValue.replace("&#197;", "Å");
	pValue = pValue.replace("&#198;", "Æ");
	pValue = pValue.replace("&#199;", "Ç");
	pValue = pValue.replace("&#200;", "È");
	pValue = pValue.replace("&#201;", "É");
	pValue = pValue.replace("&#202;", "Ê");
	pValue = pValue.replace("&#203;", "Ë");
	pValue = pValue.replace("&#204;", "Ì");
	pValue = pValue.replace("&#205;", "Í");
	pValue = pValue.replace("&#206;", "Î");
	pValue = pValue.replace("&#207;", "Ï");
	pValue = pValue.replace("&#208;", "Ð");
	pValue = pValue.replace("&#209;", "Ñ");
	pValue = pValue.replace("&#210;", "Ò");
	pValue = pValue.replace("&#211;", "Ó");
	pValue = pValue.replace("&#212;", "Ô");
	pValue = pValue.replace("&#213;", "Õ");
	pValue = pValue.replace("&#214;", "Ö");
	pValue = pValue.replace("&#215;", "×");
	pValue = pValue.replace("&#216;", "Ø");
	pValue = pValue.replace("&#217;", "Ù");
	pValue = pValue.replace("&#218;", "Ú");
	pValue = pValue.replace("&#219;", "Û");
	pValue = pValue.replace("&#220;", "Ü");
	pValue = pValue.replace("&#221;", "Ý");
	pValue = pValue.replace("&#222;", "Þ");
	pValue = pValue.replace("&#223;", "ß");
	pValue = pValue.replace("&#224;", "à");
	pValue = pValue.replace("&#225;", "á");
	pValue = pValue.replace("&#226;", "â");
	pValue = pValue.replace("&#227;", "ã");
	pValue = pValue.replace("&#228;", "ä");
	pValue = pValue.replace("&#229;", "å");
	pValue = pValue.replace("&#230;", "æ");
	pValue = pValue.replace("&#231;", "ç");
	pValue = pValue.replace("&#232;", "è");
	pValue = pValue.replace("&#233;", "é");
	pValue = pValue.replace("&#234;", "ê");
	pValue = pValue.replace("&#235;", "ë");
	pValue = pValue.replace("&#236;", "ì");
	pValue = pValue.replace("&#237;", "í");
	pValue = pValue.replace("&#238;", "î");
	pValue = pValue.replace("&#239;", "ï");
	pValue = pValue.replace("&#240;", "ð");
	pValue = pValue.replace("&#241;", "ñ");
	pValue = pValue.replace("&#242;", "ò");
	pValue = pValue.replace("&#243;", "ó");
	pValue = pValue.replace("&#244;", "ô");
	pValue = pValue.replace("&#245;", "õ");
	pValue = pValue.replace("&#246;", "ö");
	pValue = pValue.replace("&#247;", "÷");
	pValue = pValue.replace("&#248;", "ø");
	pValue = pValue.replace("&#249;", "ù");
	pValue = pValue.replace("&#250;", "ú");
	pValue = pValue.replace("&#251;", "û");
	pValue = pValue.replace("&#252;", "ü");
	pValue = pValue.replace("&#253;", "ý");
	pValue = pValue.replace("&#254;", "þ");
	pValue = pValue.replace("&#255;", "ÿ");
	pValue = pValue.replace("&amp;", "&");
	pValue = pValue.replace("&quot;", "\"");
	pValue = pValue.replace("<", "<");
	pValue = pValue.replace(">", ">");
	pValue = pValue.replace("&Agrave;", "À");
	pValue = pValue.replace("&Aacute;", "Á");
	pValue = pValue.replace("&Acirc;", "Â");
	pValue = pValue.replace("&Atilde;", "Ã");
	pValue = pValue.replace("&Auml;", "Ä");
	pValue = pValue.replace("&Aring;", "Å");
	pValue = pValue.replace("&AElig;", "Æ");
	pValue = pValue.replace("&Ccedil;", "Ç");
	pValue = pValue.replace("&Egrave;", "È");
	pValue = pValue.replace("&Eacute;", "É");
	pValue = pValue.replace("&Ecirc;", "Ê");
	pValue = pValue.replace("&Euml;", "Ë");
	pValue = pValue.replace("&Igrave;", "Ì");
	pValue = pValue.replace("&Iacute;", "Í");
	pValue = pValue.replace("&Icirc;", "Î");
	pValue = pValue.replace("&Iuml;", "Ï");
	pValue = pValue.replace("&ETH;", "Ð");
	pValue = pValue.replace("&Ntilde;", "Ñ");
	pValue = pValue.replace("&Otilde;", "Õ");
	pValue = pValue.replace("&Ouml;", "Ö");
	pValue = pValue.replace("&Ouml;", "Ø");
	pValue = pValue.replace("&Oslash;", "Ø");
	pValue = pValue.replace("&copy;", "©");
	pValue = pValue.replace("&reg;", "®");
	pValue = pValue.replace("&nbsp;", " ");
	return pValue;
}

function ConvertTextToAscii(pValuea)
{
	var pValue;
	pValue = String(pValuea);
	pValue = pValue.replace(" ", "&#32;");
	pValue = pValue.replace("!", "&#33;");
	pValue = pValue.replace("\"", "&#34;");
	pValue = pValue.replace("#", "&#35;");
	pValue = pValue.replace("$", "&#36;");
	pValue = pValue.replace("%", "&#37;");
	pValue = pValue.replace("&", "&#38;");
	pValue = pValue.replace("'", "&#39;");
	pValue = pValue.replace("(", "&#40;");
	pValue = pValue.replace(")", "&#41;");
	pValue = pValue.replace("*", "&#42;");
	pValue = pValue.replace("+", "&#43;");
	pValue = pValue.replace(",", "&#44;");
	pValue = pValue.replace("-", "&#45;");
	pValue = pValue.replace(".", "&#46;");
	pValue = pValue.replace("/", "&#47;");
	pValue = pValue.replace(":", "&#58;");
	pValue = pValue.replace(";", "&#59;");
	pValue = pValue.replace("<", "&#60;");
	pValue = pValue.replace("=", "&#61;");
	pValue = pValue.replace(">", "&#62;");
	pValue = pValue.replace("?", "&#63;");
	pValue = pValue.replace("@", "&#64;");
	pValue = pValue.replace("[", "&#91;");
	pValue = pValue.replace("\\", "&#92;");
	pValue = pValue.replace("]", "&#93;");
	pValue = pValue.replace("^", "&#94;");
	pValue = pValue.replace("_", "&#95;");
	pValue = pValue.replace("`", "&#96;");
	pValue = pValue.replace("{", "&#123;");
	pValue = pValue.replace("|", "&#124;");
	pValue = pValue.replace("}", "&#125;");
	pValue = pValue.replace("~", "&#126;");
	pValue = pValue.replace("€", "&#128;");
	pValue = pValue.replace("‚", "&#130;");
	pValue = pValue.replace("ƒ", "&#131;");
	pValue = pValue.replace("„", "&#132;");
	pValue = pValue.replace("…", "&#133;");
	pValue = pValue.replace("†", "&#134;");
	pValue = pValue.replace("‡", "&#135;");
	pValue = pValue.replace("ˆ", "&#136;");
	pValue = pValue.replace("Š", "&#138;");
	pValue = pValue.replace("‹", "&#139;");
	pValue = pValue.replace("Œ", "&#140;");
	pValue = pValue.replace("Ž", "&#142;");
	pValue = pValue.replace("‘", "&#145;");
	pValue = pValue.replace("’", "&#146;");
	pValue = pValue.replace("“", "&#147;");
	pValue = pValue.replace("”", "&#148;");
	pValue = pValue.replace("•", "&#149;");
	pValue = pValue.replace("–", "&#150;");
	pValue = pValue.replace("—", "&#151;");
	pValue = pValue.replace("˜", "&#152;");
	pValue = pValue.replace("™", "&#153;");
	pValue = pValue.replace("š", "&#154;");
	pValue = pValue.replace("›", "&#155;");
	pValue = pValue.replace("œ", "&#156;");
	pValue = pValue.replace("ž", "&#158;");
	pValue = pValue.replace("Ÿ", "&#159;");
	pValue = pValue.replace("¡", "&#161;");
	pValue = pValue.replace("¢", "&#162;");
	pValue = pValue.replace("£", "&#163;");
	pValue = pValue.replace("¤", "&#164;");
	pValue = pValue.replace("¥", "&#165;");
	pValue = pValue.replace("¦", "&#166;");
	pValue = pValue.replace("§", "&#167;");
	pValue = pValue.replace("¨", "&#168;");
	pValue = pValue.replace("©", "&#169;");
	pValue = pValue.replace("ª", "&#170;");
	pValue = pValue.replace("«", "&#171;");
	pValue = pValue.replace("¬", "&#172;");
	pValue = pValue.replace("&shy;", "&#173;");
	pValue = pValue.replace("®", "&#174;");
	pValue = pValue.replace("¯", "&#175;");
	pValue = pValue.replace("°", "&#176;");
	pValue = pValue.replace("±", "&#177;");
	pValue = pValue.replace("²", "&#178;");
	pValue = pValue.replace("³", "&#179;");
	pValue = pValue.replace("´", "&#180;");
	pValue = pValue.replace("µ", "&#181;");
	pValue = pValue.replace("¶", "&#182;");
	pValue = pValue.replace("·", "&#183;");
	pValue = pValue.replace("¸", "&#184;");
	pValue = pValue.replace("¹", "&#185;");
	pValue = pValue.replace("º", "&#186;");
	pValue = pValue.replace("»", "&#187;");
	pValue = pValue.replace("¼", "&#188;");
	pValue = pValue.replace("½", "&#189;");
	pValue = pValue.replace("¾", "&#190;");
	pValue = pValue.replace("¿", "&#191;");
	pValue = pValue.replace("À", "&#192;");
	pValue = pValue.replace("Á", "&#193;");
	pValue = pValue.replace("Â", "&#194;");
	pValue = pValue.replace("Ã", "&#195;");
	pValue = pValue.replace("Ä", "&#196;");
	pValue = pValue.replace("Å", "&#197;");
	pValue = pValue.replace("Æ", "&#198;");
	pValue = pValue.replace("Ç", "&#199;");
	pValue = pValue.replace("È", "&#200;");
	pValue = pValue.replace("É", "&#201;");
	pValue = pValue.replace("Ê", "&#202;");
	pValue = pValue.replace("Ë", "&#203;");
	pValue = pValue.replace("Ì", "&#204;");
	pValue = pValue.replace("Í", "&#205;");
	pValue = pValue.replace("Î", "&#206;");
	pValue = pValue.replace("Ï", "&#207;");
	pValue = pValue.replace("Ð", "&#208;");
	pValue = pValue.replace("Ñ", "&#209;");
	pValue = pValue.replace("Ò", "&#210;");
	pValue = pValue.replace("Ó", "&#211;");
	pValue = pValue.replace("Ô", "&#212;");
	pValue = pValue.replace("Õ", "&#213;");
	pValue = pValue.replace("Ö", "&#214;");
	pValue = pValue.replace("×", "&#215;");
	pValue = pValue.replace("Ø", "&#216;");
	pValue = pValue.replace("Ù", "&#217;");
	pValue = pValue.replace("Ú", "&#218;");
	pValue = pValue.replace("Û", "&#219;");
	pValue = pValue.replace("Ü", "&#220;");
	pValue = pValue.replace("Ý", "&#221;");
	pValue = pValue.replace("Þ", "&#222;");
	pValue = pValue.replace("ß", "&#223;");
	pValue = pValue.replace("à", "&#224;");
	pValue = pValue.replace("á", "&#225;");
	pValue = pValue.replace("â", "&#226;");
	pValue = pValue.replace("ã", "&#227;");
	pValue = pValue.replace("ä", "&#228;");
	pValue = pValue.replace("å", "&#229;");
	pValue = pValue.replace("æ", "&#230;");
	pValue = pValue.replace("ç", "&#231;");
	pValue = pValue.replace("è", "&#232;");
	pValue = pValue.replace("é", "&#233;");
	pValue = pValue.replace("ê", "&#234;");
	pValue = pValue.replace("ë", "&#235;");
	pValue = pValue.replace("ì", "&#236;");
	pValue = pValue.replace("í", "&#237;");
	pValue = pValue.replace("î", "&#238;");
	pValue = pValue.replace("ï", "&#239;");
	pValue = pValue.replace("ð", "&#240;");
	pValue = pValue.replace("ñ", "&#241;");
	pValue = pValue.replace("ò", "&#242;");
	pValue = pValue.replace("ó", "&#243;");
	pValue = pValue.replace("ô", "&#244;");
	pValue = pValue.replace("õ", "&#245;");
	pValue = pValue.replace("ö", "&#246;");
	pValue = pValue.replace("÷", "&#247;");
	pValue = pValue.replace("ø", "&#248;");
	pValue = pValue.replace("ù", "&#249;");
	pValue = pValue.replace("ú", "&#250;");
	pValue = pValue.replace("û", "&#251;");
	pValue = pValue.replace("ü", "&#252;");
	pValue = pValue.replace("ý", "&#253;");
	pValue = pValue.replace("þ", "&#254;");
	pValue = pValue.replace("ÿ", "&#255;");
	pValue = pValue.replace("&", "&amp;");
	pValue = pValue.replace("\"", "&quot;");
	pValue = pValue.replace("<", "<");
	pValue = pValue.replace(">", ">");
	pValue = pValue.replace("À", "&Agrave;");
	pValue = pValue.replace("Á", "&Aacute;");
	pValue = pValue.replace("Â", "&Acirc;");
	pValue = pValue.replace("Ã", "&Atilde;");
	pValue = pValue.replace("Ä", "&Auml;");
	pValue = pValue.replace("Å", "&Aring;");
	pValue = pValue.replace("Æ", "&AElig;");
	pValue = pValue.replace("Ç", "&Ccedil;");
	pValue = pValue.replace("È", "&Egrave;");
	pValue = pValue.replace("É", "&Eacute;");
	pValue = pValue.replace("Ê", "&Ecirc;");
	pValue = pValue.replace("Ë", "&Euml;");
	pValue = pValue.replace("Ì", "&Igrave;");
	pValue = pValue.replace("Í", "&Iacute;");
	pValue = pValue.replace("Î", "&Icirc;");
	pValue = pValue.replace("Ï", "&Iuml;");
	pValue = pValue.replace("Ð", "&ETH;");
	pValue = pValue.replace("Ñ", "&Ntilde;");
	pValue = pValue.replace("Õ", "&Otilde;");
	pValue = pValue.replace("Ö", "&Ouml;");
	pValue = pValue.replace("Ø", "&Ouml;");
	pValue = pValue.replace("Ø", "&Oslash;");
	pValue = pValue.replace("©", "&copy;");
	pValue = pValue.replace("®", "&reg;");
	pValue = pValue.replace(" ", "&nbsp;");
	return pValue;
}

function xtc(){
	for (var RR = 0; RR < document.forms[$(idFormSubmit).form.name].length; RR++) {
		if(document.forms[$(idFormSubmit).form.name].elements[RR].id!=idFormSubmit){
			YAHOO.util.Event.addListener(document.forms[$(idFormSubmit).form.name].elements[RR],"click",changeMod);
			YAHOO.util.Event.addListener(document.forms[$(idFormSubmit).form.name].elements[RR],"keyup",changeMod);
			YAHOO.util.Event.addListener(document.forms[$(idFormSubmit).form.name].elements[RR],"keypress",changeMod);
		}
	}
}
var isModified = false;
var tempTipUrlProsegui = "#";

function changeMod()
{
	isModified = true;
}

function flussoclick(o)
{
	if(isModified){
	enableDisablePage("disable");
		$("divTipFlussoBox").style.top=getY(o)+"px";
		$("divTipFlussoBox").style.left=getX(o)+"px";
		$("divTipFlussoBox").style.zIndex="999";
		$("divTipFlussoBox").style.width="350px";
		$("divTipFlussoBox").style.display="block";
		tempTipUrlProsegui=o.href;
	}
	else{
		location.replace(o.href);
	}
	return false;
}

function tornaPageDaTip()
{
	backToNormalPage();
	$("divTipFlussoBox").style.display="none";
	return false;
}

function proseguiDaTip()
{
	location.replace(tempTipUrlProsegui);
	return false;
}

function onOffAnagValidazione()
{
		allFormElementToValidate[assocFormElement["anag_nome"]].isInError = -1;
		allFormElementToValidate[assocFormElement["anag_cognome"]].isInError = -1;
		allFormElementToValidate[assocFormElement["anag_email"]].isInError = -1;	
}

function emetteOnClose()
{
	var callback =
	{
	    success:function(originalRequest)
		{
			//originalRequest.responseText
			return true;
		},
		failure:function(o)
		{	
			return true;
		}
	};
	YAHOO.util.Connect.asyncRequest("POST", sHttpRoot+"/_include/_ajaxRequest/inc_j_emetteOnClose.asp", callback);
	return true;
}



	function changeTab(id){
		document.getElementById("tab1").style.display="none";
		document.getElementById("tab2").style.display="none";
		document.getElementById("tab3").style.display="none";
		document.getElementById(id).style.display="block";
		$("err_login").innerHTML="";
		$("err_recupero").innerHTML="";
		$("err_recupera").innerHTML="";
		if (id=="tab1") //LOGIN
			azioneBtnEntra = 1;
		if (id=="tab2") //RECUPERA POLIZZA
			azioneBtnEntra = 2;
		if (id=="tab3") //RECUPERA PASSWORD
			azioneBtnEntra = 3;
	}
	
	function eseguiBtnEntra(target)
	{
		var callback =
		{
		    success:function(originalRequest)
			{
				if (azioneBtnEntra == 1){
					if(originalRequest.responseText=="1"){
						$("err_login").innerHTML="Login effettuata! Attendere..";
						setTimeout("location.replace(sHttpRoot+'/AreaRiservata/');",1200);
					}
					else
						$("err_login").innerHTML="Username o password errati";
				}
				else{
					if (azioneBtnEntra == 2){
						if(originalRequest.responseText=="1"){
								$("err_recupero").innerHTML="Dati corretti. Attendere...";
								setTimeout("location.replace(sHttpRoot+'/AreaRiservata/associaPreventivo.asp');",1200);
							}
							else
								if (originalRequest.responseText=="8"){//PREVENTIVO PERFEZIONATO
									$("err_recupero").innerHTML="La tua pratica e' in gestione presso i nostri uffici.";
								}
								else
								{
									if (originalRequest.responseText=="9"){//PREVENTIVO PERFEZIONATO
										$("err_recupero").innerHTML="La tua pratica non e' recuperabile dal sito internet.";
									}
									else
									{
										$("err_recupero").innerHTML="Verifica la correttezza dei dati inseriti. <br/>Ricorda di utilizzare l'apice per le lettere accentate ( “&agrave;” diventa “a'” ) e di evitare caratteri particolari come “/”, “&” oppure “,”.";
									}
								}
							
					}	
					else{
						if (azioneBtnEntra == 3){
							if(originalRequest.responseText=="1"){
								$("err_recupera").innerHTML="La password &egrave; stata spedita al tuo indirizzo email";
							}
							else
								$("err_recupera").innerHTML="Username non valida";
						}
					}
				}
							
		
				//location.href=sHttpRoot + "/AreaRiservata/dettagliPreventivo.asp";
			},
			failure:function(o)
			{	
				location.href = sHttpRoot + errPage + "?err=" + o.statusText;
			}
		};
		
		YAHOO.util.Connect.setForm($("boxmultiuso"));
		
		var sUrlAjaxToSendRequestFromPublicHomePageBasedOnUserChoose;
		if (azioneBtnEntra == 1){
			$("err_login").innerHTML="Validazione in corso...";
			sUrlAjaxToSendRequestFromPublicHomePageBasedOnUserChoose = "/_include/_ajaxRequest/_areaRiservata/inc_j_doLogin.asp"
		}	
		else{
			if (azioneBtnEntra == 2){
				$("err_recupero").innerHTML="Validazione in corso...";
				sUrlAjaxToSendRequestFromPublicHomePageBasedOnUserChoose = "/_include/_ajaxRequest/_areaRiservata/inc_j_doAssociaPolizza.asp"
			}
			else{
				if (azioneBtnEntra == 3){
					$("err_recupera").innerHTML="Controllo in corso...";
					sUrlAjaxToSendRequestFromPublicHomePageBasedOnUserChoose = "/_include/_ajaxRequest/_areaRiservata/inc_j_recuperaPassword.asp"
				}
			}		
		}		
		YAHOO.util.Connect.asyncRequest("GET", sHttpRoot + sUrlAjaxToSendRequestFromPublicHomePageBasedOnUserChoose, callback);
		return false;
	}


	function objQueryString(qs){ 
		dic = new Array();
		if(!qs)	qs = location.search;
		qs = qs.replace(/\?/,'');
		aQs = qs.split('&');
		txt = '';
		for(i=0;i<aQs.length;i++){
			aPV = aQs[i].split('=');
			dic[aPV[0]]=aPV[1];
		}
		return dic;
	}

function onOffPromo10(iCodConvenzione)
{
	if(iCodConvenzione==101){
		var newImg=document.createElement("img");
		var existingDiv=document.getElementById("brand_logo");
		newImg.setAttribute("id", "promo15");
		newImg.setAttribute("src", sHttpRoot+'/images/promo10.gif');
		newImg.setAttribute("style", "height:55px; margin:5px;");
		newImg.setAttribute("alt", "Promozione -10 percento");
		//document.getElementById("header_left").insertAfter(newImg, existingDiv.nextSibling);
		existingDiv.appendChild(newImg);
		}
}

function to2ifPerfezionato(sStatoPolizza){
	if(sStatoPolizza=="R"){
		//per risolvere il problema del cambio di residenza in un prev in stato R
		$("comune_residenza").className="prova";
		$("comune_residenza").style.backgroundColor="transparent";
		$("comune_residenza").disabled=true;
		$("comune_residenza").setAttribute("onBlur", 'return false;');
		allFormElementToValidate[assocFormElement["comune_residenza"]].isInError = 1;
	}
}

function disableTargaMadre(){
	//$("targa_bersani").className="text";
	//$("targa_bersani").style.backgroundColor="white";
	//$("targa_bersani").style.color="red";
	$("targa_bersani").disabled=true;
	$("targa_bersani").setAttribute("onBlur", 'return false;');
	allFormElementToValidate[assocFormElement["targa_bersani"]].isInError = 1;
	//$("tipoattestato_bersani").className="prova";
	//$("tipoattestato_bersani").style.backgroundColor="transparent";
	$("tipoattestato_bersani").disabled=true;
	$("tipoattestato_bersani").setAttribute("onBlur", 'return false;');
	allFormElementToValidate[assocFormElement["tipoattestato_bersani"]].isInError = 1;
}

function onOffBrand(iCodFigura0)
{
	if(iCodFigura0==0){return;}
	var ext="";
	
	switch (true){
	  case ((iCodFigura0>4000) && (iCodFigura0<=4100)): {
		name="coop"; 
		ext="png";
		break}
	  case (iCodFigura0==3002): {
		name="toys"; 
		ext="jpg";
		break }
	  case (iCodFigura0==3005): {
		name="altroconsumo"; 
		ext="jpg";
		break }
	  case (iCodFigura0==6449): {
		name="iwbank"; 
		ext="gif";
		break }
	  default: {return;}
	}
	
	var newImg=document.createElement("img");
	newImg.setAttribute("id", "brand_"+name);
	newImg.setAttribute("src", sHttpRoot+"/images/brands/Logo"+name+"."+ext);
	newImg.setAttribute("style", "height:55px; margin:0px 5px;");
	newImg.setAttribute("alt", name);
	newImg.setAttribute("height", "55");
	var existingDiv=document.getElementById("brand_logo");
	existingDiv.appendChild(newImg);
}

