﻿function replaceAll(source, findString, replaceString) 
{
var result = source; 
var i = source.indexOf(findString);
var l1 = findString.length; 
while (i >= 0) { result = source.substring(0, i); result += replaceString; result += source.substring(i + l1); source = result; i = source.indexOf(findString); } 
return result; 
}

function sendPrint(TagId)
{
var prtContent = document.getElementById(TagId);
var WinPrint =
window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><link href='CSS/style.css' type='text/css' rel='StyleSheet' /></head><body><div style='font-family:tahoma;'>"+prtContent.innerHTML+"</div></body></html>");
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}

function AddOption(selectId,text,value)
{
  var elOptNew = document.createElement('option');
  elOptNew.text = text;
  elOptNew.value = value;
  var elSel = document.getElementById(selectId);

  try {
    elSel.add(elOptNew, null);
  }
  catch(ex) {
    elSel.add(elOptNew);
  }
}
function Inc(num)
{
return num+1;
}
