// JavaScript Document
//here you place the ids of every element you want.
var ids=new Array('slika','flyer');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function just_check(id)	 {
	if(document.getElementById(id).style.visibility == 'collapse')
	{
		document.getElementById(id).style.visibility = 'visible';
	}
	else
	{
		document.getElementById(id).style.visibility = 'collapse';
	}
}
function ceo_check(id)	 {
	if(document.getElementById(id).style.visibility == 'collapse')
	{
		document.getElementById(id).style.visibility = 'visible';
		document.getElementById('set').value = '1';
	}
	else
	{
		document.getElementById(id).style.visibility = 'collapse';
		document.getElementById('set').value = '0';
	}
}
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function showdiv_inline(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'inline';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'inline';
		}
		else { // IE 4
			document.all.id.style.display = 'inline';
		}
	}
}
function proveri(id) {
	if (document.getElementById(id).style.display == 'block')
	{
		hidediv(id)
	}
	else
	{
		showdiv(id)
	}
}
function proveri_inline(id) {
	if (document.getElementById(id).style.display == 'inline')
	{
		hidediv(id)
	}
	else
	{
		showdiv_inline(id)
	}
}
/****************END SHOW HIDE****************/
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i<countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}
/**
 * DHTML textbox character counter script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

maxL=260;
var bName = navigator.appName;

function taLimit(taObj) {
	if (taObj.value.length==maxL) return false;
	return true;
}

function taCount(taObj,Cnt) { 
	objCnt=createObject(Cnt);
	objVal=taObj.value;
	if (objVal.length>maxL) objVal=objVal.substring(0,maxL);
	if (objCnt) {
		if(bName == "Netscape"){	
			objCnt.textContent=maxL-objVal.length;}
		else{objCnt.innerText=maxL-objVal.length;}
	}
	return true;
}
function createObject(objId) {
	if (document.getElementById) return document.getElementById(objId);
	else if (document.layers) return eval("document." + objId);
	else if (document.all) return eval("document.all." + objId);
	else return eval("document." + objId);
}
