$=getE=function(a){return document.getElementById(a)};function chr(a){return String.fromCharCode(a)}function ord(a){return a.charCodeAt(0)}function addEvent(a,c,f,e){e=e||!1;if(window.addEventListener)return a.addEventListener(c,f,e),!0;else if(window.attachEvent)return a["e"+c+f]=f,a.attachEvent("on"+c,function(){a["e"+c+f](window.event)}),!0;return!1}addListener=addEvent;
function removeEvent(a,c,f){if(a.removeEventListener)return a.removeEventListener(c,f,!1),!0;else if(window.detachEvent)return a.detachEvent("on"+c,a["e"+c+f]),a["e"+c+f]=null,!0;return!1}String.prototype.regQuote=function(){return this.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1")};String.prototype.trim=function(a){a==null&&(a=" ");return this.replace(RegExp("^["+a+"]+|["+a+"]+$","g"),"")};
function setAlpha(a,c){nav==1?a.filters.alpha?a.filters.alpha.opacity=c:a.style.filter+=" alpha(opacity="+c+")":a.style.opacity=c/100}function checkKey(a,c){var f=a?a:event;return f.ctrlKey||f.which===0||f.which==8||f.keyCode==13||RegExp("^["+c+"]$").test(chr(f.which?f.which:f.keyCode))}function getAbsX(a){for(var c=0;a!=null;)c+=a.offsetLeft,a=a.offsetParent;return c}function getAbsY(a){for(var c=0;a!=null;)c+=a.offsetTop,a=a.offsetParent;return c}
function mouseX(a){return a.pageX?a.pageX:a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)}function mouseY(a){return a.pageY?a.pageY:a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}function setSelRange(a,c,f){a.setSelectionRange?a.setSelectionRange(c,f):(a=a.createTextRange(),a.collapse(!0),a.moveStart("character",c),a.moveEnd("character",f-c),a.select())}
function getSelStart(a){return a.setSelectionRange?a.selectionStart:(a=document.selection.createRange(),a.compareEndPoints("StartToEnd",a)!=0&&a.collapse(!0),a.getBookmark().charCodeAt(2)-2)}function getSelEnd(a){return a.setSelectionRange?a.selectionEnd:(a=document.selection.createRange(),a.compareEndPoints("StartToEnd",a)!=0&&a.collapse(!1),a.getBookmark().charCodeAt(2)-2)}
function adddate(a,c,f,e){var g=[0,31,28,31,30,31,30,31,31,30,31,30,31];c==null&&(c=0);f==null&&(f=0);e==null&&(e=0);var d=Number(a[0]),b=Number(a[1]),a=Number(a[2]);d+=e;b+=f;d+=Math.floor((b-1)/12);b=(b-1)%12+1;b<=0&&(b=12+b);g[2]=d%4==0&&d%100!=0||d%400==0?29:28;if(c==0)a=Math.min(a,g[b]);else for(a+=c;a>g[b]||a<=0;)a<=0?(b--,d+=Math.floor((b-1)/12),b=(b-1)%12+1,b<=0&&(b=12+b),g[2]=d%4==0&&d%100!=0||d%400==0?29:28,a+=g[b]):(a-=g[b],b++,d+=Math.floor((b-1)/12),b=(b-1)%12+1),g[2]=d%4==0&&d%100!=
0||d%400==0?29:28;return[d,b,a]}
function SSToolTip(a,c,f,e,g,d,b){if(typeof SSTT=="undefined")SSTT=document.createElement("div"),document.body.appendChild(SSTT),SSTT.id="SSToolTip",SSTT.style.display="none",SSTT.style.position="absolute",SSTT.style.zIndex=10100,SSTT.style.left=0,SSTT.style.top=0,SSTT.padding=d==null?"4px":d,SSTT.moved=0,SSTT.onmouseout=function(){this.style.display="none"},SSTT.intID=setInterval(function(){SSTT.style.display==""&&!SSTT.moved&&SSTT.update(SSTT.last_e);SSTT.moved=0},500),SSTT.update=function(a){if(a)SSTT.last_e=
a;if(SSTT.move&&(a=a?a:window.event)){SSTT.moved=1;var i=mouseX(a)+15,a=mouseY(a)+15,h=i+15,c=a+15;h+SSTT.clientWidth>document.body.scrollLeft+document.body.clientWidth&&(h=i-SSTT.clientWidth-20,h<document.body.scrollLeft&&(h=document.body.scrollLeft+document.body.clientWidth-SSTT.clientWidth));if(c+SSTT.clientHeight>document.body.scrollTop+document.body.clientHeight&&(c=a-SSTT.clientHeight-20,c<document.body.scrollTop))c=document.body.scrollTop;SSTT.style.left=h;SSTT.style.top=c;if(SSTT.stopafterfirst)SSTT.move=
0}},addEvent(document,"mousemove",SSTT.update),SSTT.hide=function(){this.style.display="none";SSTT.move=0};if(a==null)SSTT.hide();else{c=decodeURIComponent(c);e=e==null?"":e;setAlpha(SSTT,b==null?f==null?100:90:b);SSTT.style.cursor=(SSTT.onclick=a.onclick)?"pointer":"default";SSTT.onmouseover=a.onclick?function(){this.style.display=""}:null;f==null?SSTT.innerHTML='<\!--[if lte IE 6]><iframe id="SSTT_iframe" style="position:absolute;z-index:-100;filter:alpha(opacity=0);"></iframe><![endif]--\><table style="border:solid 1px #36c;background:#fff;filter:progid:DXImageTransform.Microsoft.Shadow(color=#333333,direction=135,strength=2,enabled=true);width:'+
e+';" cellPadding="1" cellSpacing="0"><tr><td style="padding:'+SSTT.padding+';">'+c+"</td></tr></table>":(f=decodeURIComponent(f),SSTT.innerHTML='<\!--[if lte IE 6]><iframe id="SSTT_iframe" style="position:absolute;z-index:-100;filter:alpha(opacity=0);"></iframe><![endif]--\><table style="border:solid 1px #36c;background:#fff;filter:progid:DXImageTransform.Microsoft.Shadow(color=#333333,direction=135,strength=2,enabled=true);width:'+e+';" cellpadding="1" cellspacing="0">'+(c!=""?'<tr><td style="background:#4B5F6D;color:#fff;padding:'+
SSTT.padding+';"><b>'+c+"</b></td></tr>":"")+'<tr valign=top><td style="padding:'+SSTT.padding+';">'+f+"</td></tr></table>");SSTT.style.display="";c=document.getElementById("SSTT_iframe");if(c!=null)c.style.width=SSTT.offsetWidth,c.style.height=SSTT.offsetHeight;if(a.onmouseout==null)a.onmouseout=function(){SSTT.hide()};SSTT.move=1;SSTT.stopafterfirst=g;SSTT.update()}}
function xmlRemoveWhiteSpace(a){if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++)a.childNodes[c].nodeType==1?xmlRemoveWhiteSpace(a.childNodes[c]):(a.childNodes[c].nodeType==7||a.childNodes[c].nodeType==3&&a.childNodes[c].nodeValue.replace(/\s\t\r\n/g,"")=="")&&a.removeChild(a.childNodes[c]);return a}var xmlhttp=!1;if(!xmlhttp&&typeof XMLHttpRequest!="undefined")try{xmlhttp=new XMLHttpRequest}catch(e$$7){xmlhttp=!1}
if(!xmlhttp&&window.createRequest)try{xmlhttp=window.createRequest()}catch(e$$8){xmlhttp=!1}
sendAndLoad=function(a,c,f,e){var g=!1;if(!g&&typeof XMLHttpRequest!="undefined")try{g=new XMLHttpRequest}catch(d){g=!1}if(!g&&window.createRequest)try{g=window.createRequest()}catch(b){g=!1}if(g){f==null&&(f="GET");try{g.open(f,a,!0);if(c)g.onreadystatechange=function(){if(g.readyState==4)if(g.status==200){var a=f=="HEAD"?e==null?g.getAllResponseHeaders():g.getResponseHeader(e):e?e==2?eval("("+g.responseText+")"):xmlRemoveWhiteSpace(g.responseXML):g.responseText;c(a)}else c(!1)};g.setRequestHeader("X-Requested-With",
"XMLHttpRequest");g.send(null)}catch(j){}}};
function SSColorPicker(a,c,f,e){if(typeof SSCP=="undefined"){SSCP_intID=SSCP_in=0;SSCP_alpha=100;SSCP=document.createElement("div");document.body.appendChild(SSCP);SSCP.id="SSColorPicker";SSCP.style.visibility="hidden";SSCP.style.position="absolute";SSCP.style.zIndex=10001;SSCP.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=#333333,direction=135,strength=2,enabled=true);";SSCP.style.left=0;SSCP.style.top=0;for(var e='<\!--[if lte IE 6]><iframe id="SSCP_iframe" style="position:absolute;z-index:-100;filter:alpha(opacity=0);"></iframe><![endif]--\><table cellpadding=0 cellspacing=0 border=1 bordercolor=1 style="border:solid 1px #000000;border-collapse:collapse;background:#000;filter:alpha(opacity=100);" onmouseover="SSCP_in=1" onmouseout="SSCP_in=0"><tr><td colspan=18>'+(e?
'<input type=button onclick="SSCP.setColor(null)" onmouseover="SSCP.previewColor(null)" style="float:right;background:white;color:red;font-weight:bold;padding:0 3 1 3px;margin:1 1 0 0px;font-family:Verdana;font-stylea:italic" value="/">':"")+'<div id="SSCP_preview" style="cursor:pointer;width:50px;height:19px;background-color:#fff;float:left;" onclick="SSCP.setColor(document.getElementById(\'SSCP_value\').value)"></div><span style="color:#fff;margin-left:10px">#</span><input id=SSCP_value maxlength=6 value="ffffff" style="width:60px;height:19px;margin-left:1px;" onblur="this.value=this.value.replace(/[^0-9a-fA-F]/g,\'\');" onkeypress="if(document.all ? (window.event.keyCode==13) : (arguments[0].which==13)){SSCP.setColor(this.value)};return checkKey(event,\'0-9a-fA-F\')" onkeyup="SSCP.previewColor(this.value,1)"></td></tr>',
g=0;g<12;g++){e+="<tr>";for(var d=0;d<18;d++){for(var b=(3342336*Math.floor(d/6)+13056*(d%6)+51*(g%6)+(g>=6?10027008:0)).toString(16).toUpperCase();b.length<6;)b="0"+b;e+='<td style="border:solid 1px #000000;padding-left:13px;height:13px;background-color:#'+b+'" onmouseover="SSCP.previewColor(\''+b+"');\" onclick=\"SSCP.setColor('"+b+"')\"></td>"}e+="</tr>"}e+="<tr>";d=[16711680,65280,255,16776960,16711935,65535,3355443,4473924,5592405,6710886,7829367,8947848,10066329,11184810,12303291,13421772,14540253,
15658734];for(g=0;g<d.length;g++){for(b=d[g].toString(16).toUpperCase();b.length<6;)b="0"+b;e+='<td style="border:solid 1px #000000;padding-left:13px;height:13px;background-color:#'+b+'" onmouseover="SSCP.previewColor(\''+b+"');\" onclick=\"SSCP.setColor('"+b+"')\"></td>"}e+="</tr>";e+="</table>";setTimeout(function(){var a=document.getElementById("SSCP_iframe");if(a!=null)a.style.width=SSCP.offsetWidth,a.style.height=SSCP.offsetHeight;SSCP.style.visibility="visible";SSCP.style.display="none"},1);
SSCP.innerHTML=e;SSCP.hide=function(){clearInterval(SSCP_intID);SSCP_intID=setInterval(function(){SSCP_alpha-=20;setAlpha(SSCP,SSCP_alpha);if(SSCP_alpha<=0)SSCP.style.display="none",clearInterval(SSCP_intID)},50)};SSCP.previewColor=function(a,i){if(a==null){if(document.getElementById("SSCP_preview").style.backgroundColor="#000000",!i)document.getElementById("SSCP_value").value=""}else{for(a=a.replace(/#/g,"");a.length<6;)a="0"+a;document.getElementById("SSCP_preview").style.backgroundColor="#"+a;
if(!i)document.getElementById("SSCP_value").value=a}};SSCP.setColor=function(a){if(a==null)SSCP.callback(null);else{for(a=a.replace(/#/g,"");a.length<6;)a="0"+a;SSCP.callback(a.toUpperCase())}this.hide()};addEvent(document,"mouseup",function(){SSCP_in||SSCP.hide()});addEvent(window,"resize",function(){SSCP.style.display==""&&SSCP.hide()})}setTimeout(function(){SSCP_alpha=0;setAlpha(SSCP,SSCP_alpha);SSCP.style.display="";SSCP.callback=f;var b=getAbsX(a)+a.clientWidth,i=getAbsY(a),h=SSCP.clientWidth+
2;b+h>document.body.clientWidth&&(b=document.body.clientWidth-h);h=document.documentElement?document.documentElement.scrollTop:document.body.scrollTop;i+SSCP.clientHeight>h+document.body.clientHeight&&(i=h+document.body.clientHeight-SSCP.clientHeight,i<h&&(i=h));SSCP.style.left=b+"px";SSCP.style.top=i+"px";SSCP.previewColor(c);clearInterval(SSCP_intID);SSCP_intID=setInterval(function(){SSCP_alpha+=20;setAlpha(SSCP,SSCP_alpha);SSCP_alpha>=100&&clearInterval(SSCP_intID)},50)},10)}
function SSDatePicker(a,c,f,e,g,d){if(typeof SSD=="undefined"){SSD_intID=SSD_in=0;SSD_alpha=100;SSD=document.createElement("div");document.body.appendChild(SSD);SSD.language=d==null?"en":d;SSD.language=="ro"?(SSD.months=",ianuarie,februarie,martie,aprilie,mai,iunie,iulie,august,septembrie,octombrie,noiembrie,decembrie".split(","),SSD.days=",L,M,M,J,V,S,D".split(",")):(SSD.months=",january,february,march,april,may,june,july,august,september,october,november,december".split(","),SSD.days="S,M,T,W,T,F,S".split(","));
SSD.id="SSDatePicker";SSD.style.visibility="hidden";SSD.style.position="absolute";SSD.style.zIndex=10002;SSD.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=#333333,direction=135,strength=2,enabled=true);";SSD.style.width=200;SSD.style.left=0;SSD.style.top=0;for(var d='<\!--[if lte IE 6]><iframe id="SSD_iframe" style="position:absolute;z-index:-100;filter:alpha(opacity=0);"></iframe><![endif]--\><table width="100%" cellpadding=0 cellspacing=0 border=1 bordercolor=1 style="color:#000;border:solid 1px #000;border-collapse:collapse;background:#fffee9;filter:alpha(opacity=100);cursor:default;" onmouseover="SSD_in=1" onmouseout="SSD_in=0" onmousewheel="SSD.onWheel(event)"><tr><td><input id=SSD_prev type=button value="&laquo;" style=width:30px onclick="clearTimeout(this.timeoutID);clearInterval(this.intervalID);SSD.prevMonth()" onmouseout="clearTimeout(this.timeoutID);clearInterval(this.intervalID)" onmousedown="var me=this;me.timeoutID=setTimeout(function(){me.intervalID=setInterval(function(){SSD.prevMonth()},10)},500)"></td><td id=SSD_location align="center" width=100%></td><td><input id=SSD_next type=button value="&raquo;" style=width:30px onclick="clearTimeout(this.timeoutID);clearInterval(this.intervalID);SSD.nextMonth()" onmouseout="clearTimeout(this.timeoutID);clearInterval(this.intervalID)" onmousedown="var me=this;me.timeoutID=setTimeout(function(){me.intervalID=setInterval(function(){SSD.nextMonth()},10)},500)"></td></tr><tr><td colspan=3><table id=SSD_days border=1 bordercolor=#cccccc style="border:solid 1px #ccc;border-collapse:collapse;background:#fff;" width=100%><tr style="background:#000;color:#fff">',
b=0;b<7;b++)d+="<td align=center width=14%>"+SSD.days[SSD.language=="ro"?b+1:b]+"</td>";d+="</tr>";for(b=0;b<6;b++){d+="<tr>";for(var j=0;j<7;j++)d+='<td align=right onmouseover="SSD.rollOver(this)" onmouseout="SSD.rollOut(this)" onclick="SSD.click(this)" style="padding-right:2px;border:solid 1px #ccc"></td>';d+="</tr>"}d+='</table></td></tr><tr><td colspan=3 style="padding:2px;text-align:center;font-size:9px">'+(SSD.language=="ro"?"Folose\u015fte roti\u0163a mouse-ului sau \u0163ine ap\u0103sat s\u0103ge\u0163ile pentru a schimba rapid luna":
"Use mouse wheel or arrows to change month")+"</td></tr></table>";SSD.updateIframe=function(){var a=document.getElementById("SSD_iframe");if(a!=null)a.style.width=SSD.offsetWidth,a.style.height=SSD.offsetHeight};setTimeout(function(){SSD.updateIframe();SSD.style.visibility="visible";SSD.style.display="none"},1);SSD.innerHTML=d;SSD.hide=function(){this.style.display="none"};SSD.nextMonth=function(){this.browseTo(adddate([this.year,this.month,1],0,1))};SSD.prevMonth=function(){this.browseTo(adddate([this.year,
this.month,1],0,-1))};SSD.browseTo=function(a){a[0]=Number(a[0]);if(a[0]>=this.minYear&&a[0]<=this.maxYear){this.year=a[0];this.month=Number(a[1]);if(document.getElementById("SSD_prev").disabled=this.year==this.minYear&&this.month==1)try{clearTimeout(document.getElementById("SSD_prev").timeoutID),clearInterval(document.getElementById("SSD_prev").intervalID)}catch(h){}if(document.getElementById("SSD_next").disabled=this.year==this.maxYear&&this.month==12)try{clearTimeout(document.getElementById("SSD_next").timeoutID),
clearInterval(document.getElementById("SSD_next").intervalID)}catch(c){}document.getElementById("SSD_location").innerHTML=this.months[this.month]+" "+this.year;var a=document.getElementById("SSD_days"),b=new Date;b.setFullYear(this.year,this.month-1,1);var b=b.getDay(),f=[0,31,28,31,30,31,30,31,31,30,31,30,31][this.month];if(this.month==2&&this.year%4==0&&this.year%100!=0||this.year%400==0)f=29;for(var e=1;e<=6;e++){a.rows[e].style.display="";for(var g=0;g<7;g++){var d=a.rows[e].cells[g];d.innerHTML=
"";d.style.background="transparent";d.style.color="#000";d.style.borderWidth=0}}g=1;e=this.language=="ro"?b==0?6:b-1:b;for(d=e==0?0:1;g<=f;){e%7==0&&d++;a.rows[d].cells[e%7].innerHTML=g;a.rows[d].cells[e%7].color=a.rows[d].cells[e%7].style.background=b==0||b==6?"#efefef":"#fff";a.rows[d].cells[e%7].style.borderWidth=1;if(this.year==SSD.selected[0]&&this.month==SSD.selected[1]&&g==SSD.selected[2])a.rows[d].cells[e%7].color=a.rows[d].cells[e%7].style.background="#fffbb3";e++;g++;b=(b+1)%7}for(e=d+1;e<
a.rows.length;e++)a.rows[e].style.display="none";SSD.updateIframe()}};SSD.rollOver=function(a){if(a.innerHTML!="")a.style.background="#4B5F6D",a.style.color="#fff"};SSD.rollOut=function(a){if(a.innerHTML!="")a.style.background=a.color,a.style.color="#000"};SSD.click=function(a){a.innerHTML!=""&&this.setValue(a.innerHTML)};SSD.setValue=function(a){this.hide();SSD.callback([this.year,this.month,a])};addEvent(document,"mouseup",function(){SSD_in||SSD.hide()});addEvent(window,"resize",function(){SSD.style.display==
""&&SSD.hide()});SSD.onWheel=function(a){(a.detail?-a.detail:a.wheelDelta)>0?SSD.nextMonth():SSD.prevMonth();a.preventDefault&&a.preventDefault();a.returnValue=!1};SSD.addEventListener&&SSD.addEventListener("DOMMouseScroll",SSD.onWheel,!1)}setTimeout(function(){SSD_alpha=0;setAlpha(SSD,SSD_alpha);SSD.style.display="";SSD.minYear=f;SSD.maxYear=e;SSD.callback=g;SSD.selected=c;for(var b=document.getElementById("SSD_days"),h=1;h<=6;h++){b.rows[h].style.display="";for(var d=0;d<7;d++)b.rows[h].cells[d].innerHTML=
"&nbsp;"}b=getAbsX(a)+a.clientWidth;h=getAbsY(a);d=SSD.clientWidth+2;b+d>document.body.clientWidth&&(b=document.body.clientWidth-d);d=document.documentElement?document.documentElement.scrollTop:document.body.scrollTop;h+SSD.clientHeight>d+document.body.clientHeight&&(h=d+document.body.clientHeight-SSD.clientHeight,h<d&&(h=d));SSD.style.left=b+"px";SSD.style.top=h+"px";SSD.browseTo(c[0]>0&&c[1]>0?c:[f,1,1]);clearInterval(SSD_intID);SSD_alpha=100;setAlpha(SSD,SSD_alpha)},10)}
function SSAutoComplete(a,c,f,e,g,d,b,j){if(a!=null){if(typeof f=="object"&&f!=null)var i=f.minChars,e=f.x,g=f.y,d=f.callback,b=f.delay,j=f.autoSelect;else i=f;i=i==null?2:i;b=b==null?300:b;j=j==null?0:j}if(typeof SSAC=="undefined")SSAC_intID=SSAC_in=0,SSAC_alpha=100,SSAC=document.createElement("div"),document.body.appendChild(SSAC),SSAC.id="SSAutoComplete",SSAC.style.visibility="visible",SSAC.style.position="absolute",SSAC.style.zIndex=10003,SSAC.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=#333333,direction=135,strength=2,enabled=true);",
SSAC.style.left=0,SSAC.style.top=0,SSAC.updateIframe=function(){var a=document.getElementById("SSAC_iframe");if(a!=null)a.style.width=SSAC.offsetWidth,a.style.height=SSAC.offsetHeight},setTimeout(function(){SSAC.updateIframe();SSAC.style.display="none"},1),SSAC.innerHTML='<span style="display:none" id="SSAC_decoder"></span><\!--[if lte IE 6]><iframe id="SSAC_iframe" style="position:absolute;z-index:-100;filter:alpha(opacity=0);"></iframe><![endif]--\><table id="SSAC_table" cellpadding=2 cellspacing=0 border=1 bordercolor=#cccccc style="font-family:Tahoma;font-size:10px;color:#000;border:solid 1px #ccc;border-collapse:collapse;background:#fffee9;filter:alpha(opacity=100);cursor:default;" onmouseout="SSAC.setSelected(-1)"></table>',
SSAC.table=document.getElementById("SSAC_table"),SSAC.hide=function(){clearInterval(SSAC_intID);SSAC_intID=setInterval(function(){SSAC_alpha-=50;setAlpha(SSAC,SSAC_alpha);if(SSAC_alpha<=0)SSAC.style.display="none",clearInterval(SSAC_intID)},50)},SSAC.setSelected=-1,SSAC.setSelected=function(a){if(this.selected>-1)with(this.table.rows[this.selected].cells[0])style.color="#000",bgColor="#fffee9";if((this.selected=a)>-1)with(this.table.rows[this.selected].cells[0])style.color="#fff",bgColor="#4B5F6D";
if(this.cobj.autoSelect>0)try{this.cobj.callback(this.table.rows[this.selected].value,this.selected==-1?null:this.table.rows[this.selected].data)}catch(b){}},SSAC.rollOver=function(a){this.setSelected(a.nr)},SSAC.autoFill=function(a,b){if(b!=null){var c=b;a.value+=b.substr(a.value.length)}else c=this.selected>-1?this.table.rows[this.selected].value:this.value,a.value=c;setSelRange(a,c.toLowerCase().indexOf(this.value.toLowerCase())==0?this.value.length:0,c.length);a.tempValue=c.trim()},SSAC.moveUp=
function(a){this.visible&&(this.setSelected(this.selected>-1?this.selected-1:this.lines-1),setTimeout(function(){SSAC.autoFill(a)},1))},SSAC.moveDown=function(a){this.visible&&(this.setSelected(this.selected<this.lines-1?this.selected+1:-1),setTimeout(function(){SSAC.autoFill(a)},1))},this.visible=1,SSAC.setVisible=function(a){this.style.visibility=a?"visible":"hidden";this.visible=a},SSAC.select=function(a){if(this.selected==-1||!this.visible)return!0;else{a.value=this.table.rows[this.selected].value;
a.tempValue=a.value.trim();setTimeout(function(){SSAC.setSelected(-1);a.focus();setSelRange(a,0,a.value.length)},1);this.setVisible(0);try{a.callback(this.table.rows[this.selected].value,this.table.rows[this.selected].data)}catch(b){}return!1}},SSAC.curentXML="",SSAC.update=function(a,b){if(this.currentXML!=b||a.fullLoad){this.setVisible(1);var c=this.table;this.lines=b.childNodes.length;for(var d,e,g,f=0,i=document.getElementById("SSAC_decoder"),j=RegExp("^"+this.value.regQuote(),"i"),k=0;k<this.lines;k++)if(i.innerHTML=
decodeURIComponent(b.childNodes[k].firstChild.nodeValue),g=b.childNodes[k].getAttribute("value")!=null?decodeURIComponent(b.childNodes[k].getAttribute("value")):i.firstChild.nodeValue,!(a.fullLoad&&g.match(j)==null)&&(c.rows.length<=f?(d=c.insertRow(f),e=d.insertCell(-1),e.noWrap="nowrap",d.nr=f,e.style.paddingLeft=7,e.style.paddingRight=7,d.onmouseover=function(){SSAC.rollOver(this)}):d=c.rows[f],d.style.display="",d.cells[0].innerHTML=i.innerHTML,d.value=g,d.data=b.childNodes[f].getAttribute("data"),
d.onmousedown=function(){SSAC.select(a)},f++,f>=a.limit))break;this.lines=f;this.lines==0&&this.setVisible(0);for(var f=this.lines;f<c.rows.length;f++)c.rows[f].style.display="none";this.setSelected(-1);if(this.lastKeyCode!=16&&this.lastKeyCode!=36&&this.lastKeyCode!=46&&this.lastKeyCode!=8&&a.autoSelect&&this.lines>0&&c.rows[0].value.toLowerCase().indexOf(this.value.toLowerCase())==0){a.autoSelect==1?this.autoFill(a,c.rows[0].value):this.moveDown(a);try{a.callback(this.table.rows[this.selected].value,
this.table.rows[this.selected].data)}catch(l){}}this.currentXML=b;this.updateIframe()}},SSAC.loadData=function(a,c){this.value=c;var d=a.fullLoad?"xml":c;typeof a.xmls[a.url][d]=="undefined"?(clearTimeout(a.SSAC_intID),a.SSAC_intID=setTimeout(function(){sendAndLoad(a.url+(a.fullLoad?"":encodeURIComponent(d)),function(b){a.xmls[a.url][d]=b.firstChild;a.value.trim()==d&&SSAC.update(a,b.firstChild)},"POST",1)},b)):(a.xmls[a.url][d].childNodes.length>0&&this.setVisible(1),this.update(a,a.xmls[a.url][d]))};
a!=null&&setTimeout(function(){if(!a.SSAC_on)a.tempValue="",a.SSAC_on=1,a.xmls={},a.hasFocus=!0,addEvent(a,"focus",function(){this.hasFocus=!0}),addEvent(a,"blur",function(){this.hasFocus=!1;setTimeout(function(){SSAC.hide()},1)}),a.SSAC_intID=0,typeof a.onkeypress!="undefined"&&addEvent(a,"keypress",a.onkeypress),a.onkeypress=function(a){a=a?a:event;a=a.which?a.which:a.keyCode;if(a==27)return SSAC.setSelected(-1),SSAC.setVisible(0),SSAC.autoFill(this),!1;else if(a==13)return SSAC.select(this)},addEvent(a,
"keydown",function(a){a=a?a:event;a.keyed||(a=a.which?a.which:a.keyCode,a==38?SSAC.moveUp(this):a==40&&SSAC.moveDown(this))}),addEvent(a,"keyup",function(a){var b=a?a:event,a=b.which?b.which:b.keyCode;SSAC.lastKeyCode=b.keyCode;SSAC.lastWhich=b.which;b=this.value.trim();if(b.length>=Number(i)){if(b!=this.tempValue||(a==38||a==40)&&!SSAC.visible){if(this.autoSelect>0)try{this.callback(b)}catch(c){}SSAC.loadData(this,b)}}else{if(this.autoSelect>0)try{this.callback(b)}catch(d){}SSAC.setVisible(0)}}),
addEvent(a,"mousedown",function(){if(this.hasFocus){var a=this.value.trim();a.length>=Number(i)&&SSAC.loadData(this,a)}}),addEvent(a,"dblclick",function(){var a=this.value.trim();a.length>=Number(i)&&SSAC.loadData(this,a)});a.url=c;a.xmls[c]==null&&(a.xmls[c]={});a.callback=d;a.fullLoad=c.match(/=$/)==null;a.limit=a.fullLoad?10:100;a.autoSelect=j;SSAC.cobj=a;SSAC.setVisible(0);SSAC.style.display="";if(e==null||g==null)e=getAbsX(a),g=getAbsY(a)+a.clientHeight;SSAC.style.left=e;SSAC.style.top=g;SSAC.style.width=
document.getElementById("SSAC_table").style.width=a.clientWidth;clearInterval(SSAC_intID);setAlpha(SSAC,100);SSAC_alpha=100;i==0&&a.value==""&&SSAC.loadData(a,"")},10)}
function setGrid(a,c,f,e,g){a.gridOver=function(a){a.bgColor=c};a.gridOut=function(a){a.bgColor=e!=null&&a.cells[e].firstChild.checked?f:a.color};a.gridClick=function(b,c){if(b.isGridCheck)c==null&&(c=!b.cells[e].firstChild.checked),b.cells[e].firstChild.checked=c,b.bgColor=c?f:b.color,arguments.length==1&&a.sync()};a.gridSelectAll=function(b){for(var c=1;c<a.rows.length;c++)this.gridClick(a.rows[c],b);a.sync()};a.sync=function(){for(var b=1,c=0,d=1;d<this.rows.length;d++)this.rows[d].isGridCheck&&
(this.rows[d].cells[e].firstChild.checked?c++:b=0);g!=null&&g(c);a.rows[0].cells[e].firstChild.checked=b};for(var d=1;d<a.rows.length;d++){var b=a.rows[d];b.color=b.bgColor;c!=null&&(addEvent(b,"mouseover",function(){a.gridOver(this)}),addEvent(b,"mouseout",function(){a.gridOut(this)}));if(e!=null&&b.cells[e].firstChild.checked!=null)b.isGridCheck=!0,b.onclick=function(){a.gridClick(this)},b.cells[e].firstChild.onclick=function(){a.gridClick(this.parentNode.parentNode)},b.cells[e].firstChild.checked&&
a.gridClick(b,1)}if(e!=null)a.sync(),a.rows[0].cells[e].firstChild.onclick=function(){a.gridSelectAll(this.checked)}};

