function pengerSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
  }
  
  $("#footer_new").css({'width' : myWidth-50, 'margin-left' : 15});
  $("#footer_new > .hold").css({'width' : myWidth-50-32});
  
}


$(document).ready(function(){

	//za footer_new
	pengerSize();

	//za refleksiju
	Reflection.defaultHeight = .25;
	Reflection.defaultOpacity = .35;
	
	//provera forme
	$("#komentari-formular").validate();
	
	
	//poziva recnik
	$('#eng_srp')
	.click(function(){
		var oWord = document.getElementById("word");
		var sWord = oWord.value;
		javascript:ajaxpage('/recnik.php?word=' + sWord + '&jezik=2', 'recnikRez');
	});
	
	$('#srp_eng')
	.click(function(){
		var oWord = document.getElementById("word");
		var sWord = oWord.value;
		javascript:ajaxpage('/recnik.php?word=' + sWord + '&jezik=1', 'recnikRez');
	});
	
	//promena sifre
	$('.promena-sifre')
	.click(function(){
	javascript:ajaxpage('/zamenaSifre.php', 'sifra_slika');
	});
	
	//hover za slike galerije
	$('.text-galerija-mala > img')
	.click(function(){
	$("img").removeClass("visited");
	$(this).addClass("visited");
	});
	
	$(".text-galerija-mala > img").hover(function () {
	  $(this).addClass("visited_hover");
	}, function () {
	  $(this).removeClass("visited_hover");
	});
	
	//pravi skroll strane
	$('a')
	.click(function(){
	$("html").animate({scrollTop:0}, 'slow'); 
	});
	
	
});