<!--
//function silentErrorHandler() {return true;}
//window.onerror=silentErrorHandler;
/*Suppressing error warnings in IE*/
//-->
var timer;

$(document).ready
(
	
	function()
	{
			
		$('a[href^="http://"]').attr("target", "_blank");//open links to other websites in a new window
		$('a[href$=".pdf"]').attr("target", "_blank");//open pdfs in a new window
		
		
		$('span.img_d').replaceWith('.');//obfuscation - replace images with literal characters
		$('span.img_u').replaceWith('_');
		$('span.img_am').replaceWith('<span>&#064;</span>');
		$('span.show_revem').replaceWith('');
		
		$('p.instr').show();
		$('div.addresses').hide();
		$('div.address_block').hide();
		
		$('a.instr_all').click(function()
		{
			$('p.instr:visible').hide();
			//$('p.alt_instr').show();
			$('div.addresses').show();
			$('div.address_block').show();
			$('p.alt_instr').hide();
			return false;
		}
											 
		);
		
		if ( $('#gallery').length > 0 && $.browser.msie && (jQuery.browser.version == "6.0" || jQuery.browser.version == "7.0") )//change background & drop submenus for IE6 -  
		{
			var ver = GetSwfVer();
			//ver = 'WIN 9,0,22,87';
			//alert(ver);
			var commaIndex = ver.indexOf(',');
			var winIndex = ver.indexOf(' ');
			var test = ver.substring(winIndex,commaIndex)*1;
			//test = 9;
			if(test < 10)
			{
				timer = window.setTimeout('removeFullScreen()',500);
			}
			
		}
						
		if ( $.browser.msie && jQuery.browser.version == "6.0")//change background & drop submenus for IE6 -  
		{
			$("div#nav ul > li").not('li.middle').hover( 
				function() {
					
					if(!$(this).hasClass('on'))
					{
						$(this).addClass('hover')
					}
					
					$(this).find("ul").show();
					
					return false;	
				}, 
				function () {
					if($(this).hasClass('hover'))
					{
						$(this).removeClass('hover')
					}
					$(this).find("ul").hide();
				}
				
				//return true;
			);
		}//if msie6
		else
		{
			if (navigator.appVersion.indexOf("Mac")!=-1 && $.browser.mozilla && $.browser.version.substr(0,3)=="1.9")
			{
				//firefox 3 for mac loses focus on li s with a tags with title attributes
				
				$('a').removeAttr("title");
			}
			
			
		}
	}
	
	
);

/*function revealAddress(block)
{
	$('p.instr:visible').hide();
	$('p.alt_instr').show();
	addressBlock = $('div#'+block);
	if($('div.addresses').length > 0) //if outer blocks on page
	{
		blockParent = $(addressBlock).parent().attr('id');
		if($('div#'+blockParent).hasClass('addresses') && $('div#'+blockParent+':hidden') )//and parent is 
		{
			$('div.addresses:visible').hide();//alert('HIDE OUTER BLOCKS');
			$('div#'+blockParent).show();
		}
		
	}
	if($(addressBlock+':hidden'))
	{
		$('div.address_block:visible').hide();
		$(addressBlock).show();
	}
	//document.location = '#address';
	//alert($(addressBlock).html())
	
}*/

function hideAddress()
{
	//var addressBlock = $('div#'+block);
	//var blockParent = $(addressBlock).parent().attr('id');
	$('div.flash_info').html('');
}

function revealAddress(block)
{
	
	
	if($('div.addresses').length > 0) //if outer blocks on page
	{
		var addressBlock = $('div#'+block);
		var blockParent = $(addressBlock).parent().attr('id');
		var header='';
		if($('div#'+blockParent).hasClass('addresses') && $('div#'+blockParent+':hidden') )//and parent is 
		{
			$('div.addresses:visible').hide();//alert('HIDE OUTER BLOCKS');
		}
		if($('div#'+blockParent).hasClass('addresses') && $('div#'+blockParent).find('h2').length > 0 )
		{
			header = '<h2>'+$('div#'+blockParent).find('h2').html()+'</h2>';
		}
		$('p.instr').show();
		var html = $(addressBlock).html();
		$('div.flash_info').html(header+html);
	}
	
}
function removeFullScreen()
{
	//alert('removeFullScreen');
	window.clearTimeout('timer');
	window.document.gallery.TGotoFrame("_root",2);	
}

function eml_snd(part2,part1)
{
	mail_str = 'mail'+'to: '+part1+'@'+part2;
	return mail_str;
	//self.location = mail_str;
	//return false;
}
