function ChangeLocation(sNewLocation){window.open(sNewLocation,"_self");}
function StopBubble(Event){if(typeof(Event.cancelBubble)!="undefined")
Event.cancelBubble=true;if(typeof(Event.stopPropagation)!="undefined")
Event.stopPropagation();return false;}
sb=StopBubble;function GetElementCoordinates(Element,bCheckForAbsoluteParents){if(typeof(bCheckForAbsoluteParents)=="undefined")
bCheckForAbsoluteParents=false;var Left=Top=0;if(Element.offsetParent){do{Left+=Element.offsetLeft;Top+=Element.offsetTop;var OffsetElement=Element.offsetParent;if(bCheckForAbsoluteParents){var ParentNode=Element.parentNode;var bBreak=false;for(var i=0;i<1000;i++){if(ParentNode&&typeof(ParentNode.tagName)!="undefined"){if(ParentNode.style.position=="absolute"){bBreak=true;break;}
if(ParentNode==OffsetElement){break;}
ParentNode=ParentNode.parentNode;}else{break;}}
if(bBreak)
break;}}while(Element=OffsetElement);}
return[Left,Top];}
function GetElementSize(Element){return[Element.offsetWidth,Element.offsetHeight];}
function GetWindowSize(){if(typeof(window.innerWidth)=='number')
return[window.innerWidth,window.innerHeight];else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
return[document.documentElement.clientWidth,document.documentElement.clientHeight];else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
return[document.body.clientWidth,document.body.clientHeight];}
function GetDocumentSize(){return[document.body.scrollWidth,document.body.scrollHeight];}
function GetScrollPosition(){if(typeof(window.pageYOffset)=='number')
return[window.pageYOffset,window.pageXOffset];else if(document.body&&typeof(document.body.scrollLeft)=='number')
return[document.body.scrollTop,document.body.scrollLeft];else if(document.documentElement&&typeof(document.documentElement.scrollLeft)=='number')
return[document.documentElement.scrollTop,document.documentElement.scrollLeft];}
function AttachEvent(Element,EventName,Handler){if(Element.addEventListener){Element.addEventListener(EventName,Handler,false);}else if(Element.attachEvent){Element.attachEvent('on'+EventName,Handler);}}
function DetachEvent(Element,EventName,Handler){if(Element.removeEventListener){Element.removeEventListener(EventName,Handler,false);}else if(Element.detachEvent){Element.detachEvent('on'+EventName,Handler);}}
function GetTargetElement(Event){if(typeof(Event.srcElement)!="undefined")
return Event.srcElement;if(typeof(Event.target)!="undefined")
return Event.target;return null;}
function XmlToObject(Node){if(typeof(Node)=="undefined"||Node==null)
return null;var oObject=new Object();if(typeof(Node.childNodes)!="undefined"){var nNodesLength=Node.childNodes.length;if(nNodesLength>0){for(var i=0;i<nNodesLength;i++){var CurrentChild=Node.childNodes[i];if(typeof(CurrentChild.childNodes)!="undefined"){if(CurrentChild.childNodes.length==1&&(CurrentChild.childNodes[0].nodeType==3||CurrentChild.childNodes[0].nodeType==4)){var Result=GetNodeValue(CurrentChild);}else{var Result=XmlToObject(CurrentChild);}
if(typeof(oObject[CurrentChild.nodeName])!="undefined"){if(typeof(oObject[CurrentChild.nodeName].length)=="undefined"||typeof(oObject[CurrentChild.nodeName])=="string")
oObject[CurrentChild.nodeName]=[oObject[CurrentChild.nodeName]];oObject[CurrentChild.nodeName].push(Result);}else{oObject[CurrentChild.nodeName]=Result;}}}}else{return"";}}else{return"";}
return oObject;}
function GetNodeValue(Node){if(typeof(Node.textContent)!="undefined")
return Node.textContent;if(typeof(Node.text)!="undefined")
return Node.text;if(typeof(Node.innerHTML)!="undefined")
return Node.innerHTML;return null;}
function GetElement(sID){return document.getElementById(sID);}
$=GetElement;function GetSelectedText(Object){var SelectedText='';if(window.getSelection){SelectedText=window.getSelection();}else if(document.getSelection){SelectedText=document.getSelection();}else if(document.selection){SelectedText=document.selection.createRange().text;}
return SelectedText.toString();}
function GetParentElementByTagName(CurrentElement,ParentElementTagName){ParentElementTagName=ParentElementTagName.toLowerCase();var ParentElement=CurrentElement;while(ParentElement.parentNode&&ParentElement.parentNode.tagName.toLowerCase()!=ParentElementTagName){ParentElement=ParentElement.parentNode;}
return ParentElement.parentNode;}
function GetParentElement(CurrentElement,ParentElementID){var bExpression=(ParentElementID.substring(ParentElementID.length-1)=="_");var ParentElement=CurrentElement;while(ParentElement.tagName!="BODY"){if(ParentElement.id.length>0){if(bExpression){if(ParentElement.id.substring(0,ParentElementID.length)==ParentElementID)
return ParentElement;}else{if(ParentElement.id==ParentElementID)
return ParentElement;}}
ParentElement=ParentElement.parentNode;}
return ParentElement;}
function GetElements(ElementID,TagName){var bExpression=(ElementID.substring(ElementID.length-1)=="_");if(!bExpression){var Elements=document.all(ElementID);return Elements;}else{var Elements=null;if(TagName){Elements=document.getElementsByTagName(TagName);}else{Elements=document.all;}
var Result=[];for(var i=0;i<Elements.length;i++){if(Elements[i].id.length==0)
continue;if(Elements[i].id.substring(0,ElementID.length)==ElementID)
Result.push(Elements[i]);}
return Result;}}
function GetChildElement(CurrentElement,ChildElementID,TagName){if(TagName){var bExpression=(ChildElementID.substring(ChildElementID.length-1)=="_");var ChildElements=CurrentElement.getElementsByTagName(TagName);for(var i=0;i<ChildElements.length;i++){if(ChildElements[i].id.length>0){if(bExpression){if(ChildElements[i].id.substring(0,ChildElementID.length)==ChildElementID)
return ChildElements[i];}else{if(ChildElements[i].id==ChildElementID)
return ChildElements[i];}}}}else{}}
function SetOuterHTML(Element,sHTML){if(typeof(Element.outerHTML)!="undefined"){Element.outerHTML=sHTML;return true;}
var range=document.createRange();Element.innerHTML=sHTML;range.selectNodeContents(Element);var frag=range.extractContents();Element.parentNode.insertBefore(frag,Element);Element.parentNode.removeChild(Element);}
function RemoveElement(Element){Element.parentNode.removeChild(Element);}
function CheckArray(vArray){if(typeof(vArray)=="object"){if(typeof(vArray.length)!="undefined"&&vArray.length>0){return vArray;}else{return[vArray];}}else{return[];}}
function MergeArrays(arArray1,arArray2){for(var i in arArray2)
arArray1.push(arArray2[i]);return arArray1;}
function ReplaceText(sText,sSearch,sReplace){while(sText.match(sSearch))
sText=sText.replace(sSearch,sReplace);return sText;}
function LoadScript(sFileName){var Element=document.createElement('script');Element.type='text/javascript';Element.src=sFileName;document.body.appendChild(Element);}
function ChangeLocation(sUrl){if(sUrl.indexOf("://")==-1){var arBaseTag=document.getElementsByTagName("BASE");if(arBaseTag)
sUrl=arBaseTag[0].href+sUrl;}
window.churl=sUrl;window.setTimeout("window.open(window.churl, \"_self\");",1);}
function Focus(Element){try{if(typeof(Element)=="string")
Element=$(Element);Element.focus();}catch(e){}}
fff=Focus;function AddCssClass(sName,sRule){if(document.all){document.styleSheets[0].addRule(sName,sRule)}else if(document.getElementById){document.styleSheets[0].insertRule(sName+"{"+sRule+"}",0);}}
function RefreshPage(){window.location.reload(true);}function CRequest(){var sHostName=window.location.hostname;if(sHostName=="localhost"){var sCurrentLocation=window.location.toString();sCurrentLocation=sCurrentLocation.substring(0,sCurrentLocation.indexOf("root")+4);this.ServerURL=sCurrentLocation+"/?";}else{this.ServerURL="http://"+sHostName+"/?";}
this.CallCode=null;this.CallMethod=null;this.OnResponse=null;this.QueryString="AjaxRequest=1&";this.arProperties=[];this.Debug=false;this.AddProperty=function(PropertyName,PropertyValue,Send){if(typeof(Send)=="undefined")
Send=true;var arProperty=[];arProperty["PropertyName"]=PropertyName;arProperty["PropertyValue"]=PropertyValue;arProperty["Send"]=Send;this.arProperties.push(arProperty);};this.GetPropertyValue=function(PropertyName){for(var i=0;i<this.arProperties.length;i++){if(this.arProperties[i]["PropertyName"]==PropertyName){return this.arProperties[i]["PropertyValue"];}}
return null;};this.CallAssembly=function(sAssemblyCode,sAssemblyMethod,OnResponse){this.CallCode="A:"+sAssemblyCode;this.CallMethod=sAssemblyMethod;this.Start(OnResponse);};this.CallTemplate=function(sTemplateCode,sTemplateMethod,OnResponse){this.CallCode="T:"+sTemplateCode;this.CallMethod=sTemplateMethod;this.Start(OnResponse);}
this.CallBlock=function(sBlockCode,sBlockMethod,OnResponse){this.CallCode="B:"+sBlockCode;this.CallMethod=sBlockMethod;this.Start(OnResponse);}
this.CallObject=function(sObjectCode,sObjectMethod,OnResponse){this.CallCode="O:"+sObjectCode;this.CallMethod=sObjectMethod;this.Start(OnResponse);}
this.Start=function(OnResponse){if(typeof(OnResponse)!="undefined")
this.OnResponse=OnResponse;if(this.CallCode)
this.AddProperty("_CallCode",this.CallCode);if(this.CallMethod)
this.AddProperty("_CallMethod",this.CallMethod);var oRequest=_CreateRequestObject();if(typeof(window._arRequests)=="undefined")
window._arRequests=[];RequestIndex=window._arRequests.length;window._arRequests[RequestIndex]=new Object();window._arRequests[RequestIndex].XmlHttpRequestObject=oRequest;window._arRequests[RequestIndex].RequestObject=this;for(var j=0;j<this.arProperties.length;j++){if(this.arProperties[j]["Send"])
this.QueryString+=this.arProperties[j]["PropertyName"]+"="+encodeURIComponent(this.arProperties[j]["PropertyValue"])+"&";}
this.QueryString+="_tmstmp="+(new Date()).getTime();oRequest.onreadystatechange=new Function("if(window._arRequests["+RequestIndex+"].XmlHttpRequestObject.readyState == 4){RequestResponse(window._arRequests["+RequestIndex+"]);}");oRequest.open('POST',this.ServerURL,true);oRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');oRequest.send(this.QueryString);};this._XmlHttpRequestText=null;this._XmlHttpRequestXML=null;this.GetResponseText=function(){return this._XmlHttpRequestText;};this.GetResponseXml=function(){return this._XmlHttpRequestXML;};}
function RequestResponse(oRequest){if(oRequest.XmlHttpRequestObject.responseText=="666"){alert("error");return false;}
if(oRequest.RequestObject.Debug){var DebugWindow=window.open("about:blank","_blank");DebugWindow.document.write(oRequest.XmlHttpRequestObject.responseText);}
var XmlDocument=oRequest.XmlHttpRequestObject.responseXML;if(XmlDocument.getElementsByTagName('Root').length){var Data=XmlDocument.getElementsByTagName('Root').item(0);oRequest.RequestObject._XmlHttpRequestXML=XmlToObject(Data);}
var Xml=oRequest.RequestObject.GetResponseXml();if(Xml){if(typeof(Xml._system_data_css)!="undefined"){if(Xml._system_data_css.length>0){eval("var oCss = "+Xml._system_data_css+";");for(var k in oCss)
AddCssClass(k,oCss[k]);}
delete oRequest.RequestObject._XmlHttpRequestXML._system_data_css;}}
if(oRequest.RequestObject.OnResponse){eval(oRequest.RequestObject.OnResponse+"(oRequest.RequestObject);");}
if(Xml){if(typeof(Xml._system_data_nocachejsfiles)!="undefined"){if(Xml._system_data_nocachejsfiles.length>0){eval("var arFiles = "+Xml._system_data_nocachejsfiles+";");for(var k in arFiles){arFiles[k]=ReplaceText(arFiles[k],"&amp;","&");arFiles[k]=ReplaceText(arFiles[k],"&gt;",">");arFiles[k]=ReplaceText(arFiles[k],"&lt;","<");}
var arScripts=document.getElementsByTagName("script");var arScriptsSrc=new Array();var nScriptsLength=arScripts.length;for(var i=0;i<nScriptsLength;i++){if(arScripts[i].src.length>0)
arScriptsSrc.push(arScripts[i].src);}
var nScriptsSrcLength=arScriptsSrc.length;for(var j in arFiles){var found=false;for(var i=0;i<nScriptsSrcLength;i++){if(arScriptsSrc[i]==arFiles[j]){found=true;break;}}
if(!found){LoadScript(arFiles[j])}}}
delete oRequest.RequestObject._XmlHttpRequestXML._system_data_nocachejsfiles;}
if(typeof(Xml._system_data_js)!="undefined"){if(Xml._system_data_js.length>0){eval("var oJs = "+Xml._system_data_js+";");for(var k in oJs){var sJs=oJs[k];window.tmpresponse=oRequest.RequestObject;sJs=sJs.replace("[RESPONSE]","window.tmpresponse");eval(sJs);}}
delete oRequest.RequestObject._XmlHttpRequestXML._system_data_js;}
if(typeof(Xml._system_data_onload)!="undefined"){if(Xml._system_data_onload.length>0){eval(Xml._system_data_onload);}
delete oRequest.RequestObject._XmlHttpRequestXML._system_data_onload;}}}
function _CreateRequestObject(){var oRequest=false;if(window.XMLHttpRequest){oRequest=new XMLHttpRequest();if(oRequest.overrideMimeType){oRequest.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{oRequest=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{oRequest=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
return oRequest;}
Block={};Block.OnUpdate=function(Response){var Xml=Response.GetResponseXml();if(typeof(Xml._system_blocks)!="undefined"){for(var id in Xml._system_blocks){var Element=$(id);if(Element)
SetOuterHTML(Element,Xml._system_blocks[id]);}}};function CheckField(sFieldName){var Field=$(sFieldName);if(!Field)
return true;if(parseInt(Field.getAttribute("DisableValidation"))==1)
return true;var FieldValue=GetFieldValue(sFieldName);var nFieldValueLength=FieldValue.length;var bRequired=(parseInt(Field.getAttribute("Required"))>0);if(bRequired){if(nFieldValueLength==0){MarkAsRequired(sFieldName);return false;}}else{if(nFieldValueLength==0)
return true;}
var sValidation=Field.getAttribute("Validation");var arValidation=[];if(sValidation.length>0)
arValidation=sValidation.split("#");for(var j=0;j<arValidation.length;j++){var sValidationType=arValidation[j];var arAttributes=[];if(sValidationType.indexOf("[")>0){var arValidationType=sValidationType.split("[");var sAttributes=arValidationType[1].substring(0,arValidationType[1].length-2);var arTemp=sAttributes.split(";");for(var k=0;k<arTemp.length;k++){var arAttribute=arTemp[k].split("=");arAttributes[arAttribute[0]]=arAttribute[1];}
sValidationType=arValidationType[0];}
var ReturnValue=true;eval("ReturnValue = "+sValidationType+"(FieldValue, arAttributes);");if(ReturnValue==false){MarkAsInvalid(sFieldName,arAttributes["em"]);return false;}}
return true;}
function sff(sFormID,arFieldNames){if(typeof(window.FormFields)=="undefined")
window.FormFields=new Array();window.FormFields[sFormID]=arFieldNames;}
function GetFormFieldNames(sFormID){return window.FormFields[sFormID];}
function sfofc(Event,FormID){if(Event.keyCode==13){SubmitForm(FormID);}}
function MarkAsInvalid(FieldName,sText){var Field=$(FieldName);CreateFieldBalloon(FieldName,sText,Field.getAttribute("BalloonCssClassName"));}
function MarkAsRequired(sFieldName){var Field=$(sFieldName);CreateFieldBalloon(sFieldName,Field.getAttribute("RequiredMessage"),Field.getAttribute("BalloonCssClassName"));}
function CreateFieldBalloon(sFieldName,sText,sCssClassName){var Field=$(sFieldName);var Balloon=CreateBalloon(sText,sCssClassName);Field.parentNode.insertBefore(Balloon,Field);FocusField(sFieldName);}
function FocusField(sFieldName){var Field=document.getElementsByName(sFieldName)[0];Focus(Field);}
function GetFieldValue(FieldName){var Field=$(FieldName);var sFieldType=Field.getAttribute("FieldType");if(sFieldType=="Textbox"||sFieldType=="Password"||sFieldType=="Textarea"||sFieldType=="Combobox"||sFieldType=="Date"||sFieldType=="File"||sFieldType=="Image"){return Field.value;}else if(sFieldType=="Checkbox"){return(parseInt(Field.value)==1)?"1":"";}else if(sFieldType=="Htmlarea"){var Document=GetHtmlAreaDocument(Field.id+"_Html");return Document.body.innerHTML;}}
function SetFieldValue(FieldName,sValue){var Field=$(FieldName);var sFieldType=Field.getAttribute("FieldType");if(sFieldType=="Textbox"||sFieldType=="Password"||sFieldType=="Textarea"||sFieldType=="Combobox"||sFieldType=="Date"||sFieldType=="File"||sFieldType=="Image"){Field.value=sValue;if(sFieldType=="Date"){Field.previousSibling.firstChild.innerHTML=sValue;}}else if(sFieldType=="Checkbox"){chsfv(FieldName,sValue);}else if(sFieldType=="Htmlarea"){var Document=GetHtmlAreaDocument(Field.id+"_Html");Document.body.innerHTML=sValue;}}
function SetFormSaving(sFormID){_SetFormSaving(sFormID,true);}
function SetFormNotSaving(sFormID){_SetFormSaving(sFormID,false);}
function _SetFormSaving(sFormID,bSaving){if(typeof(window.fsing)=="undefined")
window.fsing[sFormID]=bSaving;var sSubmitButtonName=typeof(window["fsb"+sFormID]!="undefined")?window["fsb"+sFormID]:null;if(sSubmitButtonName){var WaitButton=$(sSubmitButtonName+"w");if(WaitButton){var SubmitButton=$(sSubmitButtonName);if(bSaving){SubmitButton.parentNode.style.display="none";WaitButton.parentNode.style.display="";}else{SubmitButton.parentNode.style.display="";WaitButton.parentNode.style.display="none";}}}}
function ValidateForm(sFormID){var arFieldNames=GetFormFieldNames(sFormID);var nFieldNamesCount=arFieldNames.length;for(var i=0;i<nFieldNamesCount;i++){if(!CheckField(arFieldNames[i]))
return false;}
return true;}
window.fsing=new Array();function SubmitForm(sFormID){if(typeof(window.fsing[sFormID])!="undefined"&&window.fsing[sFormID])
return true;if(ValidateForm(sFormID)){SetFormSaving(sFormID);var Form=$(sFormID);var sOnBeforeSubmit=null;var OnBeforeSubmitInfo=GetChildElement(Form,"obs","input");if(OnBeforeSubmitInfo)
sOnBeforeSubmit=OnBeforeSubmitInfo.value;if(sOnBeforeSubmit&&sOnBeforeSubmit.length>0){var arOnBeforeSubmit=sOnBeforeSubmit.split(';');var nOnBeforeSubmitCount=arOnBeforeSubmit.length;for(var k=0;k<nOnBeforeSubmitCount;k++){if(arOnBeforeSubmit[k].length>0){var ReturnValue=eval(arOnBeforeSubmit[k]);if(ReturnValue==false){SetFormNotSaving(sFormID);return false;}else if(ReturnValue==2){return false;}}}}
var arFieldNames=GetFormFieldNames(sFormID);var nFieldNamesCount=arFieldNames.length;for(var i=0;i<nFieldNamesCount;i++){var sFieldName=arFieldNames[i];if(sFieldName.length>0){var Field=$(sFieldName);if(!Field)
continue;var sFieldType=Field.getAttribute("FieldType");if(sFieldType=="Htmlarea"){if(typeof(Field.innerText)!="undefined"){Field.innerText=GetFieldValue(sFieldName);}else{Field.innerHTML=GetFieldValue(sFieldName);}}}}
try{window.ftos=Form;window.setTimeout("window.ftos.submit();",1);}catch(e){}}}
fsf=SubmitForm;function sfo(FieldName,v,d,t,r,rm,b){var Field=$(FieldName);if(Field){Field.setAttribute("Validation",v);Field.setAttribute("DisableValidation",d);Field.setAttribute("FieldType",t);Field.setAttribute("Required",r);Field.setAttribute("RequiredMessage",rm);Field.setAttribute("BalloonCssClassName",b);}}
function fosmt(sFormID,OnSubmitData){var Form=$(sFormID);var OnSubmitInfo=GetChildElement(Form,"osmt","input");if(OnSubmitInfo){var sOnSubmit=OnSubmitInfo.value;var arOnSubmit=sOnSubmit.split(';');var nOnSubmitCount=arOnSubmit.length;for(var k=0;k<nOnSubmitCount;k++){if(arOnSubmit[k].length>0){var ReturnValue=eval(arOnSubmit[k].replace('[D]','OnSubmitData'));if(ReturnValue==false){return false;}}}}
SetFormNotSaving(sFormID);}function cbo(Element){cbc(Element,true);}
window.ahcb=new Array();window.cbhf=new Array();function cbvs(Element,bHasButtonClick){var Input=Element.nextSibling;var Layer=Input.nextSibling;cbcto(Input.id);if(window.cbpol!=Layer){cbc(Element,bHasButtonClick);}}
function cbvh(Element,bHasButtonClick){var Input=Element.nextSibling;window.ahcb[Input.id]=window.setTimeout("cbvha($('"+Input.id+"').previousSibling, "+(bHasButtonClick?"true":"false")+");",500);}
function cbcto(InputID){if(typeof(window.ahcb[InputID])!="undefined"&&window.ahcb[InputID]!=null){window.clearTimeout(window.ahcb[InputID]);delete window.ahcb[InputID];}}
function cbvha(Element,bHasButtonClick){var Input=Element.nextSibling;var Layer=Input.nextSibling;if(window.cbpol==Layer)
cbc(Element,bHasButtonClick);}
function cbc(Element,bHasButtonClick){bHasButtonClick=bHasButtonClick==true;var Input=Element.nextSibling;var Layer=Input.nextSibling;document.body.focus();var bShowedForFirstTime=typeof(window["cbsft"+Input.id])!="undefined";Layer.id=Input.id+"_o";if(!window.cbhf[Input.id])
window.cbhf[Input.id]=new Function("cbch('"+Input.id+"');");var Data=window[Input.id+"_d"];if(!Data)
return false;if(Layer.innerHTML.indexOf("[C]")!=-1){var sOptionTemplate=Layer.nextSibling.innerHTML;var sHtml='';var sSelectClick="cbs('"+Input.id+"-[V]-"+(bHasButtonClick?1:0)+"')";for(var k in Data.o){var sValue=Data.o[k];if(sValue==1)
sValue=k;if(sValue.length==0)
sValue='&nbsp;';sHtml+=sOptionTemplate.replace("[S]",sSelectClick).replace(encodeURIComponent("[S]"),sSelectClick).replace("[V]",k).replace(encodeURIComponent("[V]"),k).replace("[T]",sValue).replace(encodeURIComponent("[T]"),sValue).replace("[T]",sValue).replace(encodeURIComponent("[T]"),sValue);}
Layer.innerHTML=Layer.innerHTML.replace("[C]",sHtml);}
if(!bShowedForFirstTime){AttachEvent(Layer,"mousedown",sb);AttachEvent(Layer,"click",new Function("cbch('"+Input.id+"');"));}
var OptionsData=window[Input.id+"_da"];if(OptionsData==null||typeof(OptionsData)=="undedined")
OptionsData={};if(Layer.style.display!="block"){if(window.cbpol&&window.cbpol!=Layer){cbch(window.cbpol.previousSibling.id);}
if(typeof(OptionsData.obso)!="undefined"){eval(OptionsData.obso);}
Layer.style.display="block";window.cbpol=Layer;Layer.style.position="absolute";Layer.style.zIndex=1001;var nMinWidth=parseInt(Data.mlw);var bAutoSetHeight=parseInt(Data.ash)>0;var nNewWidth=Element.offsetWidth+(bHasButtonClick?Element.previousSibling.offsetWidth:0);if(nMinWidth>0&&nMinWidth>nNewWidth)
nNewWidth=nMinWidth;Layer.style.width=nNewWidth;if(bAutoSetHeight&&Layer.offsetHeight>150){Layer.style.height="150px";Layer.style.overflowX="hidden";Layer.style.overflowY="auto";}
var arCoordinates=GetElementCoordinates(bHasButtonClick?Element.previousSibling:Element,true);Layer.style.left=arCoordinates[0];Layer.style.marginTop=Element.offsetHeight+1;var f=window.cbhf[Input.id];var b=document.body;var w=window;AttachEvent(b,"mousedown",f);AttachEvent(b,"keydown",f);AttachEvent(w,"resize",f);}else{cbch(Input.id);}
window["cbsft"+Input.id]=true;}
function cbch(InputID){var Input=$(InputID);var Layer=Input.nextSibling;window.cbpol=null;cbcto(Input.id);$(Layer.id).style.display='none';var f=window.cbhf[InputID];var b=document.body;var w=window;DetachEvent(b,"mousedown",f);DetachEvent(b,"keydown",f);DetachEvent(w,"resize",f);delete window.cbhf[InputID];}
function cbs(sArgs){var arParts=sArgs.split("-");var InputID=arParts[0];var sValue=arParts[1];var Data=window[InputID+"_d"];var sText=Data.o[sValue];if(sText==1)
sText=sValue;if(sValue=="#")
sValue="";var bHasButtonClick=parseInt(arParts[2])>0;var Input=$(InputID);var sOldValue=Input.value;Input.value=sValue;if(sOldValue!=sValue)
Input.onchange();var Button=bHasButtonClick?Input.previousSibling.previousSibling:Input.previousSibling;Button.firstChild.innerHTML=sText;}function CheckRegExp(sValue,sRegExp){var arMatch=sValue.match(sRegExp);return(arMatch!=null&&typeof(arMatch[0])!="undefined"&&arMatch[0].length==sValue.length);}
function fv_u(sValue,arAttributes){return CheckRegExp(sValue,"[A-Za-z0-9]*");}
function fv_p(sValue,arAttributes){return CheckRegExp(sValue,"[A-Za-z0-9\-_]*");}
function fv_w(sValue,arAttributes){var bHasProtocol=sValue.match("^(http|https|ftp)\:\/\/");return(bHasProtocol!=null&&sValue.indexOf(".")>0&&sValue.indexOf(".")<sValue.length-1);}
function fv_m(sValue,arAttributes){var Letter1Pos=sValue.indexOf("@");var Letter2Pos=sValue.lastIndexOf(".");return(Letter1Pos>0&&Letter2Pos>0&&Letter1Pos+1<Letter2Pos&&Letter2Pos<sValue.length-1);}
function fv_e(sValue,arAttributes){var OtherFieldValue=GetFieldValue(arAttributes["ofn"]);return sValue==OtherFieldValue;}
function fv_l(sValue,arAttributes){return(sValue.length>=parseInt(arAttributes["rl"]))}
