<!--
/*=====================================================================
							ARRAY SEARCH
  =====================================================================*/
function arraySearch(needle,haystack)
	{
		for (i=0; i <= haystack.length; i++)
		{
			if (haystack[i] == needle)
			{
				return i;
			}
		}
		return -1;
	}


/*=====================================================================
							SHOW/HIDE LAYER
  =====================================================================*/
function showandhide(div1,div2)
{
	// prvega prikažemo, drugega skrijemo
	if (div1 != '')
	{
		document.getElementById(div1).style.display = 'block';
	}
	if (div2 != '')
	{
		document.getElementById(div2).style.display = 'none';
	}
}


/*=====================================================================
								SHOW TAB
  =====================================================================*/
var oldTabID = 1;
function showTab(tabID)
{
	// ID
	if (!$('tabContent'+tabID))
	{
		ID = 1;
	}

	// skrijemo trenutno prižganega
	if ($('tabContent'+oldTabID))
	{	
		// ugasnemo starega
		$('tabContent'+oldTabID).setStyle('display', 'none');
		$('tab'+oldTabID).className = '';
	}
				
	// prižgemo novega
	$('tab'+tabID).className = 'on';
	$('tabContent'+tabID).setStyle('display', 'block');
	oldTabID = tabID;
}


/*=====================================================================
							INITIALIZE FOCUS
  =====================================================================*/
function initializeFocus(forma)
{
	for (i = 0; i<forma.length; i++)
	{
		forma[i].onfocus = function() {
			this.parentNode.className = 'focused';
		};
		forma[i].onblur = function() {
			this.parentNode.className = '';
		};
	}
}


/*=====================================================================
							CLEAR TEXT FIELD
  =====================================================================*/
function clearText (field)
{
	if (field.defaultValue == field.value)
	field.value = ''
}

/*=====================================================================
							COUNT CHARS
  =====================================================================*/
function countChar(field)
{
	document.getElementById(field.name+'Count').value = field.value.length;
}
// -->
