function writeSWFPromo(file, id, w, h){
	var flashvars = {};
	flashvars.width = w;
	flashvars.height = h;
	
	var params = {};
	params.wmode = 'transparent';
	
	var attributes = {};
	
	attributes.id = id;
	swfobject.embedSWF(file, id, w, h, "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}




function writeSWFCountdown(file, day, month, year){
	var flashvars = {};
	flashvars.width = 250;
	flashvars.height = 30;
	
	var params = {};
	params.wmode = 'transparent';
	
	var attributes = {};
	
	attributes.id = id;
	swfobject.embedSWF(file, id, w, h, "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}





function showCommentForm(){
	$("#node-commentform").show();
	$("#node-commentform").slideDown("medium");
}




function ebook_onchange(value, base){
	if(value > 0){
		location.href = base + value;
	}
}



if (Drupal.jsEnabled) {
  $(document).ready(function() {
	  if($('#booktree')){
		  ddtreemenu.createTree("booktree", true, 5)
	  }
	  
  	if($('#le_global_today') && $('#le_global_week') && $('#le_global_this_month') && $('#le_global_overall')){
  		popularContentHideAll();
  		$('#le_global_today').show();
  	}
  });
}


function popularContentChange(value){
	popularContentHideAll();
	
	switch(value){
		case 'today':
			$('#le_global_today').show();
			break;
			
		case 'week':
			$('#le_global_week').show();
			break;
			
		case 'month':
			$('#le_global_this_month').show();
			break;
			
		case 'overall':
			$('#le_global_overall').show();
			break;
	}
}


function popularContentHideAll(){
	$('#le_global_today').hide();
	$('#le_global_week').hide();
	$('#le_global_this_month').hide();
	$('#le_global_overall').hide();
} 
