var GLOBAL = {
	base_url: 'http://www.cnc-arena.com/forum/index.php?',
	img_path: 'http://www.cnc-arena.com/forum/style_images/7/'
}
function showTooltip(text) {
	Tip(text.replace('\n', ''), BALLOON, true, BALLOONIMGPATH, 'http://www.cnc-arena.com/js/wz_tooltip/tip_balloon', BALLOONIMGEXT, 'png', BALLOONSTEMHEIGHT, 9, ABOVE, true, OFFSETX, -17, TEXTALIGN, 'justify', PADDING, 6, FONTFACE, 'Arial', FONTCOLOR, '#626262');
}
function hideTooltip() {
	UnTip();
}
function showTooltipSticky(text, width) {
	if(width)
		Tip(text.replace('\n', ''), BALLOON, true, BALLOONIMGPATH, 'http://www.cnc-arena.com/js/wz_tooltip/tip_balloon', BALLOONIMGEXT, 'png', BALLOONSTEMHEIGHT, 9, ABOVE, true, OFFSETX, -17, TEXTALIGN, 'justify', PADDING, 8, MOUSESTICKY, true, FONTFACE, 'Arial', FONTCOLOR, '#626262', WIDTH, width);
	else
		Tip(text.replace('\n', ''), BALLOON, true, BALLOONIMGPATH, 'http://www.cnc-arena.com/js/wz_tooltip/tip_balloon', BALLOONIMGEXT, 'png', BALLOONSTEMHEIGHT, 9, ABOVE, true, OFFSETX, -17, TEXTALIGN, 'justify', PADDING, 8, MOUSESTICKY, true, FONTFACE, 'Arial', FONTCOLOR, '#626262');
}
function hideTooltipSticky(event) {
	UnTipSticky(event);
}
function showMOrow(elem) {
	if(elem.style.backgroundColor != undefined) 
		elem.style.backgroundColor = '#ECECEC';
}
function hideMOrow(elem) {
	if(elem.style.backgroundColor != undefined) 
		elem.style.backgroundColor = '';
}
function popupChat() {
	if ( mid || mid != 0 ) {
		// the size of the popup window
		var width = 800;
		var height = 600;
		
		// the x,y position of the popup window
		// NOTE: this formula will auto-center the popup on the screen
		var y = (screen.height - height) / 2;
		var x = (screen.width - width) / 2;
		
		var url = '../chat/flashchat.php';
		var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';
		
		// open the chat window as a popup, instead of embedded in webpage
		window.open( url, 'chat', options );
	} else {
		window.location = "{$this->ipsclass->base_url}act=Reg&CODE=00";
	}
}

// LOAD ON DOCUMENT READY
$(document).ready(function() {
	$('.languagebutton').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(500, 1);
	  }, function () {
	    $span.stop().fadeTo(500, 0);
	  });
	});
});
