// Fraud Center JavaScript Document

google.load("search", "1", "nocss");

function LoadNewsBar1() {
  var root = document.getElementById("NewsCol1");
  var options = {
      linkTarget : GSearch.LINK_TARGET_BLANK,
      largeResultSet : true,
      resultStyle : GSnewsBar.RESULT_STYLE_EXPANDED,
      title : "Workers' Compensation Fraud",
      autoExecuteList : {
        executeList : ["Workers Compensation Fraud"]
        }
      };
  var newsBar = new GSnewsBar(root, options);
}

function LoadNewsBar2() {
  var root = document.getElementById("NewsCol2");
  var options = {
      linkTarget : GSearch.LINK_TARGET_BLANK,
      largeResultSet : true,
      resultStyle : GSnewsBar.RESULT_STYLE_EXPANDED,
      title : "Employee Fraud",
      autoExecuteList : {
        executeList : ["Employee Fraud"]
        }
      };
  var newsBar = new GSnewsBar(root, options);
}

google.setOnLoadCallback(LoadNewsBar1);

google.setOnLoadCallback(LoadNewsBar2);


$(function(){	
	$("#IntroMore").hide();
	$("#IntroMoreLink").toggle(
	function(){
			$("#IntroMore").show("blind", {}, 500);
			$("#IntroMoreLink").text("Close Additional");
		},
	function(){
			$("#IntroMore").hide("blind",{},500);
			$("#IntroMoreLink").text("Continue Reading");
		}
	);
	
	$("#FraudVideo").tabs();
	$("#TipsNews").tabs();	
	
	var i = $("#tabs-1a").width();
	var num = parseFloat(i,10);
	var p = num-313;
	var l = p/2;
	$("#tabs-1a img").css("margin-left",l);	
	
	$(window).resize(function(){
		var i=$("#tabs-1a").width();
		var num = parseFloat(i,10);
		var p = num-313;
		var l = p/2;
		$("#tabs-1a img").css("margin-left",l);
	});	
	
	HideReplay();
	
	x=(false /*@cc_on || true @*/) && (document.implementation != null) && (document.implementation.hasFeature != null) && (window.XMLHttpRequest == null);
	
	if(!x){                                     //x detects IE6 using Conditional Compilation (only used in JScript). The animation caused problems in IE6.
	setTimeout(function(){FadeInAd()},1000);
	
	setTimeout(function(){ExplodeAd()},8000);
	
	setInterval(function(){
		ResetAd();
		setTimeout(function(){
			ExplodeAd();					
		},10000)					 
	},120000);
	}
	
	else{
		$("#PRS_Ad").show();
		$("#AdMain, #AdLeftSide, #AdRightSide").css("display","none")
	}
	
	$("#PRS_Ad").click(function(){
		GoRecovery();	
	});
	
	$("#Replay").click(function(){
		RePlayAd();	
	});
	
	function RePlayAd(){
		ResetAd();
		setTimeout(function(){
		ExplodeAd();					
		},5000)	
	};
	
	function FadeInAd(){
		$("#PRS_Ad, #RePlay_Go").fadeIn(3000);
	};
	
	function ExplodeAd(){
		$("#AdRightSide, #AdLeftSide, #AdMain").hide("explode", 1500);	
		setTimeout(function(){ShowReplay()},1700);
	};
	
	function ResetAd(){
		HideReplay();
		$("#AdRightSide, #AdLeftSide, #AdMain").fadeIn(1500);
	};
	
	function GoRecovery(){window.location = "PremiumRecovery_1.html"};
	
	function HideReplay(){
		$("#Replay").hide();	
	};
	
	function ShowReplay(){
		$("#Replay").show();	
	};

});

/*
	$(window).resize(function(){
		var i = $("#FraudAd").width();
		console.log(i);
	});	
*/