function getPost(site, postName) {
	var postData = '';

	$.ajax({
		type: "POST",
		url: 'proc/deeplinkHelper.php',
		data: 'site='+site+'&postName='+postName,
		dataType: 'text',
		async: false,
		success: function(response) {
			postData = response;
		}
	});

	return postData;
}

(function($) {
	$.fn.fullBg = function(){
		var bgImg = $(this);

		bgImg.addClass('bg');

		function resizeImg() {
			var imgwidth = bgImg.width();
			var imgheight = bgImg.height();

			var winwidth = $(window).width();
			var winheight = $(window).height();

			var widthratio = winwidth / imgwidth;
			var heightratio = winheight / imgheight;

			var widthdiff = heightratio * imgwidth;
			var heightdiff = widthratio * imgheight;

			if(heightdiff>winheight) {
				bgImg.css({
					width: winwidth+'px',
					height: heightdiff+'px'
				});
			} else {
				bgImg.css({
					width: widthdiff+'px',
					height: winheight+'px'
				});
			}
		}
		resizeImg();
		$(window).resize(function() {
			resizeImg();
		});
	};
})(jQuery)

jQuery(function($) {
	$(".bg").fullBg();
});


function setTimeAndDate(){
	var currentTime = new Date()
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	var hours = currentTime.getHours()
	var minutes = currentTime.getMinutes()
	if (minutes < 10){
		minutes = "0" + minutes
	}

	return day + "." + month + "." + year + " | " + hours + ":" + minutes + " ";
}

//function setPosHolderBlogItems(){
//	// makes var "name' as object div#holderPositions
//	var holderPositions = $("div#holderPositions");
//	// gets positions of holderPositions variable
//	var posHolderPositions = holderPositions.position();
//	// uses left position to decide placement of div#holderBlogItems
//	if(posHolderPositions.left <230) {
//		$("div#holderBlogItems").css('left', 230);
//	} else {
//		$("div#holderBlogItems").css('left', '23%');
//	}
//}
//
//function setPosContentBlock(){
//	// position content
//	var holderBlogItems = $("div#holderBlogItems");
//	var pos = holderBlogItems.position();
//	var posHolderContent = $('div#holderContentBlock').css('left', Math.ceil(pos.left)+160);
//}
//
//function setPosContentTextBlock(){
//	// var contentTextBlock = $("div#contentTextBlock");
//	var blogTopHeight = $("div#blogTop").height();
//	$("div#contentTextBlock").css('top', blogTopHeight +20);
//}
//
//

