<!-- // begin

function showBox_menu( 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 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 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);
}

function popup(adresas, name, width, height) 
{ 
	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"); 
}

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( boxId )
{
    var myBox = document.getElementById( boxId );

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

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>'
    );
}

/*
	Form field Limiter script- By Dynamic Drive
	For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
	This credit MUST stay intact for use
*/

var Limit_ns6 = document.getElementById && !document.all

function LimitRestrictinput(maxlength,e,placeholder)
{
	if (window.event&&event.srcElement.value.length>=maxlength)
	
	return false
	
	else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength)
	{
		var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
		
		if (pressedkey.test(String.fromCharCode(e.which))) e.stopPropagation()
	}
}

function LimitCountlimit(maxlength,e,placeholder)
{
	var theform=eval(placeholder)
	
	var lengthleft=maxlength-theform.value.length
	
	var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)

	if (window.event||e.target&&e.target==eval(placeholder))
	{
		if (lengthleft<0) theform.value=theform.value.substring(0,maxlength)
		
		placeholderobj.innerHTML=lengthleft
	}
}

function displaylimit(thename, theid, thelimit)
{
	var theform= (theid != "" ? document.getElementById(theid) : thename);
	
	var limit_text='<span id="'+theform.toString()+'">'+thelimit+'</span>';
	
	if (document.all||Limit_ns6)
	
	document.write(limit_text)
	
	if (document.all)
	{
		eval(theform).onkeypress=function(){ return LimitRestrictinput(thelimit,event,theform) }

		eval(theform).onkeyup=function(){ LimitCountlimit(thelimit,event,theform) }
	}
	else if (Limit_ns6)
	{
		document.body.addEventListener('keypress', function(event) { LimitRestrictinput(thelimit,event,theform) }, true); 
		
		document.body.addEventListener('keyup', function(event) { LimitCountlimit(thelimit,event,theform) }, true); 
	}
}

// end -->