function idaugiau(lin){
 var dbr = document.getElementById('idaugiau').style.display;
 if (lin){
  var vieta=document.getElementById(lin).offsetTop-120;
  document.getElementById('idaugiau').style.top=vieta+"px";
 }else{
  document.getElementById('idaugiau').style.top="422px";
 }
if (dbr){
 if (dbr == 'none'){
   document.getElementById('idaugiau').style.display='block';
 }else{
   
   document.getElementById('idaugiau').style.display='none';
 }
}else{
	document.getElementById('idaugiau').style.display='block';
}
 
}


$(window).scroll(function() {

if (document.getElementById('infobox').style.display==""){

  var documentHeight = $(document).height()-480; 
  var scrollPosition = $(window).height() + $(window).scrollTop(); 

	
	
	if (documentHeight <= scrollPosition) {
  	  $('#infobox').fadeIn(2000);
  	  
    }else{
	   setTimeout(function() {$('#infobox').fadeIn(2000);}, 4000);  
    }
}    


if ((navigator.appName == "Microsoft Internet Explorer") && (parseFloat(navigator.appVersion.split("MSIE")[1])) < 7){
  var documentHeight = $(document).height()-480; 
  var scrollPosition = $(window).height() + $(window).scrollTop()+115; 
  
   if (document.getElementById("uforma").style.display=="block"){scrollPosition = scrollPosition-255};
	document.getElementById("infobox").style.top = scrollPosition+"px";
	
}


});

    $(function()
      {
          $("a[rel='lightbox']").fancybox();
      });
      
      
      
function boxclose (id) {
	dpoz = document.getElementById(id).style.display;
	if ((dpoz == 'block') || (dpoz == ''))
	 document.getElementById(id).style.display='none';
	else{
	 document.getElementById(id).style.display='block';
	 if ((navigator.appName == "Microsoft Internet Explorer") && (parseFloat(navigator.appVersion.split("MSIE")[1])) < 7){	 
		 var dbr = $(window).scrollTop()-1;
		 
		 scroll(0,dbr);
     }	 
    } 
	 
	
	 if (id == "infobox") {pageTracker._trackPageview('uzdare_daugiau_informacijos');}
}
