var bodyWidth;
var bodyHeight;
var btnColor;
var locate = document.location.search;
var start = locate.indexOf("?") + 3;
var end = locate.lastIndexOf("&");
var aIdVal = locate.substring(start, end);
var scrollVal = locate.substring(7);

function onInit()
{	
	if (!document.getElementById("dynamicFeatures") && !document.getElementById("health_spotlight"))
	{
		$("#main_content").children("div").filter(".hrShadow").show();
	}

	if(typeof sIFR == "function"){
		/* General Page */
		sIFR.replaceElement(named({sSelector:".globaltitle .interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:".globaltitle .mayfield", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/mayfield.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:".mayfield", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/mayfield.swf", sColor:"#0078c1" }));
		/* Online Claims */
		sIFR.replaceElement(named({sSelector:".mymbf_content h2 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:".mymbf_content h3 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:".mymbf_content h4 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:".mymbf_tools h3 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:".mymbf_tools h4 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:".globaltitle .interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:"#main_content h3.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:"#main_content legend .interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));



	}
	
	bodyWidth = document.body.scrollWidth;
	bodyHeight = document.body.scrollHeight + 768;
	
	/* DynaCloud */
	if($.cookie('dynacloud')) {
		$("div").filter("#dynacloud").show();
	} else {
		$("div").filter("#dynacloud").hide();
	}
	
	/* Overlay */
	$("div").filter(".pop-overlay").width(bodyWidth);
	$("div").filter(".pop-overlay").height(bodyHeight);
	$("div").filter(".pop-overlay").css("opacity", 0);
	$("div").filter(".pop-overlay").hide();
	
	/* Load message */
	if ($("div").filter(".pop-message"))
	{
		$("div").filter(".pop-message").css("opacity", 0);
	}
	
	/* Input Reset */
	$("input:text").focus(resetTxt);
	$("input:password").focus(resetTxt);
	
	$("input").filter(".btn").hover(function(){
		btnColor = $(this).css("background-color");
		$(this).css("background-color","#00A9E4");
	 },function(){
		$(this).css("background-color",btnColor);
	 });
	
	/*  Global Navigation */
	$("#mbfNav").children("dd").children("ul").hide();
	$("#mbfNav").children("dd").mouseover(showNav);
	$("#mbfNav").children("dd").mouseout(hideNav);
	
	$(function() {		
		// modify global settings
		$.extend($.fn.Tooltip.defaults, {
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - "
		});
		
		$('a.tooltip').Tooltip();
	});
	
	//memberCare Search
	$("div").filter("#tabbedNav").width(580);
	
	//myMBF login global function popup
//	if($("a").filter(".epi-link1").html() == "Login"){
//		$("a").filter(".epi-link1").attr("href","javascript://");
//		$("a").filter(".epi-link1").html("Login to myMBF");
		//alert($("a").filter(".epi-link1").html());
//	}
	
//	$("a").filter(".epi-link1").click(function(){
//		if($("a").filter(".epi-link1").html() != "Logout"){
//			loadmyMBFlogin();
//		}
//	});
	
	$("#loginFormSubmit").children("input").click(function(){
		$("#loginFormSubmit").children("input").width("90px");
		$("#loginFormSubmit").children("input").val("Loading...");
		//$("#loginFormSubmit").children("input").attr("disabled", "disabled");
	});
	
	$("#hiddencopy").hide();
	$("#hiddencopyBtn").click(showForm);	
	
	/*
	$(".mymbf_content a:eq(2)").click(function(){
		showOverlaySelfService();												 
	});
	*/
}

function showForm()
{
	$("#defaultcopy").hide();
	$("#hiddencopy").slideDown();
}

function loadDivinfo(ld)
{
	$(".pop").filter("#"+ld).prepend("<div class='pop-close'><a href='javascript://' onClick='hideDivinfo();'>close window x</a></div>");
	showOverlay();
	$(".pop").filter("#"+ld).css("left",(bodyWidth/2)-($("#"+ld).width()/2));
	$(".pop").filter("#"+ld).fadeTo("slow", 1);
	$(".pop").filter("#"+ld).show();
}

function hideDivinfo()
{
	hideOverlay();
	$(".pop").fadeTo("slow", 0, function(){$(".pop").hide();});
}

function loadMessage(message)
{
	showOverlay();
	
	$("div").filter(".pop-overlay").css("z-index","99998");
	
	if (message != '' || message != null) 
	{
		$("div").filter(".pop-message").html(message);
	}

	$("div").filter(".pop-message").show();
	$("div").filter(".pop-message").css("left",(bodyWidth/2-($("div").filter(".pop-message").width())/2));
	$("div").filter(".pop-message").hide();
	$("div").filter(".pop-message").fadeTo("slow", 1);
}

function hideMessage()
{
	$("div").filter(".pop-message").fadeTo("fast", 0, function(){$("div").filter(".pop-message").hide();});
	hideOverlay();
}

function loadmyMBFlogin(ld)
{
	var geturl = 'https://'+window.location.hostname;
	showOverlay();
	$("div").filter(".pop").width(510);
	$("div").filter(".pop").html("<script language='JavaScript' type='text/javascript'>function submitlogin(){document.frmLogin.username.value = document.frmLogin.usernamefix.value + 'a'; return true;}</script><h3>Login to myMBf</h3><fieldset class='pop_login'><div id='loginControl'><form action='"+geturl+"/ICSLogin/auth-up' method='post' enctype='application/x-www-form-urlencoded' name='frmLogin' onsubmit='return submitlogin()'><input type='hidden' value='default' name='context'><input type='hidden' name='username'><fieldset id='loginForm' style='padding: 5px 0 0 0 !important;'><p>Please log In</p><label for=''><input type='text' value='Username' name='usernamefix' /></label><label for=''><input type='password' name='password' /></label><div id='loginFormSubmit'><input type='submit' value='Login' class='btn'></div><INPUT TYPE='hidden' NAME='proxypath' VALUE='reverse'><INPUT TYPE='hidden' NAME='url' SIZE='40' VALUE='"+geturl+"/myMBF'><a href='/passwordreminder' class='link'>Forgotten password or username?</a></fieldset></form><h2><img src='/MBFSystem/Images/health/h_mymbf.gif' alt='mymbf'></h2><ul id='myMBFsummary'><li>Access Member Self Service</li><li>Get your tax statements</li><li>Check your cover</li><li>Make an extras claim online</li></ul><div id='myMBFRegister'><a href='/HealthInsurance/Memberbenefits/myMBF/Register' class='btn' style='width: 90px;'>Register now</a></div><a href='/HealthInsurance/Memberbenefits/AboutmyMBF' class='link'>More about our new myMBF</a></div></div></div></fieldset>");
	$("div").filter(".pop").prepend("<div class='pop-close'><a href='javascript://' onClick='hidemyMBFlogin()'>close window x</a></div>");
	$("div").filter(".pop").show();
	$("div").filter(".pop").css("left",(bodyWidth/2)-($(".pop").width()/2));
	$("div").filter(".pop").hide();
	$("div").filter(".pop").fadeTo("slow", 1);
	
	$(".pop_login fieldset#loginForm").children("label").children("input:password").focus(function()
	{
		if ( $(this).val() == "") $(this).css("background-image","");
	});
	
	$(".pop_login fieldset#loginForm").children("label").children("input:password").blur(function()
	{
		if ( $(this).val() == "") $(this).css("background-image","url(/MBFSystem/Images/misc/password_img.gif)");
	});
	
	$(".pop_login fieldset#loginForm").children("label").children("input:text").focus(function()
	{
		if ( $(this).val() == "Username" || $(this).val() == "Login" ) $(this).val("");
	});
	
	$(".pop_login fieldset#loginForm").children("label").children("input:text").blur(function()
	{
		if ( $(this).val() == "" ) $(this).val("Username");
	});
	
	if ($(".pop_login fieldset#loginForm").children("label").children("input:password").val() == '') $(".pop_login fieldset#loginForm").children("label").children("input:password").css("background-image","url(/MBFSystem/Images/misc/password_img.gif)");
}

function hidemyMBFlogin()
{
	hideOverlay();
	$("div").filter(".pop").fadeTo("slow", 0, function(){$("div").filter(".pop").hide();});
}

function showOverlay()
{
	$("select").hide();
	$("div").filter(".pop-overlay").fadeTo("slow", 0.6);
}

function hideOverlay()
{
	$("div").filter(".pop-overlay").fadeTo("fast", 0, function(){$("div").filter(".pop-overlay").hide();})
	$("select").show();
}

function showOverlaySelfService()
{	
	$("div.mymbf_content:eq(0)").attr("id","self_service");
	position = document.getElementById("self_service");
	x = findPosX(position);
	y = findPosY(position);
	w = $("#self_service").width();
	h = $("#self_service").height();
	$("div").filter(".pop-overlay").css("top", y-5);
	$("div").filter(".pop-overlay").css("left", x+15);
	$("div").filter(".pop-overlay").width(w-40);
	$("div").filter(".pop-overlay").height(h);
	$("div").filter(".pop-overlay").css("background-color","#ffffff");
	$("div").filter(".pop-overlay").css("border","5px solid #e3e3e3");
	$("div").filter(".pop-overlay").html("<div class='loadingimage'><img src='/MBFSystem/Images/misc/icon_loading.gif' alt='Loading...' width='32' height='32'><br>Loading...</div>");
	$(".loadingimage").css("top", h/2 - 71);
	$(".loadingimage").css("left", w/2 - 71);
	$(".loadingimage").css("opacity", 0.6);
	$("div").filter(".pop-overlay").fadeTo("fast", 0.8);
}

function hideOverlaySelfService()
{
	$("div").filter(".pop-overlay").fadeTo("slow", 0, function(){
		$("div").filter(".pop-overlay").css("top", 0);
		$("div").filter(".pop-overlay").css("left", 0);
		$("div").filter(".pop-overlay").css("background-color","#000000");
		$("div").filter(".pop-overlay").css("border","none");
		$("div").filter(".pop-overlay").width(bodyWidth);
		$("div").filter(".pop-overlay").height(bodyHeight);
		$("div").filter(".pop-overlay").css("opacity", 0);
		$("div").filter(".pop-overlay").html("");
		$("div").filter(".pop-overlay").hide();
	});
}

function findPosX(obj) {
    var curleft = 0;
    if (obj.offsetParent) {
        while (1) {
            curleft+=obj.offsetLeft;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.x) {
        curleft+=obj.x;
    }
    return curleft;
}

function findPosY(obj) {
    var curtop = 0;
    if (obj.offsetParent) {
        while (1) {
            curtop+=obj.offsetTop;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.y) {
        curtop+=obj.y;
    }
    return curtop;
}

function showNav()
{
	$(this).children("a").addClass("over");
	$(this).children("ul").css("opacity",0.95);
	$(this).children("ul").show();
}

function hideNav()
{
	$(this).children("a").removeClass("over");
	$(this).children("ul").hide();
}

function resetTxt()
{
	$(this).select();
}

function getHostName()
{
  return location.protocol + "//" + location.hostname;
}

// FUNCTION: 	printStyles()
// AUTHOR:   	George Hiley (Eclipse, 28.06.07)
// PURPOSE:  	This function has been added to work around limitations with Vignette.  The function
// 						traverses the DOM and finds specific elements which are used as locators / indicators that then
//						enable the script to add classes to certain elements (like the left hand column) so that when
//						the page is printed, these elements can be hidden.  Vignette would not allow us to add
//						a class to certain table cells that need to be hidden when printing.
function printStyles()
{
	var LEFT_COLUMN_WIDTH = "190";
	
	// Left Column:	Find span.leftcoltd then find the parent TD that has a width of LEFT_COLUMN_WIDTH, add class="leftColTD" to it.
	var node = $("span.leftcoltd");
	for (var i = 0; i < 50; i++)	// Test 50 times, if not then end as assume element doesn't exist
	{
		if ($(node).is("TD") && $(node).attr("width") == LEFT_COLUMN_WIDTH)
		{
				$(node).addClass("leftColTD");
				break;
		} else {
			// Not a TD or is not the correct TD so get the next one.
			node = $(node).parents("td");
		}
	}
}

// Wellness Articles
if(scrollVal == "y")
{
	//alert(scrollVal);
	var t=setTimeout("showArticle("+aIdVal+",'"+scrollVal+"')",2000);
}

function showArticle(a,s)
{
	//alert(a);
	$("ul").filter("#articles"+a).slideDown("slow",function(){ 
																if(s == "y"){
																	$("#a"+a).ScrollTo(1500);
																	var y = "n";
																}
																$("span").filter("#hidelabel"+a).show();
															});
	$("span").filter("#showlabel"+a).hide();
}

function hideArticle(b)
{
	//alert(b);
	$("ul").filter("#articles"+b).slideUp("slow",function(){
														  	  $("span").filter("#hidelabel"+b).hide();
															  $("span").filter("#showlabel"+b).show();
															});
}

function scrolling(c)
{
	//alert(c);
	$(c).ScrollTo(1500);
}

/************* Online Healp Bubble - Start *******************/
//Used to destroy the popup div container
//Also removes the iframe hack for ie6.

function findTrueOffset(elem, offSet) {
	offSet[0] += elem.offsetTop;
	offSet[1] += elem.offsetLeft;
	if (elem.offsetParent != null) {
		findTrueOffset(elem.offsetParent, offSet);
	}
}

function hidePopup() {

	var myObj = document.getElementById('pop-up-helpinner');
	if (myObj) document.body.removeChild(myObj);
	var myFrameObj = document.getElementById('popup-iframe');
	if (myFrameObj) myFrameObj.parentNode.removeChild(myFrameObj);
}

//Wrapper function allows for custom div html to be passed.
//Patter to be used for future development.
function showPopupBottom(evt) {
	var divHTML = new Array();
	divHTML[0] = "<div id='pop-top'></div><div id='pop-middle'><div id='popup-copy' style=''>";
	divHTML[1] = "<div id='definition'></div></div></div><div id='pop-bottom' style=''></div>";
	showPopup(evt, divHTML, "bottom");
}

//Wrapper function allows for custom div html to be passed.
//Patter to be used for future development.
function showPopupRight(evt) {
	var divHTML = new Array();
	divHTML[0] = "<div id='pop-top-right'></div><div id='pop-middle-right'><div id='popup-copy-right' style=''>";
	divHTML[1] = "<div id='definition'></div></div></div><div id='pop-bottom-right' style=''></div>";
	showPopup(evt, divHTML, "right");
}

//Sets the background color of the definition text to grey on show
//Replaces the bottom image with a grey version to match the above background color change
function changeDefbgGrey()
{
	$("#definition").css("background-color","#f3f3f3");
	$("#pop-bottom").css({ backgroundImage: "url(/MBFSystem/Images/help/balloon-bottom-line-grey.png)"});
}

//Changes the background color of the definition text to white on hide
//Replaces the bottom image with the original white version
function changeDefbgWhite()
{
	$("#definition").css("background-color","#ffffff");
	$("#pop-bottom").css({ backgroundImage: "url(/MBFSystem/Images/help/balloon-bottom-line.png)"});
}

function showPopup(evt, divHTML, orientation) {
	//Removes Popup if somehow used by other system.
	var myObj = document.getElementById('pop-up-helpinner');
	if (myObj) myObj.parentNode.removeChild(myObj);

	//Tracking down the correct event model.
    evt = (evt) ? evt : ((window.event) ? window.event : "")
    if (evt) {
        var elem
        if (evt.target) {
            elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target
        } else {
            elem = evt.srcElement
        }
        if (elem) {
			//Allow the popup to be hidden when clicking on anything.
			document.body.onclick = hidePopup;

			//Look for any associated help text and inject necessary behaviour and copy.
			var finalHelpText = "" + setupDefinition(helpText[elem.id]);
			if (finalHelpText != "undefined") {

				//Create popup container
				var newdiv = document.createElement('div');

				var divIdName = 'pop-up-help';
				newdiv.setAttribute('id',divIdName + 'inner');
				
				var offSet = new Array();
				offSet[0] = 0;
				offSet[1] = 0;
				
				findTrueOffset(elem, offSet);
				
				//Inject the help copy
				newdiv.innerHTML = divHTML[0] + finalHelpText + divHTML[1];
				
				var newObj = document.body.appendChild(newdiv);
				
				newObj.style.display = "none";

				newObj.style.position = "absolute";
				newObj.style.zIndex = "5";
				

				if (orientation == "right") {
					newObj.style.top = offSet[0] - Math.round(elem.offsetHeight /2) - 20 + "px";
					newObj.style.left = offSet[1] + elem.offsetWidth + 5 + "px";							
				} else {
					newObj.style.top = offSet[0] + elem.offsetHeight + 0 + "px";
					newObj.style.left = offSet[1] + Math.round(elem.offsetWidth /2) - 123 + "px";
				}
				
				newObj.style.cursor = "pointer";

				newObj.style.display = "";

				if (isIE6()) {

					//Used to overlay div's on top of windows elements such as select drop downs.
					//Not tested bit it should work with any windows object (flash, video etc...)
					newObj.insertAdjacentHTML("afterEnd", "<IFRAME style='position:absolute;z-index:4;' src='javascript:false;' frameBorder='0' scrolling='no' id='popup-iframe' />");
					var iFrame = document.getElementById('popup-iframe');
					iFrame.style.left =  newObj.style.left;
					iFrame.style.top = newObj.style.top;
					
					iFrame.style.width =newObj.offsetWidth + 'px';
					
					iFrame.style.height =newObj.offsetHeight + 'px';
					iFrame.style.visibility = 'visible';
					iFrame.style.filter = '(alpha=90)';
	
				}
				
			}
        }
    }
}

function setupDefinition(str) {
	//Looks for any help definitions and inserts extended definition
	//terms and description.
	for (var i in defText) {
		var findExp = new RegExp(i,"gi");
		if (!(typeof(str) == "undefined"))
			str = str.replace(findExp, "<span onmouseover=\"$('#definition').toggle(); changeDefbgGrey(); document.getElementById('definition').innerHTML='<b>" + i + ":&nbsp;</b><p>"+ defText[i] + "</p>';reSizeiFrame();\" onmouseout=\"$('#definition').toggle(); changeDefbgWhite(); document.getElementById('definition').innerHTML='';reSizeiFrame();\"><b>" + i + "</b></span>")
	}
	return (str);
}

function reSizeiFrame() {
	if (isIE6()) {

		//While we are already hacking ie 6 to show div's over windows object
		//We might as well do it properly.
		//If the help div is resized this will keep the iframe in proportion.
		var newObj = document.getElementById('pop-up-helpinner');
		var iFrame = document.getElementById('popup-iframe');		
		iFrame.style.width =newObj.offsetWidth + 'px';
		
		iFrame.style.height =newObj.offsetHeight + 'px';
		iFrame.style.visibility = 'visible';
	
	}
}

function isIE6() {
	var appVer = navigator.appVersion.toLowerCase();

	var iePos = appVer.indexOf('msie');

	if (iePos !=-1) {

		var is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));

		var is_major = parseInt(is_minor);
	
		if (is_major <= 6) {
			return true;
		} else {
			return false;
		}
		
	} else {
	
		return false;
	}
}

function isIE() {
	var appVer = navigator.appVersion.toLowerCase();

	var iePos = appVer.indexOf('msie');

	if (iePos !=-1) {
		return true;
		
	} else {
	
		return false;
	}
}
/************* Online Healp Bubble - End *******************/

/************* Online Claims JQuery effects for provider search and field highlights - Start *******************/
function replaceClassForId(id, clsRem, clsAdd) {
	var currId = eval("$('#"+id+"')");
	var chk = "div[@class='"+clsRem+"']";
	currId.find("td").each(
		function() {
		  $(this).find(chk).removeClass(clsRem).addClass(clsAdd);
		  $(this).removeClass("over");
		});
}

function replaceClassForElement(el, clsRem, clsAdd) {
  $(el).find("div").removeClass(clsRem).addClass(clsAdd);
}

function highlight(elem) {
  $(elem).fadeTo("slow", 0.33).fadeTo("fast", 1.0);
}

function onResultClick(elem) {
  $(elem).addClass("over");
}

function beforeQuickSearch() {
  $("div").filter("#previous-providers").slideUp("slow");
  $("div").filter("#previous-providers-link").show();
  $("div").filter("#results-table").show();
  $("div").filter("#search-results").show();
  $("div").filter("#results").hide();
  $("div").filter("#loading-results-table").show();
  $("div").filter("#error-panel").hide();
}

function onProviderScreenLoad() {
  $("div").filter("#search-results").slideUp();
  $("div").filter("#loading-results-table").hide();
  $("div").filter("#search-results").hide();

  //$("div").filter("#advancedSearch").slideUp();
  $("div").filter("#results-table").slideUp();
  $("div").filter("#select-providers").slideUp();
  //$("div").filter("#advancedSearch").slideUp();
  $("div").filter("#results-table").slideUp();
  $("div").filter("#select-providers").slideUp();
  //$("div").filter("#advancedSearch").hide();
  $("div").filter("#results-table").hide();
  $("div").filter("#select-providers").hide();
  //$("div").filter("#advancedSearch").hide();
  $("div").filter("#results-table").hide();
  $("div").filter("#select-providers").hide();
  $("div").filter("#loading-results-table").hide();
  $("div").filter("#error-panel").hide();
  $("div").filter("#previous-providers-link").hide();
}

function beforeAdvancedSearch() {
  $("div").filter("#previous-providers").hide("slow");
  $("div").filter("#previous-providers-link").show();
  $("div").filter("#select-providers").slideDown("slow");
  $("div").filter("#checkbox").removeClass("neoCheck_checked");
  $("div").filter("#checkbox").addClass("neoCheck");

  $("div").filter("#results-table").show();
  $("div").filter("#search-results").show();
  $("div").filter("#loading-results-table").show();
  $("div").filter("#results").hide();

  $("div").filter("#error-panel").hide();
}

function toggleAdvancedSearch() {
  $("div").filter("#results-table").hide("slow");
  $("div").filter("#advancedSearch").toggle("slow");
}

function togglePreviousProviders() {
  $("div").filter("#loading-results-table").hide();
  $("div").filter("#results").hide();
  $("div").filter("#search-results").hide();
  $("div").filter("#results-table").hide();
  $("div").filter("#previous-providers").show();
  $("div").filter("#previous-providers-link").slideUp();
}

function showProviderErrorPanel() {
  $("div").filter("#loading-results-table").hide();
  $("div").filter("#results").hide();
  $("div").filter("#search-results").hide();
  $("div").filter("#results-table").hide();
  $("div").filter("#error-panel").slideDown("slow");
}

function showProviderResult() {
  $("div").filter("#loading-results-table").hide();
  $("div").filter("#results").slideDown("slow");
  $("td").filter("#selected").addClass("over");	
  $("div").filter("#error-panel").hide();
}

/************* Online Claims JQuery effects for provider search and field highlights - End *******************/

function doSifr() {
	if(typeof sIFR == "function"){
/* Online Claims */
		sIFR.replaceElement(named({sSelector:".mymbf_content h2 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:".mymbf_content h3 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:".mymbf_content h4 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:".mymbf_tools h3 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:".mymbf_tools h4 span.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:".globaltitle .interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#ffffff" }));
		sIFR.replaceElement(named({sSelector:"#main_content h3.interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
		sIFR.replaceElement(named({sSelector:"#main_content legend .interstate", sWmode:"transparent", sFlashSrc:getHostName() + "/MBFSystem/Flashfiles/interstate.swf", sColor:"#0078c1" }));
	}
}

$(document).ready(printStyles);
$(document).ready(onInit);