	var warningMsg = "Los datos que no haya grabado se perderán.";

	function warningSave(msg) {
		if (msg!='') event.returnValue = msg;
    warningMsg = '';
	}

	function setImage(imageSelect) {
	 theImageIndex = imageSelect.options[imageSelect.selectedIndex].value;
	 if (document.images)
	     document.images[0].src = eval("img" + theImageIndex);
	  }

	function newWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}

	var expdate = new Date ();
	expdate.setTime (expdate.getTime() + (365 * 24 * 60 * 60 * 1000));//1 año mas desde ahora

	function setCookie (name,value,expires,path,domain,secure) {
		document.cookie = name + "=" + escape (value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	}

	function getCookie (name) {
	  var arg = name + "=";
	  var alen = arg.length;
	  var clen = document.cookie.length;
	  var i = 0;
	  while (i < clen) {
	    var j = i + alen;
	    if (document.cookie.substring(i, j) == arg)
	      return getCookieVal (j);
	    i = document.cookie.indexOf(" ", i) + 1;
	    if (i == 0) break; 
	  }
	  return "block";
	}
	
	
	function HabDesChat() {
		if (document.all('radChat')[1].checked) {
			window.frames('ifraChat').location.href = 'chat_back_iframe.asp?ChatDeshab=1';
			document.all('hidChatDeshab').value = 1;
		} else {
			window.frames('ifraChat').location.href = 'chat_back_iframe.asp?ChatDeshab=0';
			document.all('hidChatDeshab').value = 0;
		}
	}
	
	function getCookieVal (offset) {
	  var endstr = document.cookie.indexOf (";", offset);
	 	if (endstr == -1) endstr = document.cookie.length;
	 	return unescape(document.cookie.substring(offset, endstr));
	}

  function mOvr(src) {
    if (!src.contains(event.fromElement)) {
	  src.style.cursor = 'hand';
		}
  }

  function mOut(src) {
		if (!src.contains(event.toElement)) {
	  	src.style.cursor = 'default';
		}
  }

  function mClk(src) {
    if(event.srcElement.tagName=='TD'){
	  src.children.tags('A')[0].click();
    }
  }

  function display(elementId) {
	oObject	= document.all(elementId);
  	if (oObject.style.display=='none') {
  		oObject.style.display='block';
  	} else {
  		oObject.style.display='none';
  	}
 		setCookie(elementId,oObject.style.display,expdate,'/',null,false);		
  }

	function preload(imgObj,imgSrc) {
		if (document.images) {
			eval(imgObj+' = new Image()')
			eval(imgObj+'.src = "'+imgSrc+'"')
		}
	}
	
	function AdaptarTamanoVentana () {
		document.body.height=document.body.scrollHeight;
		document.body.width=document.body.scrollWidth;
	}