function PopupPic(sPicURL) { 
	window.open("popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=300");
}
var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=800,width=300');
	if (window.focus) {newwindow.focus()}
}

// Last updated 2006-02-21
function addRowToTable()
{
  var tbl = document.getElementById('tblSample');
  var lastRow = tbl.rows.length;
  // if there's no header row in the table, then iteration = lastRow + 1
  var iteration = lastRow;
  var row = tbl.insertRow(lastRow);
  
  // left cell
  //var cellLeft = row.insertCell(0);
  //var textNode = document.createTextNode(iteration);
  //cellLeft.appendChild(textNode);
  
  // right cell
  var cellRight = row.insertCell(0);
  var el = document.createElement('input');
  el.type = 'file';
  el.name = 'txtRow' + iteration;
  el.id = 'txtRow' + iteration;
  el.size = 40;
  el.className = 'field';
  
  el.onkeypress = keyPressTest;
  cellRight.appendChild(el);
  
  // select cell
  //var cellRightSel = row.insertCell(2);
  //var sel = document.createElement('select');
  //sel.name = 'selRow' + iteration;
  //sel.options[0] = new Option('text zero', 'value0');
  //sel.options[1] = new Option('text one', 'value1');
  //cellRightSel.appendChild(sel);
}
function keyPressTest(e, obj)
{
  var validateChkb = document.getElementById('chkValidateOnKeyPress');
  if (validateChkb.checked) {
    var displayObj = document.getElementById('spanOutput');
    var key;
    if(window.event) {
      key = window.event.keyCode; 
    }
    else if(e.which) {
      key = e.which;
    }
    var objId;
    if (obj != null) {
      objId = obj.id;
    } else {
      objId = this.id;
    }
    displayObj.innerHTML = objId + ' : ' + String.fromCharCode(key);
  }
}
function removeRowFromTable()
{
  var tbl = document.getElementById('tblSample');
  var lastRow = tbl.rows.length;
  //if (lastRow > 0) 
  tbl.deleteRow(lastRow -1);
}
function openInNewWindow(frm)
{
  // open a blank window
  var aWindow = window.open('', 'TableAddRowNewWindow',
   'scrollbars=yes,menubar=yes,resizable=yes,toolbar=no,width=400,height=400');
   
  // set the target to the blank window
  frm.target = 'TableAddRowNewWindow';
  
  // submit
  frm.submit();
}
function numara_randuri(){
		
	var tbl = document.getElementById('tblSample');
  	var lastRow = tbl.rows.length;
	
	var nr_randuri = document.getElementById('nr_randuri');
	nr_randuri.value=lastRow;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
