
		
function ChangeImage( ImageID, ImageURL)
{
	var myImageID = document.getElementById( ImageID );
	
	myImageID.src = ImageURL;
}
		
function setPointer(theRow, thePointerColor)
{
	if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {return false;}
	if (typeof(document.getElementsByTagName) != 'undefined') {var theCells = theRow.getElementsByTagName('td');}
	else if (typeof(theRow.cells) != 'undefined') {var theCells = theRow.cells;}
	else {return false;}
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) {theCells[c].style.backgroundColor = thePointerColor;}
	return true;
}
			
function setCookie( name, value ) 
{
	var systemDate = new Date(); 
	
	var expareDate = new Date(systemDate.getTime() + 315360000000);
	
	document.cookie = name + "=" + escape(value) + "; path=" + '/' + "; expires=" + expareDate.toGMTString();
}

function getCookie( name ) 
{
	var dc = document.cookie;
	
	var prefix = name + "=";
	
	var begin = dc.indexOf("; " + prefix);
	
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		
		if (begin != 0) return null;
	} 
	else begin += 2;
	
	var end = document.cookie.indexOf(";", begin);
	
	if (end == -1) end = dc.length;
	
    return unescape(dc.substring(begin + prefix.length, end));
}

function popup( adresas, name, width, height ) 
{ 
	newwindow=window.open(""+adresas+"", name,""+width+","+height+", toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes, top=80, left=150"); 
	
	if (window.focus) {newwindow.focus()}
}

/* -- External link -- */

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") == "external") anchor.target = "_blank";
	}
}

window.onload = externalLinks;

function showBox_save( boxId )
{
    var myBox = document.getElementById( boxId );
    
    if ( myBox.style.display == 'none')
    {
    	setCookie( boxId + '_divBox', 'block' );
    
        myBox.style.display = 'block';
    } 
    else
    {
    	setCookie( boxId + '_divBox', 'none' );
    
        myBox.style.display = 'none';
    }
}
	
function showDiv( boxId )
{
    var myBox = document.getElementById( boxId );

    if ( myBox.style.display == 'none' )
    {
        myBox.style.display = 'block';
    } 
    else 
    {
        myBox.style.display = 'none';
    }
}

/*
	function showBox( boxId )
	{
	    var myBox = document.getElementById( boxId );
	
	    if ( myBox.style.display == 'none' )
	    {
	        myBox.style.display = 'block';
	    } 
	    else 
	    {
	        myBox.style.display = 'none';
	    }
	}
*/

function setPause( millis )
{
	var date = new Date();
	
	var curDate = null;
	
	do { curDate = new Date(); }
	
	while(curDate-date < millis);
}

function showBox( boxId, show )
{
    var myBox = document.getElementById( boxId );

    if ( show == 'TRUE' )
    {
        myBox.style.display = 'block';
        
        myBox.style.visibility="visible";
    } 
    else 
    {
        myBox.style.display = 'none';
        
        myBox.style.visibility="hidden";
    }
}

function flash( src, width, height )
{
    document.write(
        '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"' + (width ? ' width="'+width+'"' : '') + (height ? ' height="'+height+'"' : '') + ' id="padidintas" align="middle">' + "\n" +
        '    <param name="allowScriptAccess" value="sameDomain" />'+ "\n" +
        '    <param name="movie" value="'+src+'" />'+ "\n" +
        '    <param name="quality" value="high" />'+ "\n" +
        '    <embed src="'+src+'" quality="high"' + (width ? ' width="'+width+'"' : '') + (height ? ' height="'+height+'"' : '') + ' name="padidintas" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' + "\n" +
        '</object>'
    );
}

/* -- SUX -- */

/*
function getObject(id) 
{
	if (DOM) return document.getElementById(id);
	if (IE4) return document.all[id];
	else return false;
}

function getOffset(id, offsetName) {
	var result = 0;
	var item = eval('id');
	while (item != null) {
		result += eval('item.'+offsetName);
		item = eval('item.offsetParent');
	}
	return result;
}

var divs = new Array();

function showDiv(id) 
{
	for (i = 0; i <= divs.length; i++) {
		if (divs[i] != id) hideDiv(divs[i]);
		else {
			if (d = getObject('div'+id)) {
				if (d.style.display == 'block') {
					d.style.display = 'none';
					if (im = getObject('divico'+id)) im.src = '/images/arrow1.gif';
				} else {
					d.style.display = 'block';
					if (im = getObject('divico'+id)) im.src = '/images/arrow1_active.gif';
				}
			}
		}
	}
	saveDivStatus();
}

function showDivNoClose(id) {
	for (i = 0; i <= divs.length; i++) {
		if (divs[i] != id) hideDiv(divs[i]);
		else {
			if (d = getObject('div'+id)) {
				d.style.display = 'block';
				if (im = getObject('divico'+id)) im.src = '/images/arrow1_active.gif';
			}
		}
	}
}

function closeDiv(id) {
	hideDiv(id);
	saveDivStatus();
}

function hideDiv(id) {
	if (d = getObject('div'+id)) d.style.display = 'none';
	if (im = getObject('divico'+id)) im.src = '/images/arrow1.gif';
}

function updateDivStatus() {
	var oldstatus = getCookie("divs");
	if (!((oldstatus == "") || (oldstatus == null))) showDivNoClose(oldstatus);
}

function saveDivStatus() {
	var oldstatus = 0;
	for (i = 0; i <= divs.length; i++) {
		if (d = getObject('div'+divs[i])) {
			if (d.style.display == 'block') {
				oldstatus = divs[i];
				break;
			}
		}
	}
	setCookie("divs", oldstatus);
}
*/