// JavaScript Document
Cufon.set('fontFamily', 'frizq');

Cufon.replace('h1, h2, h3, h4, #categories a, #menu a, #foot, .datebox span, .sfont', {
			  hover: true
			  });


/* VIDEO */
$(document).ready(function(){
	var vid_w = 394;
	var vid_h = 295;
	$(".youtubevideo").each(function(){
		var code = $(".code", this).html();
		$(this).html('<object width="'+vid_w+'" height="'+vid_h+'"><param name="movie" value="http://www.youtube.com/v/'+code+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+code+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+vid_w+'" height="'+vid_h+'"></embed></object>');
	})
	$(".vimeovideo").each(function(){
		var code = $(".code", this).html();
		$(this).html('<object width="'+vid_w+'" height="'+vid_h+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+code+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id='+code+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+vid_w+'" height="'+vid_h+'"></embed></object>');
	})
})

function twits(){
	$("#news .disp").html("Loading twits...");
	var request = [{
				   		name: "twits",
						module: "site/riseabove/_assets/modules/tw"
				}];
			
	$.ajax({
		type: 'POST',
		cache: false,
		url: "/_ajax.php",
		processData: false,
		data: $.toJSON(request),
		dataType: 'json',
		success: function(json) {
			$("#news .disp").html(json.twits);
		},
		error: function(er){
			$("#news .disp").html('not able to connect to twitter!');
		}
	});	
}