
	free_downloadon = new Image(); free_downloadon.src = IMGbase + '/menu_free_download_' + OSlanguage + '_on.gif';
	free_downloadoff = new Image(); free_downloadoff.src = IMGbase + '/menu_free_download_' + OSlanguage + '_off.gif';

	onlineon = new Image(); onlineon.src =  IMGbase + '/menu_online_' + OSlanguage + '_on.gif';
	onlineoff = new Image(); onlineoff.src =  IMGbase + '/menu_online_' + OSlanguage + '_off.gif';

	coreon = new Image(); coreon.src =  IMGbase + '/menu_core_' + OSlanguage + '_on.gif';
	coreoff = new Image(); coreoff.src =  IMGbase + '/menu_core_' + OSlanguage + '_off.gif';

	multigameson = new Image(); multigameson.src =  IMGbase + '/menu_multigames_' + OSlanguage + '_on.gif';
	multigamesoff = new Image(); multigamesoff.src =  IMGbase + '/menu_multigames_' + OSlanguage + '_off.gif';

	join_duelon = new Image(); join_duelon.src = IMGbase + '/b_join_duel_' + OSlanguage + '_on.jpg';
	join_dueloff = new Image(); join_dueloff.src = IMGbase + '/b_join_duel_' + OSlanguage + '_off.jpg';

	downloadon = new Image(); downloadon.src = IMGbase + '/b_download_' + OSlanguage + '_on.jpg';
	downloadoff = new Image(); downloadoff.src = IMGbase + '/b_download_' + OSlanguage + '_off.jpg';

	learn_moreon = new Image(); learn_moreon.src = IMGbase + '/b_learn_more_' + OSlanguage + '_on.jpg';
	learn_moreoff = new Image(); learn_moreoff.src = IMGbase + '/b_learn_more_' + OSlanguage + '_off.jpg';

	buy_nowon = new Image(); buy_nowon.src = IMGbase + '/b_buy_now_' + OSlanguage + '_on.jpg';
	buy_nowoff = new Image(); buy_nowoff.src = IMGbase + '/b_buy_now_' + OSlanguage + '_off.jpg';

	get_gameon = new Image(); get_gameon.src = IMGbase + '/b_get_game_' + OSlanguage + '_on.jpg';
	get_gameoff = new Image(); get_gameoff.src = IMGbase + '/b_get_game_' + OSlanguage + '_off.jpg';

function turnOn(imageName) {
	if ( document.images ) {document[imageName].src = eval(imageName + 'on.src');}
}

function turnOff(imageName) {
	if ( document.images ) {document[imageName].src = eval(imageName + 'off.src');}
}

function refreshKcaptcha( id ) {
	document['kcaptcha_img_' + id ].src = document['kcaptcha_img_' + id ].src + '/';
}

function add_comment( comment_id, pn, pid, t, k, typegame ){
	if ( pn && pid && t ) {
		$('message' + comment_id ).innerHTML = '<center><img src="' + IMGbase +  '/loading.gif" align=absmiddle> Add comment...</center>';
		var req = new JsHttpRequest();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if ( req.responseJS.result ) {
					$('message' + comment_id ).innerHTML = req.responseJS.message;
					$('kcaptcha').value = '';
					$('text').value = '';
					get_comments( pn, pid, typegame, 0 );
					document['kcaptcha_img_' + comment_id ].src = URLhome + 'kcaptcha';
				}else{
					$('message' + comment_id ).innerHTML = req.responseJS.message;
				}
			}
		}
		req.open( 'POST', URLhome + 'ajax/ajax_comment.php', true );
		req.send( { pn: pn, pid: pid, t: t, k: k, comment_id: comment_id, typegame: typegame } );
	}else{
		alert('Invalid data');
	}

}

function get_comments( type, idrecord, getrating ) {
	if( type && idrecord ) {
		$('all_comments').innerHTML = '<center><img src="' + IMGbase + '/loading.gif" align=absmiddle> ' + Loading + '...</center>';
		var req = new JsHttpRequest();
		req.onreadystatechange = function() {
			if( req.readyState == 4 ) {
				$('all_comments').innerHTML = req.responseJS.result;
				if( req.responseJS.rate ) {
					$('ratingformfield').innerHTML = req.responseJS.rate;
				}
			}
		}
		req.open( 'POST', URLhome + 'ajax/ajax_comment.php', true );
		req.send( { getcomments: type, idrecord: idrecord, getrating: getrating } );
	}
}

function SetVote( visitor ) {
	var d = document.vote;
	var count = d.length;
	var answer = 0;
	for ( i=0;i<count;i++ ){
		if ( d.elements[i].name=='answer' && d.elements[i].checked ){
			answer = d.elements[i].value;
		}
	}
	if ( answer ){
		$('bvote').disable();
		var ajax = new Ajax.Updater( { success: 'vote' }, URLhome + 'ajax/ajax_vote.php', { method: 'POST', parameters: 'setvote=' + answer + '&visitor=' + visitor } );
	}
}

