﻿

$(document).ready(function()
{
  $.ajax({
    type: "GET",
    url: "../../xml.xml",
    dataType: "xml",
    success: parseXml
  });
});




function parseXml(xml)
{
//print the date followed by the title of each tutorial
$(xml).find("Tutorial").each(function()
{
    
     for(var i=1;i<=8;i++)
     {
      $('#menu'+i).append($(this).find('News'+i).text());
     }
     
  
        for(var i=1;i<=8;i++)
        {
         
           $('#menu'+i).hide();

        }

});

}

function getbrowser()
{
//   jQuery.each(jQuery.browser, function(i, val) {
//      $("<div>" + i + " : <span>" + val + "</span>")
//                .appendTo(document.body);
                
                if(jQuery.browser.msie==true &&(jQuery.browser.version=='6.0') )
                {
                //alert("IE "+ jQuery.browser.version);
                $(".SUB").addClass("tstIE");
                
                $(".SUBabout").addClass("tstIEabout");

                
//                $("#mmain").addClass("mmainIE");
//                $("#welcome").addClass("welcomeIE");
                }
                else if(jQuery.browser.msie==true &&(jQuery.browser.version=='7.0'))
                {
                 $(".SUB").addClass("tstIE7");
                
                $(".SUBabout").addClass("tstIEabout7");
                }

                
                else
                {
                //alert ("Moz");
                $(".SUB").addClass("tstIEOther");
                 $(".SUBabout").addClass("tstIEOtherAbout");
//                $("#mmain").addClass("mmainMoz");
//                $("#welcome").addClass("welcomeMoz");
                }
                
                
    jQuery.each(jQuery.browser, function(i, val) {
   if(i=="mozilla" && jQuery.browser.version.substr(0,3)=="1.9")
    //  alert("Do stuff for firefox 3")
      
                      $(".SUB").addClass("tstMoz");
                 $(".SUBabout").addClass("tstMozabout");
 });
                
                
}


function image(div,img)
    {
    document.getElementById(div).src=img;
    }
    
    function changeimage(div,img)
    {
    document.getElementById(div).src=img;
    }

function show(div)
{
//$('#'+div).show('slow');

for(var i=1;i<=8;i++)
{
  if(('#menu'+i)!=('#'+div))
  {
   $('#menu'+i).hide();
   }
   else
   {
   $('#'+div).show('slow');
   }
}

}

function hideout(div)
{
//$('#'+div).show('slow');

for(var i=1;i<=8;i++)
{
  if(('#menu'+i)=('#'+div))
  {
   $('#menu'+i).show('slow');
   }
   else
   {
   $('#'+div).hide();
   }
}

}

function showtd(div)
{
//$('#'+div).show('slow');

for(var i=1;i<=8;i++)
{
  if(('#td'+i)!=('#'+div))
  {
   $('#td'+i).hide();
   }
   else
   {
   $('#'+div).show('slow');
   }
}

}

function hide()
{

for(var i=0;i<=8;i++)
{
   $('#'+'menu'+i).hide('fast');
}

}

function hideTD(Div)
{


for(var i=0;i<=8;i++)
{
  if(('#menu'+i)!=('#'+Div))
  {
   $('#'+'menu'+i).hide('fast');
   }

}

}


//function show2()
//{
//$(".tst2").show('slow');
//}

//function hide2()
//{
//$(".tst2").hide('slow');
//}

function empty(control)
{
document.getElementById(control).value='';
}

function bigger()
{
$(".big").show();
}


function h()
{
 $(".big").hide();
}


