var $j = jQuery.noConflict();
$j(document).ready(function() {
	$j("//a[@rel='external']").attr("target","_blank");
	// begin solution finder flyouts
	$j("div.silo").each(function(index) {
		if(index > 0) {
			/*$j(this).bind("click", function() {
				location = "#" + this.id;
			});*/
			$j(this).hover(
				function() {
					/*$j(this).trigger("click");
					$j("div.silo").each(function() {
						$j(this).find(".solFindFlyout").hide();
					});*/
					$j(this).find(".solFindFlyout").fadeIn(500);
				},
				function() {
					$j(this).find(".solFindFlyout").hide();
				}
			);
		}
	});
	
	$j(".psolLearnMore").click(function() {
		$j("#showDisclaimer").show();
		return false;
	});
	$j("#closeDisclaimer").click(function() {
		$j("#showDisclaimer").hide();
		return false;
	});
	// end psol disclaimer pop-up
	$j("#toggleLink").click(function() {
		$j("#freeDisputeContent").show();
		$j("#flashHolder").show();
		$j("#initialContent").hide();
		$j("#showDisclaimer").hide();
		return false;
	});
	$j("#toggleBack").click(function() {
		$j("#initialContent").show();
		$j("#freeDisputeContent").hide();
		$j("#flashHolder").hide();
		return false;
	});
	// end psol toggle content
	
	

	$j('.psolContent').show();
	$j('#takeCharge').show();
	$j('#protectID').hide();
	$j('#buyCar').hide();
	$j('#buyHome').hide();
	$j('#compareProdContainer').hide();
	$j('.overlayFilterTop').hide();
	
	$j('dd#protectIDLink').click(function(){   
		$j('dd#protectIDLink').addClass('on');

		$j('dd#takeChargeLink').removeClass('on');
		$j('dd#buyHomeLink').removeClass('on');
		$j('dd#buyCarLink').removeClass('on');
		$j('dd#compareProductsLink').removeClass('on');
		
		$j('div#takeCharge').hide();
		$j('div#buyCar').hide();
		$j('div#buyHome').hide();
		$j('div#compareProdContainer').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div#protectID').show();
		$j('div.overlayFilterTop').fadeOut(500);
      return false;
    });	
	
	$j('dd#takeChargeLink').click(function(){		
		$j('dd#takeChargeLink').addClass('on');
		
		$j('dd#buyHomeLink').removeClass('on');
		$j('dd#protectIDLink').removeClass('on');
		$j('dd#buyCarLink').removeClass('on');
		$j('dd#compareProductsLink').removeClass('on');
		
		$j('div#protectID').hide();
		$j('div#buyCar').hide();
		$j('div#buyHome').hide();
		$j('div#compareProdContainer').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div#takeCharge').show();
		$j('div.overlayFilterTop').fadeOut(500);
      return false;
    });	
	
	$j('dd#buyCarLink').click(function(){		
		$j('dd#buyCarLink').addClass('on');
		
		$j('dd#buyHomeLink').removeClass('on');
		$j('dd#protectIDLink').removeClass('on');
		$j('dd#takeChargeLink').removeClass('on');
		$j('dd#compareProductsLink').removeClass('on');
		
		$j('div#protectID').hide();
		$j('div#takeCharge').hide();
		$j('div#buyHome').hide();
		$j('div#compareProdContainer').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div#buyCar').show();
		$j('div.overlayFilterTop').fadeOut(500);
      return false;
    });	
	
	$j('dd#buyHomeLink').click(function(){		
		$j('dd#buyHomeLink').addClass('on');
		
		$j('dd#buyCarLink').removeClass('on');
		$j('dd#protectIDLink').removeClass('on');
		$j('dd#takeChargeLink').removeClass('on');
		$j('dd#compareProductsLink').removeClass('on');
		
		$j('div#protectID').hide();
		$j('div#takeCharge').hide();
		$j('div#buyCar').hide();
		$j('div#compareProdContainer').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div#buyHome').show();
		$j('div.overlayFilterTop').fadeOut(500);
		
      return false;
    });	
	
	$j('dd#compareProductsLink').click(function(){		
		$j('dd#compareProductsLink').addClass('on');
		
		$j('dd#buyCarLink').removeClass('on');
		$j('dd#protectIDLink').removeClass('on');
		$j('dd#takeChargeLink').removeClass('on');
		$j('dd#buyHomeLink').removeClass('on');
		
		$j('div#protectID').hide();
		$j('div#takeCharge').hide();
		$j('div#buyCar').hide();
		$j('div#buyHome').hide();
			
        $j('div#compareProdContainer').fadeIn(500);
      return false;
    }); // end PSOL NEW HOME JS
});

// function to close solution finder
function solFindClose() {
	$j("#solFind").hide();
}
function flyout2(targetID,targetChildTag,toggle,targetLevel) { target = document.getElementById(targetID); targetLink = target.getElementsByTagName("a").item(0); child = target.getElementsByTagName(targetChildTag); if(targetChildTag == "li") { loopCount = 0; loopLength = child.length; } else { loopCount = 1; loopLength = 1; } if(child != null) { for(i=loopCount;i<loopLength;i++) { if(toggle == 0){ child.item(i).style.display = "block"; if(targetLevel) { if(targetLevel == "parent") { bgColor = "#b5cfe7"; targetLink.style.color = "#333"; } else { bgColor = "#eff7ff"; } targetLink.style.backgroundColor = bgColor; } } else { child.item(i).style.display = "none"; if(targetLevel) { if(targetLevel == "parent") { targetLink.style.color = "#224f65"; } targetLink.style.backgroundColor = "#fff"; } } } } }


//Added for PPM 51728
function show_solution_finder(height,width,SWFURL,flashID,XMLUrl,solFindConfig)
{
var temp=document.getElementById('solFindFlash');
temp.innerHTML="";
var sVersion = "8";
var sBGColor = "#ffffff";
var so;

// end code to set solution finder vars
// begin init solution finder
	so = new SWFObject(SWFURL, flashID, width, height, sVersion, sBGColor, true);
	so.addParam("scale", "exactfit");
	so.addParam("wmode", "transparent");
	so.addVariable("solFindConfig","/ecm/swf/xml/" + solFindConfig + ".xml");
	so.write("solFindFlash");
// end init solution finder
document.getElementById('solFind').style.display='block';
}
//End of Addition for PPM 51728


function openPopAtTop(winURLPSOL,width,height,leftMargin) {
 var winOptionsPSOL = 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',left='+leftMargin+',screen-y='+leftMargin+',top=20,screen-x=20';
 windowpopPSOL = window.open(winURLPSOL, 'windowpopPSOL', winOptionsPSOL);
 }
 
 
 function popWinSized (winWidth, winHeight, winURL) {
 closePop();
 var winOptions = 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width='+winWidth+',height='+winHeight;
  windowpop = window.open(winURL, 'windowpop', winOptions);
}