
$(document).ready(function()
{	
	// External links
	$("a[rel='external']").attr("target","_blank");
	
	init();
	
	$('a.lightbox').lightBox();
	
});



function init() 
{
 	if (!document.getElementsByTagName) 
 		return;
 
 	var b = document.getElementsByTagName("body");
 	theBody = b[0];
 	if(theBody.className.match("popup"))
 	{
 		 window.focus();
	}
 		
 		
 	var anchors = document.getElementsByTagName("a");
 	for (var i=0; i<anchors.length; i++) 
 	{
   		var anchor = anchors[i];
   		if (anchor.className.match("new-window")) 
     	{
        	anchor.onclick = function() 
        	{
          		popUp(this.getAttribute("href"));
          		return false;
        	};
    	}
    	else if (anchor.className.match("close")) 
     	{
        	anchor.onclick = function() 
        	{
          		window.close();
        	};
    	}    	
 	}
 	
 	for (var i=0; i<document.forms.length; i++) 
 	{
   		var theForm = document.forms[i];
   		if (theForm.className.match("paypal")) 
   		{
     		theForm.target = "paypal";
 		}	
	}
}



function popUp(URL)
{
	eval("window.open('" + URL + "','windowName', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=600,height=700');");
}

/* Author: Rebecca Skeers rebecca@webmistress.com.au 2005 */
function printPage() 
{
  	if (window.print)
		window.print()
	else
		alert("Sorry, your browser doesn't support the print feature. Use the File menu on your browser to select Print.");
	return false;
}