
var popWnd= new Array(
//        wnd,     name,      params
new Array(null,"popupWindow1","height=515,width=564,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no"),
new Array(null,"popupWindow2","height=535,width=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no"),
new Array(null,"popupWindow3", "height=540,width=790,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,left=0,top=0"),//help window
new Array(null,"popupWindowW", "height=540,width=840,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,left=0,top=0"),//atty websites PU
new Array(null,"popupWindowF","height=800,width=600,top=25,left=25,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no"),
new Array(null,"popupWindowPop","height=535,width=620,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no"),//help Popup window
new Array(null,"popupWindow4", "height=540,width=635,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,left=0,top=0"),//print windows
new Array(null,"popupWindow", "height=470,width=586,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no"),// used in atty_header.inc cons_header.inc general_header.inc
new Array(null,"popupWindowD", "height=535,width=685,resizable=yes,scrollbars=yes,toolbar=yes,location=no,menubar=no"),// used in demo (categories.html, categories3.html, categories_2.html)
new Array(null,"popupWindowE", "height=535,width=800,resizable=yes,scrollbars=yes,toolbar=yes,location=no,menubar=no"),// used in demo (PubArticleNLJ.html)
new Array(null,"popupWindowT","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=650,height=550,"),// used in demo (testimonials)
new Array(null,"popupWindowS","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=685,height=580,"),// used in press
new Array(null,"popupWindowZip", "height=480,width=630,resizable=yes,scrollbars=no,toolbar=yes,location=no,menubar=yes"), // zip-code lookup window
new Array(null,"popupWindowPrint", "height=580,width=625,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no"), // print window
//add new window definitions before lpPopupWindow (made for the optimization)
new Array(null,"popupWindow5","height=250,width=500,resizable=yes,scrollbars=no,toolbar=no,location=no,menubar=no"),
new Array(null,"lpPopupWindow","height=515,width=564,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no"),
new Array(null,"popupSplashWindow","height=600,width=800,resizable=yes,scrollbars=no,toolbar=no,location=no,menubar=no"),
new Array(null,"popupWindowAttyRequest","height=340,width=555,resizable=yes,scrollbars=no,toolbar=no,location=no,menubar=no") // window shown when attorneys want an automated email sent to a consumer
);

function CPW(name)
{
	var i=0;
	for(i=0;i<popWnd.length;i++)
	{
		if(popWnd[i][1]==name)
			break;
	}
	if(popWnd[i][0] == null || (popWnd[i][0]).closed)
	 	popWnd[i][0].close();
	popWnd[i][0]=null;
}

function CPWAll()
{
	var i=0;
	for(i=0;i<popWnd.length;i++)
	{
		if(popWnd[i][0] == null || (popWnd[i][0]).closed)
		 	popWnd[i][0].close();
		popWnd[i][0]=null;
	}
}

//open popup window
function OPW1(url,name)
{
	var i=0;
	for(i=0;i<popWnd.length;i++)
	{
		if(popWnd[i][1]==name)
			break;
	}
	if(popWnd[i][0] == null || (popWnd[i][0]).closed)
	 	popWnd[i][0]=window.open(url,popWnd[i][1],popWnd[i][2]);
	else
		popWnd[i][0].location.href=url;
	popWnd[i][0].focus();
	return popWnd[i][0];
}

function OPW(url,name)
{
	OPW1(url,name);
}

// open popup window and invokes print dialog
function OPPW(url,name){
	var w = OPW1(url,name);
	if(w!=null){
		w.print(); 
	}
}

function Go(){}

/*adds popup functionality to class "popup" when jquery is enabled*/
if(typeof(window.jQuery) != 'undefined')
{
	$(function() {	
		//set popup class to pop up	window 3
		$("a.popup").click(function(){
			OPW($(this).attr("href"),'popupWindow3');
			return false;
		});
	});
}
