var doc;

function ShowChat() {
var w = 650;
								var h = 600;
								var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
								var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
								var settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=1,resizable=1,status=1,menubar=1';
  window.open('http://server-dmi/isdmiold',"chat",settings);
	
}


 function printSelection(node){

  var content=document.getElementById(node).innerHTML;
  var pwin=window.open('print.html','print_content','width=100,height=100');

  pwin.document.open();
  pwin.document.write('<html><head><link href="css/print_daftar.css" type="text/css" rel="stylesheet"></head><body onload="window.print()">'+content+'</body></html>');
  
 pwin.document.close();

  setTimeout(function(){pwin.close();},1000);

}



function ftest(str) {
        //alert('suhuttttttttttttttttttttt');
         eval(str);
   }
 
function setdoc(docx) {
	doc=docx;
}

function showListLaporanBackUp(field, filename, mode, page, search, order_field, order_type,pcount)
{
	ajax_do('query2.php?code=xx&page_count='+pcount+'&page='+page+'');
    //alert(document.getElementById('iframe_laporan').src);
    doc.go_page(document.getElementById('iframe_laporan').src+'#JR_PAGE_ANCHOR_0_'+page);
//	doc.go_page(get_url_report()+'#JR_PAGE_ANCHOR_0_'+page);



}

function showListLaporan(field, filename, mode, page, search, order_field, order_type,pcount)
{  
	//ajax_do('query2.php?code=xx&page_count='+pcount+'&page='+page+'');
   document.getElementById("page_laporan").innerHTML = '<img src=images/loading.gif>';
   furl_plusx('&page='+page);
   //submitbutton('Generate Report','inventory','laporaninventory::laporanminimumlevelstock','24',furl_plus(),'laporan_inventory');
 
}
function showListLaporan2(docx,urlx)
{



doc=docx;
var gContainer=parent;
//document.getElementById('iframe_laporan').style.display='';";
try{

gContainer.ajax_do(urlx);

	
}
//An  error is raised if the IFrame domain != its container's domain
catch(e)
{
//window.status  ='Error: ' + e.number + ';  ' + e.description;
}
}

function printPage() { print(); }
function printIframe(id)
{
//    alert('suhut c');
//    var zoom = 1.5;
//    var iframe = document.getElementById(id);
//    var contViewer = iframe.docShell.contentViewer;
//    var docViewer = contViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
////    docViewer.fullZoom = zoom;
//    Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser").getBrowser().mCurrentBrowser.markupDocumentViewer.fullZoom = 1;
//
//
//    return true
    var iframe = document.frames ? document.frames[id] : document.getElementById(id);
    var ifWin = iframe.contentWindow || iframe;
    ifWin.print();
    
    return false;
}



function reSize_onmousemove() {



}


function reSizeLaporan()
{
//alert('suhut');
var gContainer=parent;

try{
var oBody=document.body;
var oFrame=gContainer.document.getElementById("iframe_laporan");
    if(oFrame.style.width>oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth)) {
           oFrame.style.width='100%';
          oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
          oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);
     }
     else {
              oFrame.style.width='100%';
             oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
             oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);

     }
}
//An  error is raised if the IFrame domain != its container's domain
catch(e)
{
//window.status  ='Error: ' + e.number + ';  ' + e.description;
}
}
function reSize()
{
 
//alert('suhut');
var gContainer=parent;

try{
var oBody=document.body;
var oFrame=gContainer.document.getElementById("iframe1");
    if(oFrame.style.width>oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth)) {
           oFrame.style.width='100%';
          oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
          oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);
     }
     else {
            oFrame.style.width='100%';
             oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
             oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);

     }
	
}
//An  error is raised if the IFrame domain != its container's domain
catch(e)
{
//window.status  ='Error: ' + e.number + ';  ' + e.description;
}
}

function reSizexx()
{

//alert('suhut');
var gContainer=parent;

try{
var oBody=document.body;
var oFrame=gContainer.document.getElementById("iframe1");
    if(oFrame.style.width>oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth)) {
           //oFrame.style.width='100%';
          oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
          oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);
     }
     else {
           // oFrame.style.width='100%';
             oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
             oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);

     }

}
//An  error is raised if the IFrame domain != its container's domain
catch(e)
{
//window.status  ='Error: ' + e.number + ';  ' + e.description;
}
}

function reSize1()
{
//alert('suhut');
var gContainer=parent;

try{
var oBody=document.body;
var oFrame=gContainer.document.getElementById("iframe1");
   
             oFrame.style.height = oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
       oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);

}
//An  error is raised if the IFrame domain != its container's domain
catch(e)
{
//window.status  ='Error: ' + e.number + ';  ' + e.description;
}
}
function iframe_laporan()
{
//alert('suhut');
var gContainer=parent;

try{
var oBody=document.body;
var oFrame=gContainer.document.getElementById("iframe1");

oFrame.style.height =oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);
}
//An  error is raised if the IFrame domain != its container's domain
catch(e)
{
//window.status  ='Error: ' + e.number + ';  ' + e.description;
}
}

/*     function reSizex()
    {
        alert('suhut');
        try{
        var oBody=document.getElementById("iframe1").document.body;

        var oFrame=document.getElementById("iframe1");
        alert("mm:"+ oBody.scrollHeight);
        
        oFrame.style.height =oBody.scrollHeight  + (oBody.offsetHeight - oBody.clientHeight);
        oFrame.style.width = oBody.scrollWidth  + (oBody.offsetWidth - oBody.clientWidth);
        }
        //An  error is raised if the IFrame domain != its container's domain
        catch(e)
        {
        window.status  ='Error: ' + e.number + ';  ' + e.description;
        }
    } */
