/*******************************************************************************
* GET ELEMENT BY ID SHORTCUT                                                   *
*******************************************************************************/
function gE( id)
{
	var el;
	if(document.getElementById) {
		el = document.getElementById(id);
	} else if(document.all) {
		el = document.all[id];
	} else {
		return null;
	}
	return el;
}
/*******************************************************************************
* END: GET ELEMENT BY ID SHORTCUT                                              *
*******************************************************************************/

/*******************************************************************************
* TARGET="_BLANK" XHTML REPLACEMENT JAVASCRIPT                                 *
*******************************************************************************/
function toNewWin( url)
{
	bWasOpen = false;
	hNewWin = window.open( url);
	return ( typeof( hNewWin) == 'object') ? true : false;
	
}
/*******************************************************************************
* END: TARGET="_BLANK" XHTML REPLACEMENT JAVASCRIPT                            *
*******************************************************************************/

/*******************************************************************************
* OTEVŘENÍ STRÁNKY DO NOVÉHO OKNA S DANOU VELIKOSTÍ                            *
*******************************************************************************/
function popupWin( lnk, id, w, h, wOff, hOff, resizable, scrollbars)
{
	var link;
	var param;
	var wokno;	
	var width;	
	var height;	
	
	link   = lnk + "?id=" + id + "&w=" + w + "&h=" + h;	
	
	width  = w + wOff;
	height = h + hOff;
	
	param = " width=" + width + ",height=" + height + ",resizable=" + ((resizable)?"yes":"no");
	
	// pro veke obrazky zobrazeni scrollbaru
	if (scrollbars || (self.screen.width < width) || (self.screen.height < height))
	{
		param += ',scrollbars=yes';
	}

	wokno = window.open( link, "iPopup", param);
	return (typeof(wokno)=='object')?true:false;
}
/*******************************************************************************
* END: OTEVŘENÍ STRÁNKY DO NOVÉHO OKNA S DANOU VELIKOSTÍ                       *
*******************************************************************************/

/*******************************************************************************
* BIKE THUMBNAIL SWITCHER                                                      *
*******************************************************************************/
function tnSwitch( imgId, imgSrc, imgW, imgH, aId, aHref, aOnClick)
{
	var e;

	// zmena obrazku
	if( null != imgId)
	{
		e = gE( imgId);
		e.src = imgSrc;
		e.style.width = imgW + 'px';
		e.style.height = imgH + 'px';
	}
	
	// zmena kotvicky
	if( null != aId)
	{
		e = gE( aId);
		e.href = aHref;
		e.onclick = aOnClick;
	}
	
}
/*******************************************************************************
* END: BIKE THUMBNAIL SWITCHER                                                 *
*******************************************************************************/

/*******************************************************************************
* APPEND EVENT                                                                 *
*******************************************************************************/
/*
// cross-browser event handling for IE5+, NS6 and Mozilla 
// By Scott Andrew 
function aE( elm, evType, fn, useCapture)
{
	if(elm.addEventListener)
	{
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if(elm.attachEvent)
	{
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else
	{
		elm['on' + evType] = fn;
	}
} 
*/
function aE(elementObject, eventType, eventFunction)
{
	if (document.addEventListener && !window.opera)
	{
		if ((elementObject == window) && window.opera)
		{
			elementObject == document;
		}
		
		try
		{
			elementObject.addEventListener(eventType,eventFunction,true);
		}
		catch (e)
		{
		}
		
	}
	else
	{
		elementObject.attachEvent('on' + eventType,eventFunction);
	}
}
/*******************************************************************************
* END: APPEND EVENT                                                            *
*******************************************************************************/


function rE(elementObject, eventType, eventFunction)
{
	if (document.addEventListener && !window.opera)
	{
		if ((elementObject == window) && window.opera)
		{
			elementObject == document;
		}
		elementObject.removeEventListener(eventType,eventFunction, true);
	}
	else
	{
		elementObject.detachEvent('on' + eventType,eventFunction);
	}
}