function SetCommentVote( type, comment ) {
	if ( type && comment ) {
		$('comment_vote_'+comment).innerHTML = '<img src="' + IMGbase + '/loading.gif" align=absmiddle';
		var req = new JsHttpRequest();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				$('comment_vote_'+comment).innerHTML = req.responseJS.result;
			}
		}
		req.open( 'POST', URLhome + 'ajax/ajax_comment.php', true );
		req.send( { comment_voice: type, comment: comment } );
	}
}

function SetRating( hashid, rate ){
	$('ratingformfield').innerHTML = '<center><img src="' + IMGbase + '/loading.gif" align=absmiddle> ' + Loading + '...</center>';
	var req = new JsHttpRequest();
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			$('ratingformfield').innerHTML = req.responseJS.result;
		}
	}
	req.open( 'POST', URLhome + 'ajax/ajax_rating.php', true );
	req.send( { hashid: hashid, rate: rate } );
}

function SendReply( hid ){
	var message_reply = $F('message_reply');
	if ( message_reply && hid ){
		$('button_send').disable();
		$('message_reply').disable();

		var req = new JsHttpRequest();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				$('result_reply').innerHTML = req.responseJS.result;
				$('button_send').enable();
				$('message_reply').enable();
				$('message_reply').value = '';
			}
		}
		req.open( 'POST', URLhome + 'ajax/ajax_mygamecentrix.php', true );
		req.send( { hid: hid, message_reply: message_reply } );

	}
}

function ChooseAll(){
	var f = document.letters;
	var count = f.length;
	var c = f.all.checked;
	for ( i=0;i<count;i++ ){
		if ( f.elements[i].name=='letter' ){f.elements[i].checked = c;}
	}
}

function DeleteLetters( list ){
	if ( !list ){
		var list = '';
		var f = document.letters;
		var count = f.length;
		for ( i=0;i<count;i++ ){
			if ( f.elements[i].name=='letter' && f.elements[i].checked==true ){list+= f.elements[i].value + ',';}
		}
	}
	if ( list ){
		var req = new JsHttpRequest();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				self.document.location = URLhome + 'mygamecentrix/mail';
			}
		}
		req.open( 'POST', URLhome + 'ajax/ajax_mygamecentrix.php', true );
		req.send( { delteletters: list } );
	}
}

var timerID = '';
var flagHide = '';
var containerReview = new Array();

function getShortReviewInfo(hashid) {
	if( containerReview[hashid] == undefined ) {
		var req = new JsHttpRequest();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				containerReview[hashid] = req.responseJS.result
				$('reviewinfo').innerHTML = req.responseJS.result;
			}
		}
		req.open( 'POST', URLhome + 'ajax/ajax_getinfo.php', true );
		req.send( { hashid: hashid } );
	} else {
		$('reviewinfo').innerHTML = containerReview[hashid];
	}
	if( flagHide == '' ) {
		$('reviewinfo').style.display = 'block';
	}
}

function showReviewInfo(e,hashid,bloc) {
	stophide();
	var ie = document.all ? true : false;
	var left = 6;
	var top = 6;
	var maxw = 320;
	var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
	var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
	var wHeight = 0;
	if( self.innerWidth ) {
		wHeight = self.innerHeight;
	} else if(document.documentElement && document.documentElement.clientHeight ) {
    wHeight = document.documentElement.clientHeight;
	} else if( document.body ) {
    wHeight = document.body.clientHeight;
	}

	l = bloc == 'top10' ? l - ( maxw + left ) : ( l  + left );
	u = ( wHeight - u ) < maxw ? ( u - maxw ) : u;

	$('reviewinfo').style.top = u + 'px';
	$('reviewinfo').style.left = l + 'px';

	if( containerReview[hashid] == undefined ) {
		$('reviewinfo').innerHTML = '<center>' + Loading + '...</center>';
		if( flagHide == '' ) {
			timerID = setTimeout("getShortReviewInfo('" + hashid + "')",1500);
		}
	} else {
		$('reviewinfo').innerHTML = containerReview[hashid];
		if( $('reviewinfo').style.display == 'none' ) {
			if( flagHide == '' ) {
				timerID = setTimeout("getShortReviewInfo('" + hashid + "')",1500);
			}
		}
	}
}

function hideReviewInfo(v) {
	if( v == 0 ) {
		flagHide = 1;
		timerID = setInterval("hideReviewInfo(1)",3000);
	} else {
			$('reviewinfo').style.display = 'none';
	}
}

function stophide() {
	flagHide = '';
	clearInterval( timerID );
	clearTimeout( timerID );
}