function validateForm(msg, fields, fields_names)
    {
	var fields = fields.split("|");
	var fields_names = fields_names.split("|");
	for(i = 0; i < fields.length; i++){
		var x=fields[i];
	document.getElementById(x).style.background = ''; 
	if (document.getElementById(x).value == "") {
		document.getElementById(x).style.background = 'Cornsilk'; 
		document.getElementById(x).focus()
	    alert("" + msg + " ('" + fields_names[i] + "')");
		 return false;
		}
	}
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}



startList = function() {

	// code for IE
var ver = getInternetExplorerVersion();
if ( ver < 7 ) {


	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
}
window.onload=startList;


//ADD BOOKMARK

function addBookmark(title,url) {
		if (window.sidebar) {
		    window.sidebar.addPanel(title, url,"");
		} else if( document.all ) {
		    window.external.AddFavorite( url, title);
		} else if( window.opera && window.print ) {
		    return true;
		}
	}
	
	

// PRINT
function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

//CENTERED WINDOW
function openCenteredWindow(url, w, h) {
	var screenWidth  = screen.availWidth;
   	var screenHeight = screen.availHeight;

	var left = (screenWidth - w)/2;
	var top = (screenHeight - h)/2;

	var winName = Math.round(Math.random() * 10000000);

	window.open(url,winName,"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h+",left="+left+",top="+top)
}
function openCenteredFlash(url, width, height, title) {
			var screenWidth  = screen.availWidth;
			var screenHeight = screen.availHeight;
			var left = (screenWidth - width)/2;
			var top = (screenHeight - height)/2;
			si_window=window.open('', "_blank", "width="+width+", height="+height+",left="+left+",top="+top);
			si_window.document.open();
			si_window.document.writeln('<html><head><title>' + title + '</title>');
			si_window.document.writeln('<style type="text/css" media="screen">');
			si_window.document.writeln('<!--');
			si_window.document.writeln('  body { margin: 0px; padding: 0px; }');
			si_window.document.writeln('-->');
			si_window.document.writeln('</style>');
			si_window.document.writeln('</head><body">');
			si_window.document.writeln('<object width="' + width + '" height="' + height + '"><param name="movie" value="' + url + '"></param><param name="wmode"></param><embed src="' + url + '" type="application/x-shockwave-flash" wmode="transparent" width="' + width + '" height="' + height + '"></embed></object>');
			si_window.document.writeln('</body></html>');
			si_window.document.close();
}


function show(itemID,srcID) {
	el = document.getElementById(itemID);
	if (el) {
		el.style.visibility = 'visible';
		el.style.display = 'block';
	}
		if (srcID)
		{
			el2.src='images/hide.gif';
		}
}

function hide(itemID,srcID) {
	el = document.getElementById(itemID);
	if (el) {	
		el.style.visibility = 'hidden';
		el.style.display = 'none';
	}
			if (srcID)
		{
		el2.src='images/show.gif';
		}
}
