﻿var _ppLoaded=false;var _ppLoading=false;var _timeoutAdjustment=2;var _xmlHttp=null;function ValidateSearchCriterias(s,args){var s1=document.getElementById('ctl00_PCMSMainContent_ddlSearch1');var s2=document.getElementById('ctl00_PCMSMainContent_ddlSearch2');args.IsValid=!(s1.selectedIndex!=0&&s1.selectedIndex==s2.selectedIndex);}function ValidateDates(s,args){var d1=document.getElementById('ctl00_PCMSMainContent_dtpStartDate');var d2=document.getElementById('ctl00_PCMSMainContent_dtpEndDate');args.IsValid=Date.parse(d1.value)<Date.parse(d2.value);}function getXMLHTTP(){var A=null;try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch(oc){A=null}}if(!A&&typeof XMLHttpRequest!="undefined"){A=new XMLHttpRequest()}return A}function AddMMDetails(msArr,msDates){var _ppLayer=document.getElementById("_ppLayer");_ppLayer.innerHTML='';var i;var te=document.createElement('table');te.style.border='1px solid';te.style.width='100%';var tb=document.createElement('tbody');te.appendChild(tb);for(i=0;i<msArr.length;i++){tr=document.createElement('tr');if(i%2==0)tr.style.backgroundColor="#f5f5f5";td1=document.createElement('td');td1.appendChild(document.createTextNode(msArr[i]));td2=document.createElement('td');td2.style.whiteSpace="nowrap";td2.appendChild(document.createTextNode(msDates[i]));tr.appendChild(td1);tr.appendChild(td2);tb.appendChild(tr);}_ppLayer.appendChild(te);_ppLayer.style.display="";if(navigator.userAgent&&navigator.userAgent.indexOf('MSIE')>-1){_ppLoading=true;_ppLoaded=false;}else{_ppLoading=false;_ppLoaded=true;}document.onclick=PopUpHide;}function GetMMDetails(docId,MMNumber){if(_xmlHttp&&_xmlHttp.readyState!=0){_xmlHttp.abort()}_xmlHttp=getXMLHTTP();if(_xmlHttp){_xmlHttp.open("GET","GetMMNumberDetails.aspx?d="+docId+'&m='+MMNumber,true);_xmlHttp.onreadystatechange=function(){if(_xmlHttp.readyState==4&&_xmlHttp.responseText){if(_xmlHttp.responseText.charAt(0)=="<"){}else{eval(_xmlHttp.responseText);}}};_xmlHttp.send(null)}}function FindPos(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}}return[curleft,curtop];}function GetMMNumberDetails(doc,mm,se){var _ppLayer=document.getElementById("_ppLayer");var pos=FindPos(se);_ppLayer.style.left=pos[0]-50+'px';_ppLayer.style.top=pos[1]+20+'px';GetMMDetails(doc,mm);}function PopUpHide(e){if(_ppLoading==true&&_ppLoaded==false){_ppLoaded=true;_ppLoading=false;}else if(_ppLoaded==true){var _ppLayer=document.getElementById("_ppLayer");_ppLayer.style.display='none';_ppLoaded=false;_ppLoading=false;}}