	function WindowPopup(url, width_in, height_in) {
		new_window = window.open(url,'window','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=' + width_in + ',height=' + height_in);
		new_window.focus();
	}

	function Help(id) {
		var help_path = '{help_url_path}';
		WindowPopup(help_path, 800, 600);
	}

	function SelectField(field) {
		full_field = eval('document.'  + field);
		full_field.select();
		full_field.focus();
	}

	function displayRow(){
		var row = document.getElementById("captionRow");
		if (row.style.display == '') row.style.display = 'none';
		else row.style.display = '';
	}

	function showHideTR(id_in,vis) {
  		var row;

   		row = document.getElementById(id_in);
   		
  		if(row) 
  		{
    		if(!vis) 
    		{
      			row.style.display = 'none';
    		}
    		else
    		{
        		try {
          			row.style.display = 'table-row';
        		}
        		catch(e) 
        		{
          			row.style.display = 'block';
        		}
    		}
  		}
	}

	function addListenEvent(elm, evType, fn, useCapture)
	{
		var ret = 0;

		if (elm.addEventListener)
		ret = elm.addEventListener(evType, fn, useCapture);
		else if (elm.attachEvent)
		ret = elm.attachEvent('on' + evType, fn);
		else elm['on' + evType] = fn;

		return ret;
	} 

	function ShowLength(text_in) {
		message_length = text_in.value.length;
		alert('Length in characters: ' + message_length);
	}
	
	function passText(objectin, passedvalue) {

  		if (passedvalue != "") {

			var myTextArea = objectin;
	
    	    //IE support
	        if (document.selection) {
    	        myTextArea.focus();
        	    sel = document.selection.createRange();
            	sel.text = passedvalue;
            	document.form.insert.focus();
        	}
        	//MOZILLA/NETSCAPE support
        	else if (objectin.selectionStart || objectin.selectionStart == "0") {
	            var startPos = objectin.selectionStart;
    	        var endPos = objectin.selectionEnd;
        	    var curdata = objectin.value;

            	myTextArea.value = curdata.substring(0, startPos) + passedvalue + curdata.substring(endPos, curdata.length);
        	} else {
            	myTextArea.value += passedvalue;
        	}

  		}
	}

	
	function getStyle(el,styleProp)
	{
		var x = (typeof(el)=='string')?document.getElementById(el):el;
		if (x.currentStyle)
			var y = x.currentStyle[styleProp];
		else if (window.getComputedStyle)
			var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
		return y;
	}

// window.onload = function() {
//  if(!document.getElementsByTagName) return;
//  var tds = document.getElementsByTagName('td');
//  for(var i=0;i<tds.length;i++) {
//    tds[i].onclick = function() {
//      alert(this.parentNode.tagName+' = display : '+getStyle(this.parentNode,'display')+
//        '\n'+this.tagName+' = display : '+getStyle(this,'display'));
//    }
//  }
//}


