/*
	Gatherer Content Managment System
	Copyright © 2007-2009 by Eric Hokanson
	Last changed on $LastChangedDate: 2007-08-21 16:19:12 -0600 (Tue, 21 Aug 2007) $
	Revision $Revision: 29 $
	Powered by MooTools v1.2

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

function pageTransition($mod, $id) {
	new Fx.Tween('content', { property: 'opacity', duration: 'long' }).start(0).chain(
		function() {
			new Request.HTML({ url: 'ajax_content.php', method: 'get', update: 'content' }).send('mod=' + $mod + '&id=' + $id);
			this.start(1);
	});
}

function loadTips($id) {
	/* Tool Tip */
	var myTips = new Tips($id);
	myTips.addEvent('show', function(tip) {
		tip.fade('in');
	});
	myTips.addEvent('hide', function(tip) {
		tip.fade('out');
	});
}

function resizer() {
	if (Browser.Engine.trident)
		return;
	$$('.gfeed embed', '.gfeed img').each(function(el) {
		if (parseInt(el.get('width')) > 320) {
			var ratio = 320 / parseInt(el.get('width'));
			el.set('width', parseInt(el.get('width')) * ratio);
			el.set('height', parseInt(el.get('height')) * ratio);
		}
	});
}

window.addEvent('domready', function() {
    loadTips('.myTips');
});

window.addEvent('load', function() {
	resizer();
});
