/* Google map functions */
$(window).resize(function()
{
	if(typeof loadMap==='function')
		loadMap();
});

$(window).unload(function()
{
	if(typeof GUnload==='function')
		GUnload();
});

$(document).ready(function()
{
	if(typeof loadMap==='function')
		loadMap();
});


/* Set links */
$(document).ready(function()
{	
	$("a.print").click(
		function () 
		{
			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;	
		}
	);
	
	$("a.new-window").click(
		function() 
    	{
      		popUp(this.getAttribute("href"));
      		return false;
    	}
	);
	
	$("a.close").css("visibility","visible");
	$("a.close").css("display","inline");
	$("a.close").click(
		function() 
    	{
      		window.close();
          		return false;
    	}
	);
	
	$("a[rel='external']").attr("target","_blank");
	
	$("p > img.image-left").parent().css("padding","0");
	$("p > img.image-right").parent().css("padding","0");
	
	$("div.image-left > p > img").each(function() { $(this).parent().parent().width($(this).attr("width")); });
	$("div.image-right > p > img").each(function() { $(this).parent().parent().width($(this).attr("width")); });
	
	$("div.image-left > img").each(function() { $(this).parent().width($(this).attr("width")); });
	$("div.image-right > img").each(function() { $(this).parent().width($(this).attr("width")); });
	$('a.lightbox').lightBox();
});



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

