//Global Variables
PortalPath = "/Portals/5";

// Forms and Page Elements Handling
jQuery(document).ready(function() {
	if (jQuery("#LoginForm").length > 0) {
		jQuery("#LoginForm").wrapInner('<form action="https://oss.ticketmaster.com/cgi/request.cgi" method="post" name="formLogin" id="formLogin"></form>');
	}
	if (jQuery("#SearchCommunity").length > 0) {
		jQuery("#SearchCommunity").wrapInner('<form enctype="application/x-www-form-urlencoded" action="http://community.blueshirtsunited.com/service/searchEverything.kickAction?as=20434" method="get"></form>');
	}
	
	if (jQuery(".ad_block").length > 0) {
		var adBlockHTML = jQuery("#adBlockGenerator").children(":not(script)");
		jQuery(".ad_block").html(adBlockHTML);
	}
	else {
		jQuery("#adBlockGenerator").remove();
	}

	if (currentPage == "fancommunity") {
		jQuery(".msg_network_bar").show();
		jQuery(".homelink").remove();
		jQuery("#dnn_LeftPane").add("#dnn_RightPane").addClass("content_bg");
	}
	else {
		jQuery(".msg_network_bar").remove();
	}
	
	//Member Flash Video
	if (jQuery("#flashSS").length > 0) {
		var so = new SWFObject(PortalPath+'/swf/slideShowBSU.swf','slide','610','340','8');
		var dataURL;
		so.addParam('wmode','transparent');
		so.addParam('allowscriptaccess','always');
		switch(currentPage) {
			case "fanaticsclub":
				dataURL = PortalPath+"/data/slideShowFanatics.xml";
				break;
			case "captainsclub":
				dataURL = PortalPath+"/data/slideShowCaptains.xml";
				break;
			case "legendsclub":
				dataURL = PortalPath+"/data/slideShowLegends.xml";
				break;
		}
		if (dataURL) {
			so.addVariable("DataUrl", dataURL);
			so.write('flashSS');
		}
	}
	
	jQuery("div.scrollable").scrollable();
	
	jQuery(".wrap-overlay img[rel]").overlay();

});




// Custom Functions
function openPopup(target, width, height, top, left)
{
 var properties = "status=no,location=no,toolbar=no,directories=no,resizable=yes,width=" +width+ ",height=" +height+", top=" +top+ ", left=" +left;
 window.open(target, "", properties);
}


