function LRContentLoader(targetDiv,method,action,formname,Sync) { this.name='Samuel'; this.loader=''; this.targetDiv=targetDiv; this.method=method; this.action=action; this.formname=formname; if(formname!='') {this.postdata=GetFormValues(formname);} else {this.postdata='';} this.Sync=Sync; this.doRequest=function() { divTarget=document.getElementById(this.targetDiv+'_Loader'); divTarget.style.display=''; if(!this.Sync) { dhtmlxAjax.tag = this.targetDiv; if(this.method=='GET') dhtmlxAjax.get(this.action,this.OutputResponse); if(this.method=='POST') dhtmlxAjax.post(this.action,this.postdata,this.OutputResponse); } else { if(this.method=='GET') this.loader = dhtmlxAjax.getSync(this.action); if(this.method=='POST') this.loader = dhtmlxAjax.postSync(this.action,this.postdata); this.UpdateTarget(); } } this.OutputResponse=function(loader) { divTarget=document.getElementById(loader.tag+'_Loader'); divTarget.style.display='none'; divTarget=document.getElementById(loader.tag+'_Content'); if(loader.xmlDoc.status==200) { divTarget.innerHTML=getHTMLBody(loader.xmlDoc.responseText); } else { divTarget.innerHTML=loader.xmlDoc.status+' '+loader.xmlDoc.responseText; } } this.UpdateTarget=function() { divTarget=document.getElementById(this.targetDiv+'_Loader'); divTarget.style.display='none'; divTarget=document.getElementById(this.targetDiv+'_Content'); if(this.loader.xmlDoc.status==200) { divTarget.innerHTML=getHTMLBody(this.loader.xmlDoc.responseText); } else { divTarget.innerHTML=this.loader.xmlDoc.status+' '+this.loader.xmlDoc.responseText; } } } function getHTMLBody(HTMLText) { output=HTMLText; bodyStart=HTMLText.indexOf('=0) { bodyStart=HTMLText.indexOf('>',bodyStart); output = HTMLText.substr(bodyStart+1); } bodyEnd=output.indexOf(''); if(bodyEnd>=0) { output = output.substr(0,bodyEnd); } return(output); } function SYSOpenWindow2(PageName,WindowType,SizeX,SizeY,SScrollbar,Resizable,SToolbar,SMenubar,SStatusbar,CopyHistory,UseConfirm,Message) { var wGoOn=true; if(UseConfirm) wGoOn=confirm(Message); if(wGoOn) { if(WindowType=='modal') { parent.NaviWin=window.showModalDialog(PageName,'','toolbar='+SToolbar+'; left=100px; top=100px; directories=no; status='+SStatusbar+'; menubar='+SMenubar+'; scrollbars='+SScrollbar+'; resizable='+Resizable+'; copyhistory='+CopyHistory+'; dialogWidth=' + SizeX + 'px; dialogHeight=' + SizeY +'px;'); document.location.href = document.location.href; } else { parent.NaviWin=window.open(PageName,'','toolbar='+SToolbar+',left=100,top=100,directories=no,status='+SStatusbar+',menubar='+SMenubar+',scrollbars='+SScrollbar+',resizable='+Resizable+',copyhistory='+CopyHistory+',width=' + SizeX + ',height=' + SizeY); } } } function CMSModalWindow(PageName,SizeX,SizeY,SScrollbar,Resizable,SToolbar,SMenubar,SStatusbar,CopyHistory) { if(true) { //document.location.href = PageName; parent.NaviWin=window.showModalDialog(PageName,'','toolbar='+SToolbar+'; left=100px; top=100px; directories=no; status='+SStatusbar+'; menubar='+SMenubar+'; scrollbars='+SScrollbar+'; resizable='+Resizable+'; copyhistory='+CopyHistory+'; dialogWidth=' + SizeX + 'px; dialogHeight=' + SizeY +'px;'); } else { //document.location.href = PageName; parent.NaviWin=window.open(PageName,'','toolbar='+SToolbar+',left=100,top=100,directories=no,status='+SStatusbar+',menubar='+SMenubar+',scrollbars='+SScrollbar+',resizable='+Resizable+',copyhistory='+CopyHistory+',width=' + SizeX + ',height=' + SizeY); } return parent.NaviWin; } function SYSConfirm(Message,URL) { if(confirm(Message)) { document.location.href=URL; } } function SYSOpenWindow(PageName,SizeX,SizeY) { parent.NaviWin=window.open(PageName,'','toolbar=no,left=100,top=100,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + SizeX + ',height=' + SizeY); }; function GotoUrl(PageName) { document.location.href = PageName; }; function SYSOpenWindowResizeable(PageName,SizeX,SizeY) { parent.NaviWin=window.open(PageName,'','toolbar=no,left=100,top=100,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + SizeX + ',height=' + SizeY ); }; function SYSOpenWindowModal(PageName,SizeX,SizeY) { if (window.showModalDialog) { window.showModalDialog(PageName,'','dialogWidth:' + SizeX + 'px;dialogHeight:' + SizeY + 'px'); } else { window.open(PageName,'','height=' + SizeY + ',width=' + SizeX + ',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'); }; document.location.href = document.location.href; }; function swapImage(source,index) { //v3.0 source.src = preLoaderImages[index-1].src } function UpdateFormField(FormName,FieldName,NewValue) { document.forms[FormName].elements[FieldName].value = NewValue; } function fnctXD(btn, name, Collapse, Expand) { var row row = document.getElementById(name); if(row.style.display=='none') { row.style.display=''; btn.src = Collapse; } else { row.style.display = 'none'; btn.src = Expand; } return 0; } function sumFT(destinationName, fieldName, indexStart, indexEnd) { var row; var tot=0; for(i=indexStart;i<=indexEnd;i++) { row = document.getElementById(fieldName + i); if(isNaN(parseFloat(row.value))) { row.value = parseFloat(0); } else { row.value = parseFloat(row.value); } row.value = parseFloat(row.value); tot = tot + parseFloat(row.value); } destination = document.getElementById(destinationName); destination.value=tot; } function validateForm(message,ask) { if(message=='') { return -1; } else { if(ask) { return confirm(message+'\n\n Proseguire?'); } else { return 0; } } } function GetFormValues(formName){ result = ''; for(var i=0; i < document.forms[formName].elements.length; i++) { if(i>0) { result += '&'; } result += document.forms[formName].elements[i].name + '=' + escape(document.forms[formName].elements[i].value); } return result; } function UpdateElement(FormName,ElementID,UpdaterURL){ var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); var url = UpdaterURL+'?'+GetFormValues(FormName); var saveValue = document.forms[FormName].elements[ElementID].value xmlhttp.open("GET", url,true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { wElement = document.getElementById(ElementID); doc = new ActiveXObject("Microsoft.XMLDOM"); doc.loadXML(xmlhttp.responseText) ; var xmlObj=doc.documentElement; wElement.options.length = 0; for(var i=0; i < xmlObj.childNodes.length; i++) { wValue = xmlObj.childNodes(i).getAttribute("value"); wText = xmlObj.childNodes(i).text; wElement.options[i]=new Option(wText,wValue) if(wValue==saveValue) wElement.options[i].selected = true; } try { wElement.onchange(); } catch(exception) { } } } xmlhttp.send(null) } function validateCols(colName,colCheckType,tstValue,colMessage) { row = document.getElementById(colName + '_SUM'); value = parseFloat(row.value); check = -1; switch(colCheckType) { case '<': if(value=': if(value>=tstValue) check=0; break; case '>': if(value>tstValue) check=0; break; } if(check==0) { return colMessage; } else { return ''; } } function makevisible(cur,which,myopacity){ strength=(which==0)? 1 : 0.2 if (cur.style.MozOpacity) cur.style.MozOpacity = myopacity/100 else(cur.filters) cur.filters.alpha.opacity = myopacity }