<!--

var isIe6 = false;

function fixIe6Png(w) {

	if(isIe6 && document.getElementById(w)) {
		try {
			var pngObj = document.getElementById(w);
			pngObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + pngObj.src + "', sizingMethod='scale')";
			pngObj.src = '/esp/img/1x1.gif';
		} catch(e) {
			// nothing
		}
	}

}

// --------------------------------------------------------------------------

function MD_err(msg, url, line) {
	try {	
		if(url.toLowerCase().indexOf('http://localhost') == -1 && url.toLowerCase().indexOf('http://192.') == -1) {
			var MD_ErrImg = new Image();
			//MD_ErrImg.src = '/do/jslogger/default.aspx?msg='+escape(msg)+'&url='+escape(url)+'&line='+escape(line);
			return true;
		} else {
			alert('JS Exception:\n' + msg + '\n' + url + '\n' + line)
		}
	} catch(e) {
		// nothing
	}	
}

window.onerror = MD_err;

// --------------------------------------------------------------------------

function MD_Void() {
	return;
}

// --------------------------------------------------------------------------

function MD_OpenWin(theURL, winName, features) {
	window.open(theURL, winName, features);
}

// --------------------------------------------------------------------------

function startPrint() {
	window.print();
}

// --------------------------------------------------------------------------

function MD_WFlash(fileUrl, divDestination, sizeX, sizeY, useWmode) {

	var swfHtml;
	swfHtml = '';
	swfHtml += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + sizeX + '" height="' + sizeY + '">';
	swfHtml += '<param name="movie" value="' + fileUrl + '">';
	swfHtml += '<param name="quality" value="high">';

	if(useWmode) {
		swfHtml += '<param name="wmode" value="transparent">';
	}

	if(useWmode) {
		swfHtml += '<embed src="' + fileUrl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + sizeX + '" height="' + sizeY + '" wmode="transparent">';
	} else {
		swfHtml += '<embed src="' + fileUrl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + sizeX + '" height="' + sizeY + '">';
	}	
		
	swfHtml += '</embed></object>';

	if(document.getElementById(divDestination)) {
		document.getElementById(divDestination).innerHTML = swfHtml;
	} else {
		document.write(swfHtml);
	}

}

// --------------------------------------------------------------------------

var MD_MouseScrollWheelH = {
	dx : null,
	init : function() {	
		if (window.addEventListener) {
		window.addEventListener("DOMMouseScroll", this.mouseScroll, false);
		} else document.attachEvent("onmousewheel", this.mouseScroll); 
	},
	mouseScroll : function(e) {
		if (!e) var e = window.event;
		if (e.wheelDelta <= 0 || e.detail>=0){  
		window.scrollBy(80,MD_GetClientScroll()[1]);
		} else  window.scrollBy(-80,MD_GetClientScroll()[1]) ; 
	},	
	arrowScroll: function(val) {
		if(val==1) {
			window.scrollBy(70,MD_GetClientScroll()[1]);
		} else {
			window.scrollBy(-70,MD_GetClientScroll()[1])
		}
	}
}

// --------------------------------------------------------------------------

function MD_ElementOpacity(el_id, opacity) { 
    var elStyle = document.getElementById(el_id).style; 
	try {
		if(opacity != 100) {
			elStyle.opacity = (opacity / 100);
			elStyle.MozOpacity = (opacity / 100);
			elStyle.KhtmlOpacity = (opacity / 100);
			elStyle.filter = 'alpha(opacity=' + opacity + ')';
		} else {
			elStyle.opacity = '';
			elStyle.MozOpacity = '';
			elStyle.KhtmlOpacity = '';
			elStyle.filter = '';
		}
	} catch(e) {
		// nothing
	}
} 

function MD_CursorMouse() {
	var posx = 0;
	var posy = 0;
	var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	return [posx, posy];
}

function MD_ElementPos(el) {

	var elxpos = 0;
	var elypos = 0;

	try {
		var elx = el;
		while(elx.offsetParent) {  
			elxpos += elx.offsetLeft;    
			elx = elx.offsetParent;
		}
	} catch(ex) {
		elxpos = 0;
	}
	
	try {
		var elx = el;
		while(elx.offsetParent) {  
			elypos += elx.offsetTop;    
			elx = elx.offsetParent;
		}
	} catch(ex) {
		elypos = 0;
	}
	
	if(elxpos < 0) { elxpos = 0; }
	if(elypos < 0) { elypos = 0; }	
	return [elxpos, elypos];
	
}

function MD_ElementDimension(el) {

	var elwidth = 0;
	var elheight = 0;

	try {
		if(el.offsetWidth) {
			elwidth = el.offsetWidth;
		}
	} catch(ex) {
		elwidth = 0;
	}
	
	try {
		if(el.offsetHeight) {
			elheight = el.offsetHeight;
		}
	} catch(ex) {
		elheight = 0;
	}
	
	if(elwidth < 0) { elwidth = 0; }
	if(elheight < 0) { elheight = 0; }	
	return [elwidth, elheight];
	
}

