$(document).ready(function(){ 
	if($(".clickable_right").attr('semilo_ad').length > 0 && $(".clickable_left").length > 0 && $(".clickable_right").length > 0){
		sidespace_calc(); 
	}
});
$(window).resize(function(){  
	if($(".clickable_right").attr('semilo_ad').length > 0 && $(".clickable_left").length > 0 && $(".clickable_right").length > 0){
		sidespace_calc();
	}
});

function sidespace_calc(){
	var content_width = $("div.container").outerWidth();
	var window_width = $("html").outerWidth();
	var extra_marge = 5;
	if($.browser.msie){ var extra_marge = 10; }
	var sidebar_witdth = ((window_width - content_width)/2)-extra_marge;
	
	if(sidebar_witdth < 0){
		$(".clickable_left").hide();
		$(".clickable_right").hide();
	} else {
		$(".clickable_left").addClass('cursorpointer').show().width(sidebar_witdth).height(document.height);
		$(".clickable_right").addClass('cursorpointer').show().width(sidebar_witdth).height(document.height);
	}
}
