 
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

	//open menu with given ID
	function openMenu(menuID,linkObj)
	{
		//if the menu code is ready
		if(um.ready)
		{
			//find co-ordinates of link object
			var coords = {
				'x' : um.getRealPosition(linkObj,'x'),
				'y' : um.getRealPosition(linkObj,'y')
				};
	
			//increase y-position to place it below the link
			coords.y += (linkObj.offsetHeight + 9);
			coords.x = coords.x + 0;
	
			//activate menu at returned co-ordinates
			um.activateMenu(menuID, coords.x + 'px', coords.y + 'px');
		}
	}
	
	//close menu with given ID
	function closeMenu(menuID)
	{
		//if the menu code is ready
		if(um.ready)
		{
			//deactive menu
			um.deactivateMenu(menuID);
		}
	}
	
	function swapImage(_which, _id)
	{
		document.getElementById(_id).src = _which;
		//alert(captionInner)
	}
	
	function swapData(_which, _id)
	{
		document.getElementById(_id).src = _which;
		//alert(captionInner)
	}


function newWindow(fileName,winName) {
	window.open(fileName,winName,'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,hotkeys=no,width=625,height=400');
}

function getselmonth ( selectedmonth, selectedyear )
{
  document.calendar.SelMonth.value = selectedmonth ;
  document.calendar.SelYear.value = selectedyear ;
  document.calendar.submit() ;
}

function fnLoadPngs() {
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (var i = document.all.length - 1, obj = null; (obj = document.all[i]); i--) {
		if (itsAllGood && obj.currentStyle.backgroundImage.match(/\.png/i) != null) {
			this.fnFixPng(obj);
			//alert(obj.outerHTML);
		}
	}
}
function fnFixPng(obj) {
	var bg	= obj.currentStyle.backgroundImage;
	var src = bg.substring(5,bg.length-2);
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
	obj.style.backgroundImage = "none";
}
function enableAlphaImages(){
for(var i=0; i<document.images.length; i++){
      var img = document.images[i]
      var imgName = img.src.toLowerCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "png"){
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML;
         i = i-1;
      }
   }
}
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer") {
	fnLoadPngs()
	var png_trans = window.attachEvent("onload", enableAlphaImages);
}

