

// <summary>
// Global function calls,
// </summary>
var AppPath="/";
function ExecuteHandler(){
 $(document).ready(function(){
	 AssignCSSSelectors();
	 AssignLinks();
	 //InitializeMenu("Navigation");
 });
}

// <summary>
//  This function to attach non-ie css selectors to the html elements
// </summary>
function AssignCSSSelectors()
{
if(jQuery.browser.msie){
 $("li:first-child").addClass("FirstChild");
 $("li:last-child").addClass("LastChild");
 $("td:last").addClass("LastChild");
 $("tr:first").addClass("FirstChild");
}
}

// <summary>
//  This function to assign target blank to the external link. html target blank is not a standard w3c validated code. insted of using target="_blank" we use rel="external" and replace the rel with javascript.
// </summary>
function AssignLinks()
{
 $("a[rel='external']").attr("target","_blank");
 $("a[href='#']").click(function(){
  return false;
 });
}


function ToggleContent(){
// $("#Sponsorship li:first .Copy").show();
// $("#Sponsorship li:first h3").addClass("Active");
 $("#Sponsorship h3").click(function(){
  $("#Sponsorship li .Copy").hide();
   if ($(this).hasClass("Active")){
	$(this).parent().find(".Copy").hide();
	$(this).removeClass("Active");
   }
   else{
	$(this).parent().find(".Copy").show();
	$("#Sponsorship li h3").removeClass("Active");
	$(this).addClass("Active");
   }
 });
}

// <summary>
//  Setting the dropdown Navigation
// </summary>

function InitializeMenu(ParentId){
	$("#"+ParentId +" li").hover(
		function(){
			if (!$(this).hasClass("Highlight")){
				$(this).addClass("Active");
				if ($(this).find("img").length>0){ //if the navigation is image links
				 ImgSrc = $(this).find("img").attr("src").replace(".gif","Active.gif");
				 $(this).find("img").attr("src",ImgSrc);
				}
		}
	},
	function(){
		if (!$(this).hasClass("Highlight")){
			$(this).removeClass("Active");
			if ($(this).find("img").length>0){ //if the navigation is image links
			ImgSrc = $(this).find("img").attr("src").replace("Active.gif",".gif");
			$(this).find("img").attr("src",ImgSrc);
			}
		}
	});
}