/***
 * Initialize some necessary variables and events
 **/

/* Global value with $CONF['SITE'] string */
//var CONF_SITE = "";

/** 
 * @param node - the DOM node.
 * @return - The node owned text.
 */
function getNodeText(node) {
  var childs = node.childNodes;
  var result = "";

  for (var i = 0; i < childs.length; i++) {
    var next = childs.item(i);

    if (next.data) {
      result = result + next.data;
    }
  }

  return result;
} /* End of 'getNodeText' function */

function ParseXml(xml)
{  
  if (jQuery.browser.msie)
  {  
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");  
    xmlDoc.loadXML(xml);  
    xml = xmlDoc;  
  }  
  return xml;  
}

$(document).ready(function()
{
  /* Adjust ajax loaders */
  $("#form_Feedback_AjaxLoader").bind("ajaxSend", function(){
     $(this).show();
   }).bind("ajaxComplete", function(){
     $(this).hide();
   }
  );
  $("#form_Consult_AjaxLoader").bind("ajaxSend", function(){
      $(this).show();
    }).bind("ajaxComplete", function(){
      $(this).hide();
    }
  );
  $("#form_Order_AjaxLoader").bind("ajaxSend", function(){
      $(this).show();
    }).bind("ajaxComplete", function(){
      $(this).hide();
    }
  );
  /* Initialize image viewer */
  $("a[rel^='prettyPhoto']").prettyPhoto({
      animationSpeed: 'normal', 
      padding: 40, 
      opacity: 0.35, 
      showTitle: false, 
      showDescr: false, 
      allowresize: true, 
      theme: 'dark_square'  
  });
});

