<!--
isnum=function(x) {
    if((x>=48 && x<=57) || (x>=96 && x<=105)  || x==46 || x==8) {
       return true;
     }
     return false; 
}

formatsumm=function(x) {
	x=''+x;
	var s='';
	var j=0;
	var k=x.indexOf('.');
	if(k<0) k=x.length;
	else s=x.substr(k,2)
	for(var i=k-1;i>=0;i--) {
		if(j++==3) {
			j=1;
			s='&nbsp;'+s;
		}
		s=x.charAt(i)+s;
	}
	return s;
}

if (!window.opera) {
	try {
	  document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
}

prev = 0;
var iii = 1;
function runZ() {
	if (iii>6) iii = 1;
	objIn = $('#zzz_btn'+iii);
	(prev==0) ? swapZ(objIn,"timer") : t1 = setTimeout('swapZ(objIn,"timer")', 6000);
}

function swapZ(obj,action) {
	if (action=='click') {
		if (typeof(t1)!='undefined') clearTimeout(t1);
		if (typeof(t2)!='undefined') clearTimeout(t2);
		iii = 1;
		t2 = setTimeout('runZ()', 10000);
	}
	if (!$(obj).hasClass('act')) {
		kurt = $(obj).attr('id')
        //if(kurt==null) return false;
        kurt=kurt.charAt(7);
		if (prev!=0) {
			$('#zzz_btn'+prev).toggleClass('act');
			$('#zzz'+prev).add('#zzz_act').hide();
		}
		$('#zzz'+kurt).fadeIn('fast');
		$(obj).toggleClass('act');
		$('#zzz_act').css('right',360-$(obj).position().left-$(obj).width()+(parseInt(($(obj).width()-36)/2))+'px');
		(-[1,]) ? $('#zzz_act').fadeIn('slow') : $('#zzz_act').show();
		prev = kurt;
	}
	if (action=='timer') {
		iii++;
		runZ();
	}
}

inits=[];

$(document).ready(
	function() {
		$('#zzz_btns a').mouseover(function(){
			$(this).toggleClass('cur');
		});
		$('#zzz_btns a').mouseout(function(){
			$(this).toggleClass('cur');
		});
		if ($('#main_banner').length>0) {
			$('#zzz_btns a').click(function(){
				swapZ(this,'click');
				return false;
			});
			runZ();
		}
		if ($('#client_pop').length>0) {
			popObj = $('#client_pop');
			popObjText = $('#client_pop_txt');
			$('div.client_container_block a').mouseover(function(){
				popParent = $(this).parents('div.client_container_block');
				popContent = $(popParent).children('span');
				if ($(popContent).length>0) {
					popSpecial = ($(popParent).children('div.client_container_special').length>0) ? true: false;
					if ($(this).height()>16)
						(popSpecial) ? $(popObj).css('bottom','52px') : $(popObj).css('bottom','44px');
					else
						(popSpecial) ? $(popObj).css('bottom','36px') : false;
					$(popObjText).html($(popContent).html());
					$(this).clone().prependTo(popObjText);
					$(popObj).appendTo($(popParent));
					$(popObj).show();
					$(this).mouseout(function(){
						$(popObj).hide().removeAttr('style');
					});
				}
			});
		}
		if ($('#main_award').length>0) {
			$('div.main_award_btn a').click(function(){
				return false;
			});
			$('#main_award_in2').css('width',162*$('#main_award li').length+'px')
			$('#main_award').smoothDivScroll({scrollWrapper: '#main_award_in1', scrollableArea: '#main_award_in2', scrollStep: 2, mouseDownSpeedBooster: 1});
		}
		$('#curr tr:first').children().css('border','none');
		$('#curr tr:last').children().css('border-bottom','none');
		$('#curr tr').not(':first').each(function(){
			$(this).find('th:first').css('border-left','none');
			$(this).find('th:last').css('border-right','none');
		});
		$('#client_priv').add('#client_corp').click(function(){
			($(this).next().is(':hidden')) ? $(this).next().show() : $(this).next().hide();
			return false;
		});
		$('#client_priv').click();
		
		$('#btm_print a').click(function(){
			window.print();
			return false;
		});
		
		if ($('#head_link li').length>0) {
			headLink = $('#head_link li a');
			headBtn = $('#head_link #zzz_btns a');
			$(headLink).mouseover(function(){
				$(headBtn[$(headLink).index(this)]).toggleClass('cur');
			});
			$(headLink).mouseout(function(){
				$(headBtn[$(headLink).index(this)]).toggleClass('cur');
			});
		}
			
		$('td.ct1_mid a').click(function(){
			coinsBlock = $(this).parent().parent().parent().prev().find('.ct1_right_container div');
			coinsAll = $(coinsBlock).find('li');
			if (coinsAll.length>4) {
				z =  0-((coinsAll.length-4)*136);
				coinsPos = parseInt($(coinsBlock).css('left'));
				($(this).hasClass('ct1_right_btn1')) ? coinsPos = coinsPos-136 : coinsPos = coinsPos+136;
				if ((coinsPos<=0)&&(coinsPos>=z))
					$(coinsBlock).animate({left: coinsPos+'px'});
			}
			return false;
		});
		$('#coin_table2 div:first').remove();
		$('#coin_table2 h2:first').css('padding-right',$('#content_selector select').width()+25+'px');
		$('a.drop_btn').click(function(){
			$(this).toggleClass('cur');
			$(this).parent().next().toggle();
			return false;
		});
		$("a.lightbox").lightbox();
        
        for(var i=0;i<inits.length;i++) inits[i]();
	}
);


// -->

