var newWin = null; 
function popUp(strURL, strType, strHeight, strWidth) { 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
 if (strType=="console") 
   strOptions="resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="toolbar,menubar,scrollbars,"+ 
     "resizable,location,height="+ 
     strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}






function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*  Create a global variable for the pop-up window name so that it can be
referenced by other functions as/if needed.  */

var windowName

/* We like to reuse code and often place our pop-up files in a separate folder. Here we simply create a folder name variable   */

var folderName ="popups"
	
/* Here is the function which creates the pop-up window  */

function selectPopUpWindow(filename) {

/* The destination variable below is only used to concatenate the pop-up folder name with the file name so the script knows where to look for the files.  The "filename" is passed as a parameter from within the statement that calls the function.*/ 

	var destination = folderName + "/" + filename;

/* To make sure the correct parameters are being passed I sometimes use a JavaScript alert function to display information. I left this one here to demonstrate its use and commented it out of the script.   */

	//alert(destination);

/* On the left side of the equation below we use a variable to create the window. However, the name of the window which appears as the second parameter in the open() method, is required to identify  the pop-up window for closing and for passing data. Do not use spaces in this name or you will get script errors. 

The first attribute is the URL of the file to be opened in the window. In the example below "destination" is already a string value and there is no need to put it in quotes. However, when placing a URL directly in the method, use quotes.

The third parameter is a string of attributes describing the Window. 
Is it resizable? Does it have scrollbars? Where it is positioned, and how big it is?  These are only a few of the possible attributes.  */

windowName = window.open(destination, "windowName", "resizable, scrollbars=yes, top=20, left=20, width=350, height=600");

/*  In case the window is hidden we use the focus() method to bring it to the front.  */

	windowName.focus()
}

/*  The close function,  shown below, checks to see if there is a window name and that the window is not already closed.  If the window exists and is open, then this function closes it.   */
	
function closePopUpWindow()		{
	if (windowName && !windowName.closed)  {
		windowName.close();
	}
}




function PopUp(theURL) 
{
  window.open
  (theURL, '', 'height=400, width=500, top=100, left=100, scrollbars=yes, resizable=yes'); 
}


var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}

var windowName1

var folderName ="popups"
	
function selectPopUpWindow1(filename) {

var destination = folderName + "/" + filename;

windowName1 = window.open(destination, "windowName1", "resizable, scrollbars=yes, top=20, left=20, width=500, height=700");

	windowName1.focus()
}

function closePopUpWindow1()		{
	if (windowName1 && !windowName1.closed)  {
		windowName1.close();
	}
}

/*  this one for where - map  */

var windowName2

var folderName ="popups"
	
function selectPopUpWindow2(filename) {

	var destination = folderName + "/" + filename;

windowName2 = window.open(destination, "windowName2", "resizable=no, scrollbars=no, top=20, left=20, width=550, height=420");

	windowName2.focus()
}


function closePopUpWindow2()		{
	if (windowName2 && !windowName2.closed)  {
		windowName2.close();
	}
}

function validateform()
{
if(search_form.sst.value==""){
alert("You must enter some search criteria in the SEARCH FOR field")
search_form.sst.focus()
return false
}

return true
}


function validatequickform()
{
if(quick_search.sst.value==""){
alert("You must enter some search criteria in the QUICK SEARCH field")
quick_search.sst.focus()
return false
}

return true
}

function validatecategoryform()

{
if(category_form.sst.value==""){
alert("You must choose a TOPIC")
category_form.sst.focus()
return false
}
return true
}
