//function Font-size PLUSE
function fontsizeplus()
{
	var text_container =  document.getElementById('main-text');
	var font_size = parseInt(text_container.style.fontSize);

	var text_subtitle =  document.getElementById('main-subtitle');
	var font_size = parseInt(text_subtitle.style.fontSize);

	if (font_size < 17)
	{
		text_container.style.fontSize = font_size + 1 + 'px';
		text_subtitle.style.fontSize = font_size + 1 + 'px';
	}


}
//end function Font-size PLUSE
//function Font-size MINUS PLUSE H1

function fontsizeplusp()
{
	var text_container =  document.getElementById('main-text');
	var font_size = parseInt(text_container.style.fontSize);

	if (font_size < 17)
	{
		text_container.style.fontSize = font_size + 1 + 'px';
	}
}

function fontsizeminusp()
{
	var text_container =  document.getElementById('main-text');
	var font_size = parseInt(text_container.style.fontSize);

	if (font_size > 12)
	{
		text_container.style.fontSize = font_size - 1 + 'px';	
	}


}
var min=14;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('h1');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('h1');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

//function Font-size MINUS PLUSE H1
//function Font-size MINUS
function fontsizeminus()
{
	var text_container =  document.getElementById('main-text');
	var font_size = parseInt(text_container.style.fontSize);

	var text_subtitle =  document.getElementById('main-subtitle');
	var font_size = parseInt(text_subtitle.style.fontSize);

	if (font_size > 12)
	{
		text_container.style.fontSize = font_size - 1 + 'px';	
		text_subtitle.style.fontSize = font_size - 1 + 'px';
	}


}
//end function Font-size MINUS

//index news javascript
function showhidepics(hidenum)
{
	for(var i=1;i<=4;i++)
	{
		if(i==parseInt(hidenum))
		{
			document.getElementById('button'+i).className = 'button-javascript-on-'+i;
			document.getElementById('div'+i).style.display = "block";

		}
		else
		{
			document.getElementById('button'+i).className = 'button-javascript-'+i;
			document.getElementById('div'+i).style.display = "none";
		}
	}
	
	
}
// end index news javascript

//news.php first conteiner javascript
function shownewspics(hidenum)
{
	for(var i=1;i<=4;i++)
	{
		if(i==parseInt(hidenum))
		{
			document.getElementById('div-img'+i).style.display = "block";
			document.getElementById('div-title'+i).style.display = "block";
			document.getElementById('news-button'+i).className = 'news-button-active'+i;

		}
		else
		{
			document.getElementById('div-img'+i).style.display = "none";
			document.getElementById('div-title'+i).style.display = "none";
			document.getElementById('news-button'+i).className = 'news-button'+i;
		}
	}
	
	
}
//end news.php first conteiner javascript


//news.php tow conteiner javascript
function shownewsdiv(hidenum)
{
	for(var i=1;i<=4;i++)
	{
		if(i==parseInt(hidenum))
		{
			document.getElementById('news-div'+i).style.display = "block";
			document.getElementById('buttonnews'+i).className = 'button-news-on'+i;

		}
		else
		{
			document.getElementById('news-div'+i).style.display = "none";
			document.getElementById('buttonnews'+i).className = 'button-news'+i;
		}
	}
	
	
}
//end news.php tow conteiner javascript



//index news javascript
function showhidelastpics(hidenum)
{
	for(var i=5;i<=7;i++)
	{
		if(i==parseInt(hidenum))
		{
			document.getElementById('button'+i).className = 'button-javascript-on-'+i;
			document.getElementById('div'+i).style.display = "block";

		}
		else
		{
			document.getElementById('button'+i).className = 'button-javascript-'+i;
			document.getElementById('div'+i).style.display = "none";
		}
	}
	
	
}
// end index news javascript



//index Divoto Zove container javascript
function wild(hidenum)
{
	for(var i=1;i<=3;i++)
	{
		if(i==parseInt(hidenum))
		{
			document.getElementById('slide'+i).className = 'slide-on';
			document.getElementById('thb'+i).className = 'active_thumb';

		}
		else
		{
			document.getElementById('slide'+i).className = 'slide-off';
			document.getElementById('thb'+i).className = 'thumb';
		}
	}
	
	
}
//END index Divoto Zove container javascript


//index Badi Eco container javascript
function beeco(hidenum)
{
	for(var i=1;i<=3;i++)
	{
		if(i==parseInt(hidenum))
		{
			document.getElementById('sld'+i).className = 'slide-on';
			document.getElementById('thumb'+i).className = 'active_thumb';

		}
		else
		{
			document.getElementById('sld'+i).className = 'slide-off';
			document.getElementById('thumb'+i).className = 'thumb';
		}
	}
	
	
}
//END index Badi Eco container javascript

function openprintwindow(url,name)
{ 
var height=screen.availHeight;
var display_setting="menubar=1,toolbar=0,screenX=0,screenY=0,top=0,left=0,scrollbars=1,status=0,width=900, height="+height; 
window.open(url,name,display_setting); 
}

function opennewwindow(url,name)
{ 
var height=screen.availHeight-100;
var display_setting="menubar=0,toolbar=0,screenX=0,screenY=0,top=0,left=0,scrollbars=1,status=0,width=600, height="+height; 
window.open(url,name,display_setting); 
}

//function add and remove firms 

function addItem() {
  source = document.addcompany.elements['l_category[]'];
  goal = document.addcompany.elements['r_category[]'];
  hidden = document.addcompany.categories;
  if ( (source.options[source.selectedIndex].value != '') && (!(source.options[source.selectedIndex].disabled)) ) {
    goal.options[goal.options.length] = new Option (source.options[source.selectedIndex].text, source.options[source.selectedIndex].value );
	//alert(source.options[source.selectedIndex].value);
	hidden.value = hidden.value + source.options[source.selectedIndex].value + ";";
	source.options[source.selectedIndex].disabled = true;
    source.options[source.selectedIndex].style.color = '#C0c0c0';
    source.options[source.selectedIndex].selected = false;
	
	
  }
}

function removeItem() {
  source = document.addcompany.elements['r_category[]'];
  goal = document.addcompany.elements['l_category[]'];

  for (i = 0; i < (goal.length); i++) {
    if (goal.options[i].value == source.options[source.selectedIndex].value) {
	  removeFromArray(source.options[source.selectedIndex].value);
      goal.options[i].disabled = false;
      goal.options[i].style.color = '';
    }
  }
  source.options[source.selectedIndex] = null;
}

function removeFromArray(categoryid)
{
	hidden = document.addcompany.categories;
	var newvalues="";

	var values = hidden.value.split(";");
	for(var i=0; i<values.length-1; i++)
	{
		if(values[i]!=categoryid)
		{
			newvalues +=values[i] + ";";
		}
	}
	
	hidden.value = newvalues;

}

//end function add and remove firms 