var sensSpeed = 100;
$(document).ready(function(){
///
$("#searchEnginesResult").hide();
///
///
	$(".sens").hover(
		function(){
			$(this).fadeTo(sensSpeed,.6);
		},
		function(){
			$(this).fadeTo(sensSpeed,1);
		}
	);
///
///
	$(".menuItemMain").hover(
		function(){
			$(this).toggleClass('menuItemMainOn');
		},
		function(){
			$(this).toggleClass('menuItemMainOn');
		}
	);
///
///
	$("#fbIn").hover(
		function(){
			$(".rightFunctions").css('background','url(sign2.png) 23px bottom no-repeat #f3ede1');
		},
		function(){
			$(".rightFunctions").css('background','url(sign.png) 23px bottom no-repeat #f3ede1');
		}
	);
///
});

function setCookieAdd(c_name,value,expiredays){
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie = c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	if(c_name=='size'){
		$('.opis').css('font-size',value+'px');
	}else if(c_name=='lang'){
		window.location.reload();
	}
}

function expandMenu(id){
	if(id==1){
		Tip(menu_content_1(), FIX, ['menuItemMain'+id, window.wix, -64], ABOVE, false, CLICKCLOSE, true, FADEOUT, false);
	}else if(id==2){
		Tip(menu_content_2(), FIX, ['menuItemMain'+id, window.wix, -64], ABOVE, false, CLICKCLOSE, true, FADEOUT, false);
	}else if(id==3){
		Tip(menu_content_3(), FIX, ['menuItemMain'+id, window.wix, -23], ABOVE, false, CLICKCLOSE, true, FADEOUT, false);
	}
}

function ajaxer(id,type){
//alert('ajaxer runs: '+id);
	$('#topShTitle').stop().fadeOut(sensSpeed*1,function(){
										  
		$.ajax({
		url: 'ajaxResult2.php?id='+id,
		dataType: 'html',
		success:function(data){
					$('#topShTitle').html(data);
					$('#topShTitle').fadeIn(sensSpeed*1);
					
				}
		})					  
	}
	);

	$('#ajaxResult').stop().fadeOut(sensSpeed*2,function(){$('#ajaxLoad').fadeIn(sensSpeed*2,function(){
	
	$.ajax({
	url: 'ajaxResult.php?id='+id,
	dataType: 'html',
	success:function(data){
				$('#ajaxResult').html(data);
				$('#ajaxLoad').fadeOut(sensSpeed*2,function(){$('#ajaxResult').fadeIn(sensSpeed*2);});
				
			}
	})
	
	});});
	
}

function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return "";
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function setSize(size){
	var actualSize = ((ReadCookie('size'))*1);
	//alert(actualSize);
	if(size=='plus'){
		if(actualSize<17){
			var value = (actualSize*1)+1;
			setCookieAdd('size',value);
		}else{
			return false;
		}
	}else if(size=='minus'){
		if(actualSize>11){
			var value = (actualSize*1)-1;
			setCookieAdd('size',value);
		}else{
			return false;
		}
	}
}

function showMenu(nr){
	if(nr==1){
		Tip(menu_content_1(), FIX, ['menu_top_1', -3, -3], ABOVE, false, CLICKCLOSE, true);
	}else if(nr==2){
		Tip(menu_content_2(), FIX, ['menu_top_2', -3, -3], ABOVE, false, CLICKCLOSE, true);
	}
}
function hy(id){
	var myString = id;
	var currPageIdString = new String(myString);
	var myStringExploded = currPageIdString.split('/');
	var result0 = myStringExploded[0];
	var result1 = myStringExploded[1];
	var result2 = myStringExploded[2];

	if(window.currPageId==result0){
		ajaxer(id);
	}else{
			if(result2>=1){
				var secondPart = result1+'/'+result2;
			}else{
				var secondPart = result1;
			}
		window.location.href='?c='+result0+'&s='+secondPart;
	}
}var hash = window.location.hash;if(hash.substring(1,3)=='s='){var goTo = hash.substring(3,hash.length);}else{var goTo = '';}
