/**
 * Podpinanie parametru target dla linków
 * rel = blank | top | self | parent
 */

window.onload = externalLinks;

function externalLinks() 
{
	if (!document.getElementsByTagName) 
	{
		return;
	}
	
	var anchors = document.getElementsByTagName("a");
	
	for (var i=0; i<anchors.length; i++) 
	{
		var anchor = anchors[i];
		
		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "blank" || anchor.getAttribute("rel") == "top" || anchor.getAttribute("rel") == "self" || anchor.getAttribute("rel") == "parent"))
		{
			anchor.target = "_" + anchor.getAttribute("rel");
		}
	}
}

/**
 * Detekcja przegladarki
 */
function loadBrowserStyle()
{
	if($.browser.name == 'msie')
	{
		document.write(unescape('%3Clink href="/theme/css/style-' + $.browser.name + $.browser.versionNumber + '.css"  type="text/css" rel="stylesheet" /%3E'));
	}
	else
	{
		document.write(unescape('%3Clink href="/theme/css/style-' + $.browser.name + '.css"  type="text/css" rel="stylesheet" /%3E'));
	}
}
loadBrowserStyle();

/*
 * Obsluga elementow ladowanych podczas ladowania sie strony
 */
$(document).ready(function()
{   
	/*
	 * Flash Page
	 */
	$('#wrap-top-right').flash(
    	{ src: '/theme/img/flash-right.swf', 
    	  width: 273, 
    	  height: 245,
    	  wmode: 'transparent' },
    	{ version: '9' }
    );
    
    $('#wrap-top-left-bottom').flash(
    	{ src: '/theme/img/flash-left.swf', 
    	  width: 689, 
    	  height: 193,
    	  wmode: 'transparent' },
    	{ version: '9' }
    );
});

/*
 * Obsluga drukowania
 */
function PagePrint(url)
{
	noweOkno = window.open(url, 'okienko', 'menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no, width=570, height=500')
}



