
    function $(id) {

          if (document.getElementById)
               return document.getElementById(id)
          else if (document.all)
               return document.all[id]
    }
function getPage(Curl,area,tobj)
{
        advAJAX.get({
            url : Curl+"&ax=1",
            uniqueParameter: "custom_unique_param",

            onInitialization : function() {

              $(area).innerHTML = '<img src="images/ajax-loader.gif">';

            },
            onSuccess : function(obj) {

                loadPage(obj.responseText,area,tobj);
            },
            onFinalization : function() {

             // showSmiley(ev,'uForm');
             }

        });

}
function loadPage(response,area,tobj)
{
var list=tobj.parentNode.parentNode.getElementsByTagName("li");

for (var i=0; i<list.length; i++) list[i].className="";
   tobj.parentNode.className="selected";

   $("contenttab").innerHTML = response;

}
function startMain()
{


     var ulobj= $(arguments[0]);

     var list=ulobj.getElementsByTagName("li");

     for(var x=0; x<list.length; x++)
     {
        var listlink=list[x].getElementsByTagName("a")[0];
        if (listlink.getAttribute("rel"))
        {
         var url=listlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/");
         listlink.setAttribute("href", url);
         
         if(x == arguments[1])listlink.parentNode.className="selected";
         else listlink.parentNode.className="";
           listlink.onclick=function()
           {
             getPage(this.getAttribute("href"), this.getAttribute("rel"), this)

             return false
           }
        }


   }
}
function checkMain()
{

     var ulobj= $(arguments[0]);

     if(ulobj)
     {
       var list=ulobj.getElementsByTagName("li");
      for(var x=0; x<list.length; x++)
      {
        var listlink=list[x].getElementsByTagName("a")[0];
        if (listlink.getAttribute("rel"))
        {
        // var url=listlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/");
        // listlink.setAttribute("href", url);
         if(x == arguments[1])listlink.parentNode.className="selected";
           listlink.onclick=function()
           {
             getJsPage( this);

             return false
           }
        }

     }
   }
}
function getJsPage(tobj)
{
var list=tobj.parentNode.parentNode.getElementsByTagName("li");

for (var i=0; i<list.length; i++)
{
  list[i].className="";
  var listlink=list[i].getElementsByTagName("a")[0]
  if((elem=$(listlink.getAttribute("rel")))) elem.style.display = 'none';
}
   tobj.parentNode.className="selected";

  if($(tobj.rel)) $(tobj.rel).style.display = 'block';

}
