/********************************************************************************************/
/* AHAH functions by Phil Ballard                                                           */
/* This code is intended for study purposes.                                                */
/* You may use these functions as you wish, for commercial or non-commercial applications,  */
/* but please note that the author offers no guarantees to their usefulness, suitability or */
/* correctness, and accepts no liability for any losses caused by their use.                */
/********************************************************************************************/

function callAHAH(url, pageElement, callMessage, errorMessage) {
     document.getElementById(pageElement).innerHTML = callMessage;
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */
         } catch (E) {
          req = false;
         } 
       } 
     }
     req.onreadystatechange = function() {responseAHAH(pageElement, errorMessage);
     };
     
     req.open("GET",url,true);
     req.send(null); 
  }

function responseAHAH(pageElement, errorMessage) {
   var output = '';
   if(req.readyState == 4) {
      if(req.status == 200) {
         output = req.responseText;
         document.getElementById(pageElement).innerHTML = output;
         } else {
         document.getElementById(pageElement).innerHTML = errorMessage+"\n"+output;
         }
         ScrollLoad ('scrollholder', 'scroll', true);
         defBG();
          $(document).ready(function(){
                $(".thumbs img").fadeTo("fast", 0.7); 
                $(".thumbs img").hover(function(){
                    $(this).fadeTo("fast", 1.0); 
                },function(){
                    $(this).fadeTo("fast", 0.7); 
                });
            });
          $(document).ready(function() {
    $("#nav-shadow li").append('<img class="shadow" src="media/main/icons-shadow.png" width="81" height="27" alt="" />');
    $("#nav-shadow li").hover(function() {
	    var e = this;
	$(e).find("a").stop().animate({ marginTop: "-14px" }, 250, function() {
	    $(e).find("a").animate({ marginTop: "-10px" }, 250);
	});
	$(e).find("img.shadow").stop().animate({ width: "80%", height: "20px", marginLeft: "8px"}, 250);
    },function(){
	    var e = this;
	$(e).find("a").stop().animate({ marginTop: "4px" }, 250, function() {
	    $(e).find("a").animate({ marginTop: "0px" }, 250);
	});
	$(e).find("img.shadow").stop().animate({ width: "100%", height: "27px", marginLeft: "0" }, 250);
    });
});
      }
  }
