// JavaScript Document
// !!!! Be Careful here. If this is a mistake in this file IE 6 png transparency will not work.

//************************************************************
// LOADS THE NECESSARY FUNCTIONS FOR SITE
function addLoadEvent(func)
	{
		var oldonload = window.onload;
		if (typeof window.onload != 'function')
			{
				window.onload = func;
			}
		else
			{
				window.onload = function()
					{
						oldonload();
						func();
					}
			}
	}
	
// END LOADS THE NECESSARY FUNCTIONS FOR SITE
//************************************************************

//************************************************************
// FOR POPUP WINDOWS - NEW WINDOW
// add 'class="popup"' to any link that you want to open in a new window

function popUp(winURL)
	{
		window.open(winURL, "popup");	
	}
	
function popUp2(winURL)
	{
		window.open(winURL, "popup_taste", "width=500,height=300,scrollbars=yes,resizable=yes");	
	}
	
function popUp3(winURL, width, height)
	{
		window.open(winURL, "popup_generic", "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes");	
	}
	
function openNewWindow() 
	{
		if (!document.getElementsByTagName) return false;
		var lnks = document.getElementsByTagName("a");
		for (var i=1; i<lnks.length; i++) 
			{
				if(lnks[i].className == "popup")
					{
						lnks[i].onclick = function()
							{
								popUp(this.getAttribute("href"));
								return false;
							}
					}
				else if(lnks[i].className == "popup_taste")
					{
						lnks[i].onclick = function()
							{
								popUp2(this.getAttribute("href"));
								return false;
							}
					}
				else if(lnks[i].className == "popup_generic")
					{
						lnks[i].onclick = function()
							{
								url = this.getAttribute("href");
								width = this.getAttribute("title");
								height = this.getAttribute("name");
								popUp3(url, width, height);
								return false;
							}
					}
			}
		
	}
	
// END FOR POPUP WINDOWS - NEW WINDOW
//************************************************************

//************************************************************
// FOR SUCKERFISH DROPDOWNS
// Dropdowns will not work in IE 6 without these



//************************************************************
// load the functions
// !!!! Be Careful here. If this is a mistake in the file IE 6 png transparency will not work.
// dont list a function here that is not being used.
addLoadEvent(openNewWindow);