function subMenuShow(id) {

    var sMenu = document.getElementById('submenu' + id);
    sMenu.style.visibility = 'visible';
    var sLink = document.getElementById('link' + id);
    sLink.style.background = '#D1E1ED';

}

function subMenuHide(id) {
    var sMenu = document.getElementById('submenu' + id);
    sMenu.style.visibility = 'hidden';
    var sLink = document.getElementById('link' + id);
    sLink.style.background = 'none';

}

function LoadCalendar(date) {


	var req = new JsHttpRequest();
	req.onreadystatechange = function() {
			if (req.readyState == 4) {

           			document.getElementById("calendar").innerHTML = req.responseJS.calendar;
			}
		}

	req.open(null, "/jslib/calendar.php", true);
	req.send( {date: date} );
}

function DisplayFlashVideo(path, width, height, wmode, flvars){

    text = "<object type=\"application/x-shockwave-flash\" data=\""+path+"\" width=\""+width+"\" height=\""+height+"\" wmode=\""+wmode+"\" quality=\"high\" flashvars=\""+flvars+"\">\r\n";
    text += "<param name=\"movie\"	value=\""+path+"\" />\r\n";
    text += "<param name=\"wmode\" value=\""+wmode+"\" />\r\n";
    text += "<param name=\"quality\" value=\"high\" />\r\n";
    text += "<param name=\"width\" value=\""+width+"\" />\r\n";
    text += "<param name=\"height\" value=\""+height+"\" />\r\n";
    text += "<param name=\"flashvars\" value=\""+flvars+"\" />\r\n";

    text += "</object>";
    document.write(text);
}

function DisplayFlash(path, width, height, wmode){

    text = "<object type=\"application/x-shockwave-flash\" data=\""+path+"\" width=\""+width+"\" height=\""+height+"\" wmode=\""+wmode+"\" quality=\"high\" allowScriptAccess=\"always\">\r\n";
    text += "<param name=\"movie\"	value=\""+path+"\" />\r\n";
    text += "<param name=\"wmode\" value=\""+wmode+"\" />\r\n";
    text += "<param name=\"quality\" value=\"high\" />\r\n";
    text += "<param name=\"allowScriptAccess\" value=\"always\" />\r\n";    
    text += "<param name=\"width\" value=\""+width+"\" />\r\n";
    text += "<param name=\"height\" value=\""+height+"\" />\r\n";
    text += "</object>";
    document.write(text);
}

function getPoints(pointsData) {	
	//alert(parseInt(pointsData));
	ShowRegion((parseInt(pointsData)+4040));
}

function openWind(url,width,height) {
      number = Math.round(Math.random() * 100000000);
      auxWnd = window.open(url, 'newWindow_' + number,'width=' + width + ',height=' + height + ',resizable=yes,scrollprint=yes,toolbar=no,menubar=no,location=no,status=no,directories=no,copyhistory=no,left=0,top=0');
}

function ShowRegion(item) {
	openWind("/structure.php?id="+item, 500, 500);
	return false;
}

