//---------------------------------------------------------------------------------------------------------------------------- 
//--ncTools.js
//--Netstair Communications LLC.
//--www.netstair.com
//--You can use this or distribute it with your code as long you keep the Netstair Communications LLC credit
//----------------------------------------------------------------------------------------------------------------------------

function PopUpWindow(mypage,width,height,scrollbar,resizable)
{
	  settings="width=" + width + ",height=" + height + ",scrollbars=" + scrollbar + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=" + resizable;
	  win=window.open(mypage,"popupWin",settings);
	  win.focus();
}

function NewWindow(mypage){
	  myleft=0;mytop=20
	  settings="width=200,height=200,top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
	  win=window.open(mypage,"popupWin",settings);
	  win.focus();
}
function show_content(vParam, vHie, vWid) 
  {
      var vURL = "../Show.aspx?PageID=" + vParam;
      var vWinSize = "location=0,status=0,menubar=0,scrollbars=0,resizable=0,height=" + vHie + ",width=" + vWid;
      window.open(vURL, "newin", config = vWinSize)
  }
//- POP Up window.
function PopupCenter(pageURL, title, w, h) {
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
//- Mail the Article read.
function mailArticle() {    
    var content_innerhtml = document.getElementById("prn_area").innerHTML;
    //-var mailToId = document.forms[0].mailId.value;
    var pageURL = document.location.href    //- The URL
    var queryStringParam = location.search //- The Querystring ?=&=
    var article_body_content = pageURL + queryStringParam;
    var mailto_link = 'mailto:&subject=I thought you might like to read this&body=' + article_body_content;
    win = window.open(mailto_link, 'tempWindow');    
    if (win && win.open && !win.closed) win.close();
}
//-- Print Content of a page
function tablePrint() {

    var display_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    display_setting += "scrollbars=yes,width=750, height=600, left=100, top=25";

    var content_innerhtml = document.getElementById("prn_area").innerHTML;
    var document_print = window.open("", "", display_setting);
    document_print.document.open();
    document_print.document.write('<html><head><title>Netstair.net</title></head>');
    document_print.document.write('<body style="font-family:verdana; font-size:12px;" onLoad="self.print();self.close();" >');
    document_print.document.write(content_innerhtml);
    document_print.document.write('</body></html>');
    document_print.print();
    document_print.document.close();
    return false;
} 
