function showCategVideoList(page,order,catID ) {	
	catID = typeof(catID) != 'undefined' ? catID : 0;
	order = typeof(order) != 'undefined' ? order : 1;

	preloader.remove("#videoListing");
	preloader.add("#videoListing","top");	
	//var data = "tx_lsuvideo_pi1[showCateg]="+catID+"&tx_lsuvideo_pi1[page]="+page+'&tx_lsuvideo_pi1[order]='+order+"&tx_lsuvideo_pi1[ajaxList]=1&type=3690";
	
	var currentUrl = document.location.href;
	if(document.location.hostname!='www.libertatea.ro' || document.location.hostname!='libertatea.ro') {
		var currentUrlInfo = currentUrl.split('www.libertatea.ro'); 
		if(currentUrlInfo.length >1) {
			currentUrlParts = currentUrlInfo[1].split('%2F');
			currentUrl = currentUrlParts.join('/');
			currentUrl = 'http://www.libertatea.ro' + currentUrl;
		}
	}
	if(currentUrl.indexOf('?')!=-1)
		currentUrl += "&tx_lsuvideo_pi1[showCateg]="+catID+"&tx_lsuvideo_pi1[page]="+page+'&tx_lsuvideo_pi1[order]='+order+"&tx_lsuvideo_pi1[ajaxList]=1&type=3690";
	else 
		currentUrl += "?tx_lsuvideo_pi1[showCateg]="+catID+"&tx_lsuvideo_pi1[page]="+page+'&tx_lsuvideo_pi1[order]='+order+"&tx_lsuvideo_pi1[ajaxList]=1&type=3690";
	$.ajax({
		url: currentUrl,
		cache: true,
		type: "GET",
		success: function(html){
			$("#videoListing").replaceWith(html);			
			/*Media list*/
			if ($(".page-multimediaGallery .list").length) {
				$("#videoGallery-list .list").find(".item:nth-child(2n), .item:last").addClass("last");			
			}
		}
	});
}

function showLatestVideo(showUid) {	
	preloader.remove("#singleGallery");
	preloader.add("#singleGallery");	
	
	var currentUrl = document.location.href;
	if(document.location.hostname!='www.libertatea.ro' || document.location.hostname!='libertatea.ro') {
		var currentUrlInfo = currentUrl.split('www.libertatea.ro'); 
		if(currentUrlInfo.length >1) {
			currentUrlParts = currentUrlInfo[1].split('%2F');
			currentUrl = currentUrlParts.join('/');
			currentUrl = 'http://www.libertatea.ro' + currentUrl;
		}
	}
	if(currentUrl.indexOf('?')!=-1)
		currentUrl += "&tx_lsuvideo_pi1[showUid]="+showUid+"&tx_lsuvideo_pi1[ajaxSwitch]=1&type=3691";
	else 
		currentUrl += "?tx_lsuvideo_pi1[showUid]="+showUid+"&tx_lsuvideo_pi1[ajaxSwitch]=1&type=3691";
	$.ajax({
		url: currentUrl,
		cache: true,
		type: "GET",
		success: function(html){
			$("#singleGallery").replaceWith(html);				
			var offset = $(".content-borderBox").offset();
			$(document).scrollTop(offset.top);
			//Twitter
			$(document).trigger("twitterLoad");	
		}
	});
}

function closeTipForm() {
	var currentUrl = document.location.href;
	$.ajax({
		url: currentUrl,
		cache: true,
		type: "GET",
		success: function() {
			$("#tipafriendlayout").html(' ');
		}
	});
}



function searchVideo(page, order){
	preloader.remove("#videoListing");
	preloader.add("#videoListing","top");	
	//var data = "tx_lsuvideo_pi1[keyword]="+$('#keyword').val()+"&tx_lsuvideo_pi1[page]="+page+'&tx_lsuvideo_pi1[order]='+order+"&tx_lsuvideo_pi1[ajaxList]=1&type=3690";
	//var currentUrl = document.location.href;
	var currentUrl = document.location.href;
	if(document.location.hostname!='www.libertatea.ro' || document.location.hostname!='libertatea.ro') {
		var currentUrlInfo = currentUrl.split('www.libertatea.ro'); 
		if(currentUrlInfo.length >1) {
			currentUrlParts = currentUrlInfo[1].split('%2F');
			currentUrl = currentUrlParts.join('/');
			currentUrl = 'http://www.libertatea.ro' + currentUrl;
		}
	}
	if(currentUrl.indexOf('?')!=-1)
		currentUrl += "&tx_lsuvideo_pi1[keyword]="+$('#keyword').val()+"&tx_lsuvideo_pi1[page]="+page+'&tx_lsuvideo_pi1[order]='+order+"&tx_lsuvideo_pi1[ajaxList]=1&type=3690";
	else 
		currentUrl += "?tx_lsuvideo_pi1[keyword]="+$('#keyword').val()+"&tx_lsuvideo_pi1[page]="+page+'&tx_lsuvideo_pi1[order]='+order+"&tx_lsuvideo_pi1[ajaxList]=1&type=3690";
	$.ajax({
		url: currentUrl,
		cache: true,
		type: "GET",
		success: function(html){
			$("#videoListing").replaceWith(html);			
			if ($("#videoGallery-list .tabs").length) $("#videoGallery-list .tabs").hoverTabs();
			if ($(".page-multimediaGallery .list").length) {
				$("#videoGallery-list .list").find(".item:nth-child(2n), .item:last").addClass("last");			
			}
		}
	});
}
