var kDrillInfoDrillOn=1;var kDrillInfoFilterOn=2;function StringReplace(c,a,b){return c.split(a).join(b)}function DrillInfo_EncodeImpl(f,c){var b="";for(var a=0;a<f.length;++a){var e=f[a];if(e!=null){var d=e.toString();if(c){d=StringReplace(d,"\\","\\\\");d=StringReplace(d,"~","\\~");b+=d}else{b+=d}if((a+1)<f.length){b+="~"}}}return b}function DrillInfo_EncodeValues(){return DrillInfo_EncodeImpl(this.values,true)}function DrillInfo_EncodeQueryColumns(){return DrillInfo_EncodeImpl(this.columns,false)}function DrillInfo_EncodeCodeValues(){return DrillInfo_EncodeImpl(this.codeValues,true)}function DrillInfo_EncodeCodeColumns(){return DrillInfo_EncodeVirtColumnsImpl(this.codeColumns,this.columns)}function DrillInfo_EncodeVirtColumnsImpl(e,d){var c="";var b=0;for(var a=0;a<e.length;++a){if(e[a]!=undefined){c+=e[a];if((a+1)<e.length){c+="~"}}if(d[a]!=null){++b}}return c}function DrillInfo_EncodeDrillColumns(){return DrillInfo_EncodeVirtColumnsImpl(this.drillCols,this.columns)}function DrillInfo_EncodeFilterColumns(){return DrillInfo_EncodeVirtColumnsImpl(this.filterCols,this.columns)}function DrillInfo_EncodePivotStartingPage(){if(this.pivotAllPages){return"allpages"}else{return"notallpages"}}function DrillInfo_AddValue(c,b,a){if(b==null){this.values.push("*NQ_NULL*")}else{this.values.push(b.toString())}this.AddColumn(c,a)}function DrillInfo_AddColumn(b,a){this.columns.push(b);if(a==kDrillInfoDrillOn){this.drillCols.push(b)}else{if(a==kDrillInfoFilterOn){this.filterCols.push(b)}}}function DrillInfo_AddCodeColumnValue(b,a){if(a==null){this.codeValues.push("*NQ_NULL*")}else{this.codeValues.push(a.toString())}this.AddCodeColumn(b)}function DrillInfo_AddCodeColumn(a){this.codeColumns.push(a)}function DrillInfo_DrillOn(a){this.drillCols.push(a)}function DrillInfo_FilterOn(a){this.filterCols.push(a)}function DrillInfo_SetPivotAllPages(){this.pivotAllPages=true}function DrillInfo_SetReportXmlText(a){this.reportXml=a}function DrillInfo_GetReportXmlText(){return this.reportXml}function DrillInfo(){this.drillCols=new Array();this.filterCols=new Array();this.values=new Array();this.columns=new Array();this.codeColumns=new Array();this.codeValues=new Array();this.pivotAllPages=false;this.reportXml=null;this.EncodeDrillColumns=DrillInfo_EncodeDrillColumns;this.EncodeFilterColumns=DrillInfo_EncodeFilterColumns;this.EncodeQueryColumns=DrillInfo_EncodeQueryColumns;this.EncodeValues=DrillInfo_EncodeValues;this.EncodePivotStartingPage=DrillInfo_EncodePivotStartingPage;this.EncodeCodeColumns=DrillInfo_EncodeCodeColumns;this.EncodeCodeValues=DrillInfo_EncodeCodeValues;this.DrillOn=DrillInfo_DrillOn;this.FilterOn=DrillInfo_FilterOn;this.AddColumn=DrillInfo_AddColumn;this.AddValue=DrillInfo_AddValue;this.PivotAllPagesOn=DrillInfo_SetPivotAllPages;this.AddCodeColumn=DrillInfo_AddCodeColumn;this.AddCodeColumnValue=DrillInfo_AddCodeColumnValue;this.SetReportXmlText=DrillInfo_SetReportXmlText;this.GetReportXmlText=DrillInfo_GetReportXmlText;return this}function DisplayDrillDownInfo(b){var a="Drill on columns = "+b.EncodeDrillColumns()+"\n\n";a+="Filter columns = "+b.EncodeFilterColumns()+"\n\n";a+="Query Columns = "+b.EncodeQueryColumns()+"\n\n";a+="Values = "+b.EncodeValues()+"\n\n";a+="Code columns = "+b.EncodeCodeColumns()+"\n\n";a+="Code values = "+b.EncodeCodeValues();alert(a)}function FormInputToURL(b,d){var c="";var a=b.elements[d];if((a!=null)&&(a.value!="")){c="&"+d+"="+saw.encodeURIComponent(a.value)}return c}function DrillFormToURL(b,a){var c=b.elements.URL.value;c+="&Action="+saw.encodeURIComponent(a);c+=FormInputToURL(b,"ViewID");c+=FormInputToURL(b,"ViewState");c+=FormInputToURL(b,"Options");c+=FormInputToURL(b,"Style");c+=FormInputToURL(b,"ViewName");c+=FormInputToURL(b,"PivotAllPages");c+=FormInputToURL(b,"P0");c+=FormInputToURL(b,"P1");c+=FormInputToURL(b,"P2");c+=FormInputToURL(b,"P3");return c}function DrillBack(d,b){var c={};var a={ignoreClientStateXml:true};c.ViewState=b;obips.views.ViewController.handleViewAction("DrillBack",d,c,a);return false};