/*
-----------------------------------------------------------------
JomPress - Framework

Copyright (C) 2010 Studio Vikram Rao. All Rights Reserved.
License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
Website: http://www.jompress.com
Support: support@jompress.com   
-----------------------------------------------------------------
Template - CSS Document
Here in this document you will find all the Common
Elements used in this template.
-----------------------------------------------------------------
*/

jQuery.noConflict();(function($){$(function() {
	
// Remove Module and Column Tags from the Menu
$('ul.menu li:not(:has(li))').addClass(function () {
	return (($('span.separator', this).length) ? 'seplink': (($('a[href]', this).length) ? 'anclink': null))
});

// Equal Height Columns
String.prototype.capitalize = function () {
	return this.replace(/^(.)/, function (c) {
		return c.toUpperCase()
	})
};
$.fn.equalize = function (b) {
	if (!b) {
		b = 'height'
	}
	var c = 0;
	var d = (typeof document.body.style.maxHeight != 'undefined' ? 'min' + b.capitalize() : b);
	var e = 'offset' + b.capitalize();
	this.each(function () {
		var a = parseInt(this[e]);
		if (a > c) {
			c = a
		}
	});
	this.each(function () {
		$(this).css(d, c - (parseInt(this[e]) - $(this)[b]()))
	});
	return c
};

// Page Scroll
var special = jQuery.event.special,
uid1 = 'D' + ( + new Date()),
uid2 = 'D' + ( + new Date() + 1);
special.scrollstart = {
	setup: function () {
		var c, handler = function (a) {
			var b = this,
			_args = arguments;
			if (c) {
				clearTimeout(c)
			} else {
				a.type = 'scrollstart';
				jQuery.event.handle.apply(b, _args)
			}
			c = setTimeout(function () {
				c = null
			},
			special.scrollstop.latency)
		};
		jQuery(this).bind('scroll', handler).data(uid1, handler)
	},
	teardown: function () {
		jQuery(this).unbind('scroll', jQuery(this).data(uid1))
	}
};
special.scrollstop = {
	latency: 300,
	setup: function () {
		var c, handler = function (a) {
			var b = this,
			_args = arguments;
			if (c) {
				clearTimeout(c)
			}
			c = setTimeout(function () {
				c = null;
				a.type = 'scrollstop';
				jQuery.event.handle.apply(b, _args)
			},
			special.scrollstop.latency)
		};
		jQuery(this).bind('scroll', handler).data(uid2, handler)
	},
	teardown: function () {
		jQuery(this).unbind('scroll', jQuery(this).data(uid2))
	}
};
var $elem = $('html');
$('#jp-pageup').fadeIn('slow');
$('#jp-pagedown').fadeIn('slow');
$(window).bind('scrollstart', function () {
	$('#jp-pageup,#jp-pagedown').stop().animate({
		'opacity': '0.2'
	})
});
$(window).bind('scrollstop', function () {
	$('#jp-pageup,#jp-pagedown').stop().animate({
		'opacity': '1'
	})
});
$('#jp-pagedown').click(function (e) {
	$('html, body').animate({
		scrollTop: $elem.height()
	},
	800)
});
$('#jp-pageup').click(function (e) {
	$('html, body').animate({
		scrollTop: '0px'
	},
	800)
});
});})(jQuery);
