function load(file,argument) {
	$("#menu \x3E a")["each"](function () {
		if($(this)["attr"]("rel")!=file) {
			$(this)["attr"]("class",$(this)["attr"]("rel"));
		} else {
			$(this)["attr"]("class",$(this)["attr"]("rel")+"hover");
		};} 
	);
	$("#pin")["animate"]({"top":"30px","left":"315px"},200, function (){
		$("#loading")["fadeIn"](1000);
		$("#container")["animate"]({"left":"35px"},100)["animate"]({"left":"800px","opacity":0},400,function (){ 
			containerPosition=0;
			$("#content")["animate"]({"top":"-"+containerPosition+"px"},1200);
			$["post"]("/loader.php", {"file": file, "argument":argument},function (data) { 
				$("#content")["html"](data);
				$("#loading")["fadeOut"](200);$("#container")["animate"]({"left":"40px","opacity":1},400)["animate"]({"left":"55px"},200,function (){
					$("#pin")["animate"]({"top":"20px","left":"320px"},300)["animate"]({"left":"290px","top":"60px"},50);
				} 
			);} );} 
	);}
);}
function goDown(){
	containerPosition+=200;
	$("#content")["animate"]({"top":"-"+containerPosition+"px"},500);
	return false;
}
function goUp(){
	if(containerPosition < 199) {
		return false;
	}
	containerPosition -= 200;
	$("#content")["animate"]({"top":"-"+containerPosition+"px"},500);
	return false;
}
$(document)["ready"](function () {
	var urls = window["location"]["href"];
	//$("#nojavascript").hide();

	urls=urls["split"]("#");
	if(!urls[1]) {
		return false;
	}
	urls=urls[1]["split"](":");
	load(urls[0],urls[1]);

});

var containerPosition=0;
function comment(id, type) {
	$.post('template/comment.php', {'text': $('#text_' + id).val(), 'name': $('#name_' + id).val(), 'type': type, 'parent': id}, function(data){
		if(data == 'not') {
			alert('Došlo je do greške');
		} else {
			$('#commentbox_' + id).hide(200, function(){$('#commentbox_' + id).html(data);
			$('#commentbox_' + id).show(200);
		});
	}
});}

function goToTop() {
	containerPosition = 200;
	goUp();
	return false;
}

function popUp(URL) {window_left = (((screen.width)-960)/2);day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=900,height=600,left = " + window_left + ",top = 225');");}

function dropAll() {
	$('body').attr('style', '-webkit-transform: rotate(180deg);-moz-transform: rotate(180deg)');
}


