// JavaScript Document
// JavaScript Document
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("#showDisclaimer").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('.bizFeatured').hide();*/
	$j('.biz1').show(100);
	$j('.biz2').hide();
	$j('.biz3').hide();
	$j('.biz4').hide();
	$j('.overlayFilterTop').hide();
	$j('dd#biz1Link').click(function(){		
		$j('dd#biz1Link').addClass('onTop');
		
		$j('dd#biz4Link').removeClass('onLast');
		$j('dd#biz2Link').removeClass('on');
		$j('dd#biz3Link').removeClass('on');
		
		$j('div.biz2').hide();
		$j('div.biz3').hide();
		$j('div.biz4').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div.biz1').show();
		$j('div.overlayFilterTop').fadeOut(500);
      return false;
    });	
	
	$j('dd#biz2Link').click(function(){   
		$j('dd#biz2Link').addClass('on');

		$j('dd#biz1Link').removeClass('onTop');
		$j('dd#biz4Link').removeClass('onLast');
		$j('dd#biz3Link').removeClass('on');
		
		$j('div.biz1').hide();
		$j('div.biz3').hide();
		$j('div.biz4').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div.biz2').show();
		$j('div.overlayFilterTop').fadeOut(500);
      return false;
    });	
	
	$j('dd#biz3Link').click(function(){		
		$j('dd#biz3Link').addClass('on');
		
		$j('dd#biz4Link').removeClass('onLast');
		$j('dd#biz2Link').removeClass('on');
		$j('dd#biz1Link').removeClass('onTop');
		
		$j('div.biz2').hide();
		$j('div.biz1').hide();
		$j('div.biz4').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div.biz3').show();
		$j('div.overlayFilterTop').fadeOut(500);
      return false;
    });	
	
	$j('dd#biz4Link').click(function(){		
		$j('dd#biz4Link').addClass('onLast');
		
		$j('dd#biz3Link').removeClass('on');
		$j('dd#biz2Link').removeClass('on');
		$j('dd#biz1Link').removeClass('onTop');
		
		$j('div.biz2').hide();
		$j('div.biz1').hide();
		$j('div.biz3').hide();
		
		$j('div.overlayFilterTop').show();		
        $j('div.biz4').show();
		$j('div.overlayFilterTop').fadeOut(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);
}	
function openPopFull(winURL) {
	closePop();
	var winOptions = 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=980,height=660';
	windowpop = window.open(winURL, 'windowpop', winOptions);
}
function chooseLogin() {
	box = document.login_select.login;
	destination = box.options[box.selectedIndex].value;
	if (destination) window.location.href = destination;
}