function searchClear(target, searchText)
{
  if (target.value == searchText)
  {
    target.value = '';
  }
};

function searchRestore(target, searchText)
{
  if (target.value == ''){
    target.value = searchText;
  }
};

function bar(url, title) {
	wasOpen = false;
	win     = window.open(url, title);    
	return (typeof(win) == 'object') ? true : false;
};

function myPopWindow(windowURL, windowName, windowFeatures) {
  var defaultFeatures = {"status": 0, "toolbar": 0, "location": 0, "menubar": 0,
                         "directories": 0, "resizeable": 1, "scrollbars": 1,
                         "width": 640, "height": 480};
  var features = '';

  for (i in windowFeatures) { defaultFeatures[i] = windowFeatures[i]; }
  for (i in defaultFeatures) { features += i + '=' + defaultFeatures[i] + ','; }

  window.open(windowURL, windowName, features);
  return false;
};

function openTellWindow(o){
  return myPopWindow(o.href, "tellwin", {"resizeable": 0,"scrollbars": 0,"width": 380,"height":280});
};

function printPage(){
  window.print();
};


function initGlobal() {
//	stripeAllTables();
	stripeTableById('zebra');
};

function stripeTable(t) {
	var i, odd = true;
	for (i=0; i<t.rows.length; i++) {
		t.rows[i].className += odd ? ' odd' : ' even';
		odd = !odd;
	}
};

function stripeTableById(id) {
	var t = document.getElementById(id);
	if (t) stripeTable(t);
};

function stripeAllTables() {
	var t = document.getElementsByTagName('TABLE');
	for (var i=0; i<t.length; i++) stripeTable(t[i]);
};
	
setEvent(window,'load',initGlobal);


