function rowOverEffect(object) {
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
function checkBox(object) {
document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
}
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=120,screenX=150,screenY=150,top=150,left=150')
}

$(document).ready(function(){
$(window).bind('load', function(){

	$('#master').css({
		'display':'block'
	});
	$('.handle-overlay').css({
		'display':'none'
	});
	$('.handle-image').mouseover(function(){
		$(this).parent().siblings('.handle-overlay').css({
			'display':'inline'
		});
	});
	$('.handle-image').mouseout(function(){
		$(this).parent().siblings('.handle-overlay').css({
			'display':'none'
		});
	});
	$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
		return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	$('a[rel*=external]').attr('target', '_blank');
	$("ul.sf-menu").superfish();
	$('[data-liquid]').each(function(){
		var parent = $(this).parent();
		var siblings = $(this).siblings();
		var pwidth = $(parent).innerWidth();
		var swidth = 0;
		var nwidth;
		var css = {};
		siblings.each(function(){
		swidth += $(this).outerWidth();
		});
		nwidth = (pwidth - swidth);
		css['width'] = nwidth;
		$(this).css(css);
	});
	$('[data-align]').each(function(){
		var left = null;
		var right = null;
		var top = null;
		var bottom = null;
		var parent = $(this).parent();
		var css = {};
		if($(this).attr('data-align') == 'both' || $(this).attr('data-align') == 'center'){
		var cwidth = $(this).innerWidth();
		var pwidth = $(parent).innerWidth();
		css['left'] = (pwidth / 2) - (cwidth / 2);
		} else {
		if($(this).attr('data-left') != null) css['left'] = $(this).attr('data-left');
		if($(this).attr('data-right') != null) css['right'] = $(this).attr('data-right');
		}
		if($(this).attr('data-align') == 'both' || $(this).attr('data-align') == 'middle'){
		var cheight = $(this).innerHeight();
		var pheight = $(parent).innerHeight();
		css['top'] = (pheight / 2) - (cheight / 2);
		} else {
		if($(this).attr('data-top') != null) css['top'] = $(this).attr('data-top');
		if($(this).attr('data-bottom') != null) css['bottom'] = $(this).attr('data-bottom');
		}
		$(this).css(css);
	});
	$('[data-on]').each(function(){
		var on = $(this).attr('data-on');
		var off = $(this).attr('data-off');
		var css = {};
		$(this).mouseover(function(){
		if($(this).attr('data-left') != null) css['left'] = $(this).attr('data-left');
		css['cursor'] = 'pointer';
		$(this).css(css);
		$(this).attr('src', on);
		});
		$(this).mouseout(function(){
		if($(this).attr('data-left') != null) css['left'] = 0;
		css['cursor'] = 'pointer';
		$(this).css(css);
		$(this).attr('src', off);
		});
	});

});
});
