
function aRequest(action) {

	var tmp = action.split("|");
	
	var naslov=null;
	var fancy=true;
	
	if( tmp.length > 0 ) {
		// products
		if( tmp[0] == "Produkt" ) {
			naslov = "/ajax_retProd.php?id="+tmp[1];
		}  if( tmp[0] == "Plugin" ) {
			if( tmp[1] == 7 )
				naslov = "/ajax_retObrazec.php";
			else if( tmp[1] == 10 ) {
				naslov = "/ajax_retNovosti.php";
				fancy = false;
			} else
				naslov = "/_plugin/Besedilo/ajax_return.php?id="+tmp[1];
		}
	}

	if( naslov != null ) {
		$.ajax({

			url		: naslov,
			type	: "GET",
			cache	: true,
			
			success: function(data) {
				//if( fancy )
					$.fancybox({ hideOnOverlayClick: false, showCloseButton: false, content : data, scrolling : 'auto', enableEscapeButton : true, centerOnScroll: false });
					$.fancybox.resize();
			}
		});
	} else
		return false;
}


function newsReq() {
	$.ajax({

		url		: "/ajax_retNews.php",
		type	: "GET",
		cache	: true,
		
		success: function(data) {
			$("#novice").html(data);
			
			$("#novice").css("display","block");
			$("#novice").addClass("prikazaneNovice");
			$("#novice").css("border-bottom","4px solid #bdbcb9");
			
			$.scrollTo( $('#novice'), {speed:700} );
		}
	});
}
function galReq() {
	$.ajax({
		url		: "/ajax_retGal.php",
		type	: "GET",
		cache	: false,
		
		success: function(data) {
			$.fancybox({ hideOnOverlayClick: false, showCloseButton: false, content : data, scrolling : 'no', enableEscapeButton : true, centerOnScroll: false });
		}
	});
}

function newsClose() {
	$.scrollTo( $('#topTag'), {speed:10} );
	$("#novice").css("display","none");
}
