function perkrauti()
{
	alert('Perkraunama...');
	location.reload();
}

function swapClass(obj)
{

	
	if (obj.className == 'main_menu_off')
	{
			obj.className = 'main_menu_on';			
	}
	else
	{
			obj.className = 'main_menu_off';	
	}
		
}
function preloadImages() {
 var d=document; 
 if(d.images){ 
 
 if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=preloadImages.arguments; 
   for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){
       d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
       }
  }
}

function isSalary(str) 
{
 for(var position=0; position<str.length; position++){
	var chr = str.charAt(position)
        if  ( (chr < "0") || (chr > "9") ) 
              return false;
  };      
  return true;
}
   
function calculateSalary(errorMsg)
{ 

	salary_val = document.getElementById('salary').value;
	
	freesalary_val = document.getElementById('freesalary').value;


	
	 if (!isSalary(salary_val) || !isSalary(freesalary_val)) 
	{	
		alert(errorMsg);
		return false;
	}
	

	obj = document.getElementById("netto");
//	obj1 = document.getElementById("jobPrice");
	
	
//	obj1.value = Math.round( salary_val * (1 + 30.98/100 + 0.2/100) );
	
	if (salary_val >= 320)
	{
		obj.value = salary_val - (salary_val - freesalary_val)*30 / 100;	
	}
	else
	{
		obj.value = salary_val;
	}
	
	obj.value = Math.round(obj.value);
	
}

    
   
   function filter()
   {
     document.filterForm.submit();
   }
 
 function showFoto(src,width,height)
 {

		xposition=70; yposition=40;		
		if ((parseInt(navigator.appVersion) >= 4 )){
			xposition = (screen.width - width) / 2;
			yposition = (screen.height - height) / 2;
		} 	
		args = "width=" + width + "," 
			    + "height=" + height + "," 
				+ "location=0," 
				+ "menubar=0,"
				+ "resizable=0,"
				+ "scrollbars=0,"
				+ "statusbar=0," 
				+ "titlebar=0,"
				+ "toolbar=0,"
				+ "hotkeys=0,"
				+ "screenx=" + xposition + ","  //NN Only
				+ "screeny=" + yposition + ","  //NN Only
				+ "left=" + xposition + ","     //IE Only
				+ "top=" + yposition;           //IE Only 
   window.open('?q=showImage&src='+src,'preview',args); 
 }

 function shd(name)
 { 
	  var div = document.getElementById(name);
	  alert(div.style.visibility);	  
	  div.style.visibility = (div.style.visibility == "visible" ? "hidden" : "visible" );
	  div.style.height = (div.style.visibility == "visible" ? "auto" : "1px" );
 }

function openWindow(href,width,height) {
	xposition=70; yposition=40;
	if ((parseInt(navigator.appVersion) >= 4 )){
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
	} 
	args = "width=" + width + "," 
		    + "height=" + height + "," 
			+ "location=0," 
			+ "menubar=0,"
			+ "resizable=0,"
			+ "scrollbars=yes,"
			+ "status=yes," 
			+ "titlebar=0,"
			+ "toolbar=0,"
			+ "hotkeys=0,"
			+ "screenx=" + xposition + ","  //NN Only
			+ "screeny=" + yposition + ","  //NN Only
			+ "left=" + xposition + ","     //IE Only
			+ "top=" + yposition;           //IE Only 
	
    popup = window.open(href, '', args);
    popup.focus();
}
 
 function highlight(id)
 {
 return false;
  image1 = new Image();
  image1.src = 'img/btn_off.gif';
  image2 = new Image();
  image2.src = 'img/btn_on.gif';
   
 if (id)
 {
   obj = document.getElementById(id);
   if (obj.className == 'menu_btn_on')
    {
//      obj.className = 'menu_btn_off';
      obj.style.backgroundImage = 'URL(img/btn_off.gif)';
    }
   else if (obj.className == 'menu_btn_off')
    {
      obj.className = 'menu_btn_on';
      obj.style.backgroundImage = 'URL(img/btn_on.gif)';
    }
  }
 }

function openLink(href) {
    //popup = window.open(href, '', args);
    popup = window.open(href);
    popup.focus();
}


