$(document).ready(function(){
	getlistsource();
})


function showbox( idd ) {
	$('#' + idd ).fadeIn();
}

function closebox( idd ) {
	$('#' + idd ).fadeOut();
}
function clicksend(){
	var send = document.getElementById('sendmail').style;
	if(send.display=='none'){
		send.display='block';
	}else send.display='none';
}

function form_search_time( ul ) {
	var days 	= $('#day').val();
	var months 	= $('#month').val();
	var years 	= $('#year').val();

	u = ul + '-' + days + '_' +  months + '_' + years ;
	window.location.href = u;

}

function getlistsource(){
	$(".getlistsource").click(function(){
		var classchk = $(this).attr("id");
		var realidsource = classchk.substring(3);
		var a = new Array();
		$("."+classchk).each(function(){
			if($(this).is(":checked")){
				a.push($(this).val());
			}
		})
		$.cookie( realidsource, a.join(), { expires: 7 } , { path: '/' } );
		location.reload();
	})
}

function setlistsource(idcat){
	if ($.cookie(idcat) != null){
		var listsourcenews = $.cookie(idcat);
		var arrlist = new Array;
		arrlist = listsourcenews.split(",");
		jQuery.each(arrlist, function() {
			$("#cat-"+idcat+" input[@value="+this+"]").attr("checked","checked");
		});
	}else{
		return false;
	}
}

