﻿$(function() 
{ 
    //$('#divaccordion .body').hide();
    var tabstr = window.location.search.substring(1).split('&');
    for( i=0; i<tabstr.length; i++)
    {
        if(tabstr[i].search(/t/i) != -1)
        {
            var arrtab = tabstr[i].split('=');
            $('#divaccordion').find('.menubody:visible').slideUp(500);
            $('.menubody_' + arrtab[1] + ':hidden').slideDown(500);
            break;
        }
    }
    $('#divaccordion .invisible').live("click",
        function() 
        { 
            var index = $(this).attr('rel');
            $('#divaccordion').find('.menubody:visible').slideUp(500);
            $('.menubody_' + index + ':hidden').slideDown(500);
        }
    );
});

function GetViewPort()
{
     var viewportwidth;
     var viewportheight;
     var arr = new Array(2)
     // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
     
     if (typeof window.innerWidth != 'undefined')
     {
          viewportwidth = window.innerWidth,
          viewportheight = window.innerHeight
     }
     
    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

     else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
     {
           viewportwidth = document.documentElement.clientWidth,
           viewportheight = document.documentElement.clientHeight
     }
     
     // older versions of IE
     
     else
     {
           viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
           viewportheight = document.getElementsByTagName('body')[0].clientHeight
     }
     arr[0] = viewportheight;
     arr[1] = viewportwidth;
     
     return arr;
 }


