function openByClick (url, title, caption, width, height)
{
  Lightview.show({
    href: SITE_CONTEXT+url,
    rel: 'iframe',
    title: title,
    caption: caption,
    options: {
      width: width,
      height: height,
      autosize: true,
      topclose: true
    }
  });
}

function viewBigImage(id){
  Lightview.show("<nms:base/>");
}

function evalueCkb(idDiv){
  var container = document.getElementById(idDiv);
  var sons = container.getElementsByTagName('input');
  var numCkb = sons.length;
  
  for(i=0; i<numCkb; i++){
    if (sons[i].checked){
      return true;
    }
  }
  
  return false;
}

function assignLabel(idTextToSetResult, idText, action, nameForm)
{
  parent.document.getElementById("errorHome").innerHTML = "";
  //  if (evalueCkb(idDiv)){
  var handleSuccess = function(o){
    
    if(o.responseText){
      top.document.getElementById(idTextToSetResult).value = String.trim(o.responseText);
      parent.Lightview.hide();
    }
  }

  var handleFailure = function(o){
  }

  var cb_callAjax = {
    success:handleSuccess,
    failure:handleFailure
  };
  YAHOO.util.Connect.setForm(nameForm);
  YAHOO.util.Connect.asyncRequest('POST', action, cb_callAjax);

}
function openLightViewRegistration(){
   var handleSuccess = function(o){

    if(o.responseText){
      document.getElementById("register").innerHTML = String.trim(o.responseText);
      Lightview.show({
        href:'#register',
        options: {
          width: 600,
          height: 600,
          autosize: true,
          topclose: true
        }
      });
    }


  }
  var handleFailure = function(o){
  }

  var cb_callAjax = {
    success:handleSuccess,
    failure:handleFailure
  };
  YAHOO.util.Connect.asyncRequest('POST', 'toRegistration.action', cb_callAjax);

}
