function headerArrow()
{
	$('h1,h2,h3,h4,h5').each(function()
	{
		if($(this).not(':has(<span class="arrow"></span>)'))
		{
			$(this).prepend('<span class="arrow"></span>');
		}
	});
}

function assingLightbox()
{
	if($("table.lightbox").length)
	{
		$("table.lightbox a:has('img')").addClass('lightbox');
	}
	
	$("a.lightbox")
    	.attr('rel','lightbox')
    	.fancybox({
    		autoScale			:	true,
    		showCloseButton		:	true,
    		showNavArrows		:	true,
    		enableEscapeButton	:	true,
    		transitionIn		:	'elastic',
    		transitionOut		:	'elastic',
    		overlayColor		:	'#000',
    		overlayOpacity		: 	'0.9',
    		centerOnScroll		:	true,
    		easingIn			:	'swing',
    		easingOut			:	'swing',
    		changeFade			:	'medium',
    		speedIn				:	'medium',
    		speedOut        	:	'medium',
    		hideOnOverlayClick	:	true,
    		ajax                : { timeout : 9000 }
    	});
	
	$(window).resize
	(
		function()
		{
			$("a.lightbox").fancybox.resize;
		}
	)
}
	
function closeFlash()
{
	$("div#flashMessage").fadeOut('slow');
}

function removeMainPageTitle()
{
	if($('h2:contains("ANA SAYFA")').length)
	{
		$('h2:contains("ANA SAYFA")').remove();
	}
	
	if($('h2:contains("Home Page")').length)
	{
		$('h2:contains("Home Page")').remove();
	}
	
	if($('h2:contains("Anket")').length)
	{
		$('h2:contains("Anket")').remove();
	}
}

$(document).ready(function()
{
	removeMainPageTitle();
	
	$('table.deniz_1').find('tr:first td').addClass('tableHeader');
	
	if($("a.lightbox").length || $("table.lightbox").length)
	{
		assingLightbox();
	}
	
	if($("div#flashMessage").length)
	{
		var t = setTimeout('closeFlash()',4000);
	}
	
	headerArrow();
	//$('a.lightbox').lightBox({fixedNavigation:true});
});
