/* formexp.js compiled from X 4.0 with XC 0.27b. Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */
var xMac='';
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();

if(window.opera){
	var i=xUA.indexOf('opera');
	if(i!=-1){
		var v=parseInt(xUA.charAt(i+6));
		xOp7Up=v>=7;
		xOp6Dn=v<7;
	}
}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
	xIE4Up=parseFloat(navigator.appVersion)>=4;
	xIE4=xUA.indexOf('msie 4')!=-1;
	xIE5=xUA.indexOf('msie 5')!=-1;
}else if(document.layers){
	xNN4=true;
}

xMac=xUA.indexOf('mac')!=-1;

function xDef(){
	for(var i=0; i<arguments.length; ++i){
		if(typeof(arguments[i])=='undefined') return false;
	}
	return true;
}

function xDisplay(e,s){
	if(!(e=xGetElementById(e))) return null;
	if(e.style && xDef(e.style.display)) {
		if (xStr(s)) e.style.display = s;
		return e.style.display;
	}
	return null;
}

function xGetElementById(e){
	if(typeof(e)!='string') return e;
	if(document.getElementById) e=document.getElementById(e);
	else
	if(document.all) e=document.all[e];
	else e=null;
	return e;
}

function xStr(s){
	for(var i=0; i<arguments.length; ++i){
		if(typeof(arguments[i])!='string') return false;
	}
	return true;
}
/* FIN DE formexp.js */

// http://www.faqts.com/knowledge_base/view.phtml/aid/2147
function getStyleClass (className)
{
  var s;
  var r;

  if (document.styleSheets == null)
    return null;

  if (document.all ) {
    for (s = 0; s < document.styleSheets.length; s++)
      for (r = 0; r < document.styleSheets[s].rules.length; r++)
        if (document.styleSheets[s].rules[r].selectorText == className)
          return document.styleSheets[s].rules[r].style;
  }
  else if (document.getElementById) {
    for (s = 0; s < document.styleSheets.length; s++)
      for (r = 0; r < document.styleSheets[s].cssRules.length; r++)
        if (document.styleSheets[s].cssRules[r].selectorText == className)
          return document.styleSheets[s].cssRules[r].style;
  }
  return null;
}

// personales alberto morales
function switchStyleClass (className)
{
    var o = getStyleClass(className);
    if (o == null)
        return
    else if (o.display == 'none')
        o.display = 'block';
    else
        o.display = 'none';
}

function xDisplaySw(b, id)
{
    if (b) xDisplay(id,'block'); else xDisplay(id,'none');
}

function xDisplayDonante()
{
	var i;
    i = xGetElementById('dat_recog');
    xDisplaySw(i.checked,'recog');

    i = xGetElementById('dat_mat');
    xDisplaySw(i.checked,'mat');

    i = xGetElementById('dat_comment');
    xDisplaySw(i.checked,'comment');

    i = xGetElementById('recog_envio');
    xDisplaySw(!i.checked,'llevan');
    xDisplaySw(i.checked,'traen');
}

function xDisplayReceptor()
{
	var i;
    i = xGetElementById('dat_recog');
    xDisplaySw(i.checked,'recog');

    i = xGetElementById('dat_comment');
    xDisplaySw(i.checked,'comment');
}
