var newwindow;String.prototype.trim=function(){a=this.replace(/^\s+/,"");return a.replace(/\s+$/,"")};String.prototype.replaceAll=function(strTarget,strSubString){var strText=this;var intIndexOfMatch=strText.indexOf(strTarget);while(intIndexOfMatch!=-1){strText=strText.replace(strTarget,strSubString);intIndexOfMatch=strText.indexOf(strTarget)}return strText};
function modal_pop(url,reload){var m_args="dialogHeight:600px;dialogWidth:800px;center:yes;resizable:yes;scroll:yes;toolbar:no;menubar:no;location:no;directories:no;";var r_args="height=600,width=800,center=yes,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,modal=yes";var ret;if(window.showModalDialog)ret=window.showModalDialog(url,"text_edit",m_args);else ret=window.open(url,"text_edit",r_args);if(reload=="1")document.location.reload()}
function pop_product(url,reload){var m_args="dialogHeight:400px;dialogWidth:450px;center:yes;resizable:no;scroll:yes;toolbar:no;menubar:no;location:no;directories:no;";var r_args="height=400,width=450,center=yes,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,modal=yes";var ret;if(window.showModalDialog)ret=window.showModalDialog(url,"text_edit",m_args);else ret=window.open(url,"text_edit",r_args);if(reload=="1")document.location.reload()}
function pop(url){newwindow=window.open(url,"name","scrollbars=yes,toolbar=yes,menubar=yes,location=yes,directories=yes,dependant=yes");if(window.focus)newwindow.focus()}
function pop_call_window(url){var m_args="dialogHeight:60px;dialogWidth:80px;center:yes;resizable:no;scroll:no;toolbar:no;menubar:no;location:no;directories:no;";var r_args="height=60,width=80,center=yes,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no";var ret;if(window.showModalDialog)newwindow=window.open(url,"call_window",m_args);else newwindow=window.open(url,"call_window",r_args);if(window.focus)newwindow.focus()}
function alternateRowColors(){var className="box_table";var rowcolor="#eaeaea";var rows,arow;var tables=document.getElementsByTagName("table");var rowCount=0;for(var i=0;i<tables.length;i++)if(tables.item(i).className==className){atable=tables.item(i);rows=atable.getElementsByTagName("tr");for(var j=0;j<rows.length;j++){arow=rows.item(j);if(arow.nodeName=="TR"){if(rowCount%2)arow.style.backgroundColor=rowcolor;else;rowCount++}}rowCount=0}}
function SetUniqueRadioButton(nameregex,current){re=new RegExp(nameregex);for(i=0;i<document.forms[0].elements.length;i++){elm=document.forms[0].elements[i];if(elm.type=="radio")if(re.test(elm.name))elm.checked=false}current.checked=true}function StopPropogation(e,objTextArea){alert(e.keyCode);if(e.keyCode=="13"){objTextArea.value+="\r\n";return false}return true}var _source;var _popup;function showConfirm(source){this._source=source;this._popup=$find("mdlPopup");this._popup.show()}
function okClick(){this._popup.hide();__doPostBack(this._source.name,"")}function cancelClick(){this._popup.hide();this._source=null;this._popup=null}var MAX_DUMP_DEPTH=10;
function dumpObj(obj,name,indent,depth){if(depth>MAX_DUMP_DEPTH)return indent+name+": <Maximum Depth Reached>\n";if(typeof obj=="object"){var child=null;var output=indent+name+"\n";indent+="\t";for(var item in obj){try{child=obj[item]}catch(e){child="<Unable to Evaluate>"}if(typeof child=="object")output+=dumpObj(child,item,indent,depth+1);else output+=indent+item+": "+child+"\n"}return output}else return obj}
$.extend({URLEncode:function(c){var o="";var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;while(x<c.length){var m=r.exec(c.substr(x));if(m!=null&&m.length>1&&m[1]!=""){o+=m[1];x+=m[1].length}else{if(c[x]==" ")o+="+";else{var d=c.charCodeAt(x);var h=d.toString(16);o+="%"+(h.length<2?"0":"")+h.toUpperCase()}x++}}return o},URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;while((m=r.exec(o))!=null&&m.length>1&&m[1]!=""){b=parseInt(m[1].substr(1),16);t=String.fromCharCode(b);o=o.replace(m[1],
t)}return o}});function getQS(key,default_){if(default_==null)default_="";key=key.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+key+"=([^&#]*)");var qs=regex.exec(window.location.href);if(qs==null)return default_;else return qs[1]};
