function printPage() {
	window.print();
}
/***
@title:
Equal Height

@version:
2.0

@author:
Andreas Lagerkvist

@date:
2008-09-16

@url:
http://andreaslagerkvist.com/jquery/equal-height/

@license:
http://creativecommons.org/licenses/by/3.0/

@copyright:
2008 Andreas Lagerkvist (andreaslagerkvist.com)

@requires:
jquery

@does:
This plug-in makes HTML-elements equal height by adjusting their min-height CSS properties. Of course IE6 has no clue what min-height means so the plug-in uses height for that crappy old dinosaur.

@howto:
jQuery('#content, #secondary-content').equalHeight(); would make the elements with IDs 'content' and 'secondary-content' equal height.

@exampleHTML:
<p>Hi</p>

<p>Hi<br />Bye!</p>

@exampleJS:
jQuery('#jquery-equal-height-example p').equalHeight();
***/
jQuery.fn.equalHeight = function () {
	var height		= 0;
	var maxHeight	= 0;

	// Store the tallest element's height
	this.each(function () {
		height		= jQuery(this).outerHeight();
		maxHeight	= (height > maxHeight) ? height : maxHeight;
	});

	// Set element's min-height to tallest element's height
	return this.each(function () {
		var t			= jQuery(this);
		var minHeight	= maxHeight - (t.outerHeight() - t.height());
		var property	= jQuery.browser.msie && jQuery.browser.version < 7 ? 'height' : 'min-height';

		t.css(property, minHeight + 'px');
	});
};

$(function(){
	jQuery('#wrapper-1 .category-box #box-row-0 .box .body').equalHeight();
	jQuery('#wrapper-1 .category-box #box-row-1 .box .body').equalHeight();
});
$(function(){
	$('.popular-box .popular:last').addClass('last');
	$('.data-box .body table tr:last').addClass('last');
	$('.post:last').addClass('last');
	$('.comments-list ul li:last').addClass('last');
	$('.table-1 tr:last').addClass('last');
	$('.table-2 tr:last').addClass('last');
	$('.table-4 tr:last-child').addClass('last');
});
// jQuery Simple Drop-Down Menu Plugin
// http://javascript-array.com/scripts/jquery_simple_drop_down_menu/
$(function() {
	
	var timeout         = 800;
	var closetimer		= 40;
	var ddmenuitem      = 0;

	function jsddm_open(){
		jsddm_canceltimer();
		jsddm_close();
		ddmenuitem = $(this).find('.tip').css('visibility', 'visible');
		$(this).addClass('hover');
	}

	function jsddm_close(){
		if(ddmenuitem){
			ddmenuitem.css('visibility', 'hidden');
			$('.meta-options li.share a').parent('li').removeClass('hover');
		}
	}

	function jsddm_timer()
	{	closetimer = window.setTimeout(jsddm_close, timeout);}

	function jsddm_canceltimer()
	{	if(closetimer)
		{	window.clearTimeout(closetimer);
			closetimer = null;}}

	$(document).ready(function()
	{	$('.meta-options > li').bind('mouseover', jsddm_open);
		$('.meta-options > li').bind('mouseout',  jsddm_timer);});

	document.onclick = jsddm_close;

});
$(document).ready(function(){
	$(".table-3 .expand").click(function(){
		var rootTr = $(this).parents('tr');
		var rootTrSub = $(this).parents('tr').next('.tr-details');
		
		if($(rootTrSub).find(".table-4").is(":hidden")){
			$(rootTrSub).find(".table-4").css('opacity','0');
			$(rootTrSub).find(".table-4").animate({ 
				opacity: 1
			}, 1000 );
			$(rootTrSub).find(".table-4").css('display','block');
			$(rootTr).addClass('active');
			$(rootTrSub).addClass('active');
			$(this).addClass('collapse');
			$(this).attr('title','collapse');
			$(this).text('collapse');
		}
		else {
			$(rootTrSub).find(".table-4").animate({ 
				opacity: 0
			}, 1000 );
			$(rootTrSub).find(".table-4").css('display','none');
			$(rootTr).removeClass('active');
			$(rootTrSub).removeClass('active');
			$(this).removeClass('collapse');
			$(this).attr('title','expand');
			$(this).text('expand');
		}
		return false;
	});
});

$(function() {
	$('a.help').qtip({
		content: {
			text: false // Use each elements title attribute
		},
		position: {
			adjust: { 
				screen: true,
				scroll: false
			}
		},
		style: {
			name: 'cream',
			width: { 
				max: 150,
				min: 60
			}
		}
	});
});
//jQuery: hide title '.help, .hoverbox' & alt 'a img'
this.hidetitle = function(){	
	$('a.help').hover(function(){
		this.t = this.title;
		this.title = "";
	},
	function(){
		this.title = this.t;
	});
};
//jQuery: a.help stop event handler 
$(function() {
	$("a.help").click(function(event){
		event.preventDefault();
	});
});
// starting the script on page load
$(function() {
	hidetitle();
});

function showGradientHeader(){
	if ($("#intro h2").length > 0){
		$('#intro h2').each(function(i) {
			var text = $(this).html();
			var text2 = $(this).find('a').html();
			$(this).html('<span class="gradient"></span>'+text+'');
			if($(this).find('a')){
				$(this).find('a').addClass('normal');
				$(this).find('a').css('display', 'block');
				$(this).find('a').html('<span class="gradient"></span>'+text2+'');
			}
		});
	};
};
$(function() {
	showGradientHeader();
});