function MD_GetClientSize() {

	var clwidth = 0;
	var clheight = 0;

	try {
		if(typeof(window.innerWidth) == 'number') {
			clwidth = window.innerWidth;
			clheight = window.innerHeight;
		} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			clwidth = document.documentElement.clientWidth;
			clheight = document.documentElement.clientHeight;
		} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
			clwidth = document.body.clientWidth;
			clheight = document.body.clientHeight;
		}
	} catch(ex) {
		clwidth = 0;
		clheight = 0;
	}
	
	if(clwidth < 0) { clwidth = 0; }
	if(clheight < 0) { clheight = 0; }	
	return [clwidth, clheight];
	
}

function MD_GetClientScroll() {

	var scrX = 0;
	var scrY = 0;
	
	try {
		if(typeof(window.pageYOffset) == 'number') {
			scrY = window.pageYOffset;
			scrX = window.pageXOffset;
		} else if( document.body && (document.body.scrollLeft || document.body.scrollTop)) {
			scrY = document.body.scrollTop;
			scrX = document.body.scrollLeft;
		} else if( document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
			scrY = document.documentElement.scrollTop;
			scrX = document.documentElement.scrollLeft;
		}
	} catch(ex) {
		scrX = 0;
		scrY = 0;	
	}

	if(scrX < 0) { scrX = 0; }
	if(scrY < 0) { scrY = 0; }	
	return [scrX, scrY];
	
}

// --------------------------------------------------------------------------

function MD_GetHttpObj(textMode) {
	try {	
		var returnObj;
		if(window.XMLHttpRequest) { 
			returnObj = new XMLHttpRequest();
			if (returnObj.overrideMimeType) {
				if(textMode) {
					returnObj.overrideMimeType('text/plain');
				} else {
					returnObj.overrideMimeType('text/xml');
				}
			}
		} else if(window.ActiveXObject) {
			try {
				returnObj = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				try {
					returnObj = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
	} catch(e) {
		returnObj = false;
	}	
	return returnObj;
}

// --------------------------------------------------------------------------

function MD_BKPage() {
	if (window.sidebar && window.sidebar.addPanel) { 
		window.sidebar.addPanel(document.title, location.href,''); 
	} else if(window.external) {
		window.external.AddFavorite(location.href, document.title);
	} else {
		alert('Su navegador no soporta esta opción. Por favor realícela manualmente.');
	}
}

// --------------------------------------------------------------------------

function MD_InsertMailLink(p1, p2, htmlTemplate) {

	var emx;
	var atchar;
	atchar = '@';
	emx = p1 + atchar + p2;
	
	var genx;
	if(htmlTemplate.indexOf('$emx_here$') == -1) {
		window.status = 'htmlTemplate doesn\'t containe $emx_here$.';
	} else {
		genx = htmlTemplate.replace(/\$emx_here\$/g, emx);
	}

	document.write(genx);
	
}

// --------------------------------------------------------------------------

function MD_GCookie(cn) {
	var start = document.cookie.indexOf(cn + '=');
	var len = start + cn.length + 1;
	if((!start) && (cn != document.cookie.substring(0, cn.length))) return null;
	if(start == -1) return null;
	var end = document.cookie.indexOf(';', len);
	if(end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
}

function MD_SCookie(cn, cv, cp, cex, cd, cs) {
	var today = new Date();
	today.setTime(today.getTime());
	if (cex) cex = cex * 1000;
	var ex_date = new Date(today.getTime() + (cex));
	document.cookie = cn+'='+escape(cv) +
		((cex) ? ';expires='+ex_date.toGMTString() : '') +
		((cp) ? ';path=' + cp : '') +
		((cd) ? ';domain=' + cd : '') +
		((cs) ? ';secure' : '');
}

function MD_DCookie(cn, cp, cd) {
	if(_agbm_ckG(cn)) {
		document.cookie = cn + '=' +
			((cp) ? ';path=' + cp : '') +
			((cd) ? ';domain=' + cd : '') +
			';expires=Thu, 01-Jan-1970 00:00:01 GMT';
	}
}

function MD_DyToSec(dy) {
	return dy * 60 * 60 * 24;
}

function MD_MnToSec(mn) {
	return mn * 60;
}

// --------------------------------------------------------------------------

function MD_ToggleActiveStyleSheet(ttl) {

	var i;
	var c;

	for(i=0; (c = document.getElementsByTagName("link")[i]); i++) {
		if(c.getAttribute("rel").indexOf("style") != -1 && c.getAttribute("title")) {
			c.disabled = true;
			if(c.getAttribute("title") == ttl) {
				c.disabled = false;
			}
		}
	}
	
}

// --------------------------------------------------------------------------

function MD_SSValidatorMessage(whatMessage) {
	alert(whatMessage);
}

// --------------------------------------------------------------------------

function MD_InputFocus(src, whatAct) {
	if(whatAct == 0) { src.style.backgroundColor = '#FFEFE8';src.style.borderColor = '#FF6600';src.style.borderWidth = '2px';src.style.margin = '0px'; }
	if(whatAct == 1) { src.style.backgroundColor = '';src.style.borderColor = '';src.style.borderWidth = '1px';src.style.margin = '1px'; }
}

// --------------------------------------------------------------------------

-->