﻿// JScript File

var lastindex=0;
var filePath = 'ajax/port.php';
 function sendRequest(params,container) { 
  if (window.XMLHttpRequest) {
    var xmlhr = new XMLHttpRequest();
  } else {
    var xmlhr = new ActiveXObject('MSXML2.XMLHTTP.3.0');
  }
  xmlhr.open('POST', filePath+"/ajax/portifolio.php?rnd="+Math.random(), true);
  xmlhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
  xmlhr.onreadystatechange = function() {  
    var resultDiv = document.getElementById(container);  
    if (xmlhr.readyState == 1) 
    {
        LoadMessageObj.setHtmlContent('<table cellpadding="0" cellspacing="0" class="Status"><tr><td><img src="'+filePath+'/images/loader.gif">&nbsp;</td></tr></table>');
        LoadMessageObj.setSize(1,1);
        LoadMessageObj.setCssClassMessageBox('');
        LoadMessageObj.setSource(false);	// no html source since we want to use a static message here.
        LoadMessageObj.setShadowDivVisible(true);	// Disable shadow for these boxes	
        LoadMessageObj.display();
    } 
    else if (xmlhr.readyState == 4 && xmlhr.status == 200)
     {
      if (xmlhr.responseText)
       {              
            var content= xmlhr.responseText;
            var contents=content.split("`")
            resultDiv.innerHTML=contents[0];
            document.getElementById("others").innerHTML=contents[1]; 
            LoadMessageObj.close();	          
      }
    } else if (xmlhr.readyState == 4) {
      alert('Invalid response received - Status: ' + xmlhr.status);
    }
  }
  xmlhr.send(params);
}


function ShowWork(Page,path,design)
{
    filePath=path;    
    sendRequest("page="+Page+"&design="+design+"&path="+path,"ports");
}

