// JavaScript Document



//OPEN LEGAL WINDOWS

function openLegal(whichFile){

	legalWindow = window.open (whichFile, "PinkStinkerLegal","location=0,status=0,scrollbars=1,width=600");

}

//CLOSE LEGAL WINDOWS AND REDIRECT TO CLICKED LINK

function closeLegal(whichFile){

		window.opener.location=whichFile;
		window.close();
}

var qa;



//PRINT IFRAMES - FAQ

function CheckIsIE() 

{ 

	if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;} 

	else { return false; } 

} 

function printIframe(){

	if (CheckIsIE() == true) 

	{ 

		window.frames['printMe'].focus(); 

		window.frames['printMe'].print();  

	} 

	else 

	{ 

		var iframe = document.frames ? document.frames['printMe'] : document.getElementById('printMe');

		var ifWin = iframe.contentWindow || iframe;

		ifWin.printPage();

	} 



 

}



/*

function printIframe(id)

{

    var iframe = document.frames ? document.frames[id] : document.getElementById(id);

    var ifWin = iframe.contentWindow || iframe;

    ifWin.printPage();

}

*/





$(document).ready(function(){

			

	//FAQ EXPANDO COLLAPSO	

	for(i=1; i<=qa; i++){

		$("#q"+i).click(function(){

			var thisDiv = $(this).attr("id");

			thisDiv = thisDiv.substr(1);

			$("#a"+thisDiv).slideToggle("normal");

		});

		$("#a"+i).slideToggle(0);

	}

	

	$("#expandAll").click(function(){

		var divsOff = 0;

		var divsOn = 0;

		for(i=1; i<=qa; i++){

			if($("#a"+i).css("display")=="none"){

				divsOff++;

			}else{

				divsOn++;	

			}

		}	



		if(divsOff==qa || divsOn==qa){

			for(i=1; i<=qa; i++){

				$("#a"+i).slideToggle("normal");

			}

			$("#returnTop").toggle();	

		}else{

			for(i=1; i<=qa; i++){

				if($("#a"+i).css("display")=="none"){

					$("#a"+i).slideToggle("normal");

				}

			}

		}

	});	

	



});


