function getQuerystring(key, default_) {
    if (default_ == null) default_ = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if (qs == null)
        return default_;
    else
        return qs[1];
}

// perform JavaScript after the document is scriptable.
$(function() {
    //left menu tabs
    $("#left-tab ul.tabs").tabs("#left-tab div.panes > div", { event: 'mouseover' });
    $("#left-tab div.panes").corner("bottom");
    $("#left-tab ul.tabs li a").corner("top 8px");


    //top & left menu tabs slides
    $("#top-nav ul.tabs").tabs("#top-nav div.panes > div", { event: 'mouseover' });
    $("#sub-podcast ul").hide();


    if (window.location.href.indexOf('Application_Management', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-1").slideDown(); }
    else if (window.location.href.indexOf('Business_Intelligence', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-2").slideDown(); }
    else if (window.location.href.indexOf('Human_Capital_Management', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-3").slideDown(); }
    else if (window.location.href.indexOf('IT_Service_Management', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-4").slideDown(); }
    else if (window.location.href.indexOf('Security_Compliance', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-5").slideDown(); }
    else if (window.location.href.indexOf('Strategic_Sourcing', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-6").slideDown(); }
    else if (window.location.href.indexOf('Unified_Communications_Collaboration', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-7").slideDown(); }
    else if (window.location.href.indexOf('special-focus-enterprise-search', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-8").slideDown(); }
    else if (window.location.href.indexOf('Virtualization_Cloud', 0) > 0)
    { $("#sub-podcast ul#sub-podcast-9").slideDown(); }
    else
    { $("#sub-podcast ul:first").slideDown(); }

   


    $("#sub-podcast h5").hoverIntent(function() {
        $("#sub-podcast ul").slideUp("fast");
        $(this).next().slideDown("fast");
    }, function() {
    });

    $("#top-nav #podcast li").hoverIntent(function() {
        index = $(this).attr('id');
        $("#sub-podcast ul").slideUp("fast");
        $("#sub-podcast ul#sub-" + index).slideDown("fast");
    }, function() {
    });

    //right fadein fadeout
    $('ul#analysts').innerfade({
        speed: 1000,
        timeout: 6000
    });

    //level2banner fadein fadeout
    $('ul#level2topcontainer').innerfade({
        speed: 1000,
        timeout: 5000
    });

    //sectiontext fadein fadeout
    $('ul#sectiontext').innerfade({
        speed: 1000,
        timeout: 5000
    });

    //bottom flow
    $("div.scrollable").scrollable({
        size: 4,
        interval: 2000,
        clickable: false,
        loop: true,
        speed: 600
    });




    /*$("div.scrollable div a img").reflect({height: 0.5, opacity: 0.6});*/
});

//!--$(function() {		
//var api = $("div.imageflow").scrollable({size:3, api:true});//
//api.move(1, function(){$("div.imageflow div img").eq(1).animate({width: 113, left: 19});
//});

//		api.onBeforeSeek(function() {
//			this.getItems().fadeTo(300, 0.5);
						
//			$("div.imageflow div img").eq(this.getIndex()).animate({width: 80, left: 35
//			}, 'slow');

//		});
//		api.onSeek(function() {
//			this.getItems().fadeTo(300, 1);
			
//			$("div.imageflow div img").eq(this.getIndex()).animate({width: 113, left: 19}, 'slow');
//		});	

//});//