function getHTTPObject() { 
	var xmlhttp; 
	/*@cc_on @if (@_jscript_version >= 5) 
		try { 
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
		} 
		catch (e) { 
			try { 
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			} catch (E) { 
				xmlhttp = false; } 
			} @else xmlhttp = false; 
	@end @*/  
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
		try { 
			xmlhttp = new XMLHttpRequest(); 
		} catch (e) { 
			xmlhttp = false; 
		} 
	} 
	return xmlhttp; 
} 

function select(mselect, mvalue)
{
	for(var i=0; i< mselect.options.length; i++)
	{
		if (mselect.options[i].value == mvalue)
		{
			mselect.selectedIndex = i ; 
		}
	}
}

function LaunchPopup(url) {
	window.open(url, 'popup', 'width=600, height=600, top=' + ((screen.height - 600)/2) + ', left=' + ((screen.width - 600)/2) )
	return false;
}

function M_setTimeOut(code, time) {
	timers[timers.length] = setTimeout(code, time);
}

function clearTimers() {
	for(i = 0; i < timers.length; i++) {
		clearTimeout(timers[i]);	
	}	
	timers.length = 0;
}

function delay(interval) {
	var then , now;
	then = new Date().getTime();
	now = then;
	while(now - then < 1000*interval) {
		now = new Date().getTime();	
	}	
}

function changeOpac(id, opacity) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function opacity(id, opacStart, opacEnd, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;

    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            if (i == opacEnd) M_setTimeOut("changeOpac('" + id + "'," + i + ")",(timer * speed));
            else M_setTimeOut("changeOpac('" + id + "'," + i + ")",(timer * speed));
            timer++;
        }
        
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            if (i == opacEnd) M_setTimeOut("changeOpac('" + id + "'," + i + ")",(timer * speed));
            else M_setTimeOut("changeOpac('" + id + "'," + i + ")",(timer * speed));
            timer++;
        }
        
    }
    document.getElementById(id).currentOpacity = opacEnd;
} 

function popup(url, width, height) {
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2;
	window.open(url, 'popup', 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left + ", resizable=yes");
	return false;
}

function popupscroll(url, width, height) {
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2;
	window.open(url, 'popup', 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left + ', scrollbars=yes, resizable=yes');
	return false;
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE");
   var version = parseFloat(arVersion[1]);
   try {
   if ((version >= 5.5) && (document.body.filters) && version < 7)
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i];
         var imgName = img.src.toUpperCase();
         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;
         }
      }
   }
   } catch(e) {}
}

