	
	/*
		LEADERBOARD SLUITEN
	*/
	function leader_close(){
		$j("#game_ban_2").hide('slow');
	}
	
	
	/*
		ZOEKEN
	*/
	
	function do_search(){
		if($j("#search").attr("value") != ''){
			document.location.href= c_url_search + escape($j("#search").attr("value"));
		}
		return false;
	}
	
	function do_search_index(){
		var search = $j("#search").attr("value");
		
		if(search != ''){
			document.location.href = 'http://www.spele.nl/zoek/' + escape(search);
		}
		return false;
	}
	
    function searchLookup( input ) 
    {
        if( input.length < 3 ) 
        {
            // Hide the suggestion box.
            $j('#suggestions').hide();
        }
        else
        {
            $j.post('ajax/autocomplete.php', {queryString: '' + input + '', country: country_code}, function( data ) {
                if( data.length > 0 ) 
                {
                    $j('#suggestions').show();
                    $j('#autoSuggestionsList').html( data );
                }
            });
        }
    }
      
    function searchFill( value ) 
    {
        $j('#search').val( value );
        //setTimeout("$j('#suggestions').hide();", 200);
        do_search();
    }
    
    function searchClose()
    {
        setTimeout("$j('#suggestions').hide();", 200);
    }
  
	/*
		SCORE
	*/
	function score_open(){
    	$j("#gs_cont").load(get_root_url() + 'ajax/score.php?id='+ c_var_id +'&lang=' + c_var_country + '&rand=' + Math.random());
    }
    
    function score_give(pScore){
    	$j("#gs_cont").load(get_root_url() + 'ajax/score.place.php?id=' + c_var_id + '&lang=' + c_var_country + '&score='+pScore + '&rand=' + Math.random());
    }
    
    /*
    	REACTIES
    */
    function reaction_reply(pToId,pTo){
		if(pToId == 0){
			$j("#react_to").html(c_tekst_react_place);
		}else{
			$j("#react_to").html(c_tekst_react_respond);
		}
		$j("#react_to_id").attr("value",pToId);
		
		$j("#react").show('slow');
		$j.scrollTo('#react_nchr', 500, {axis:'y',easing:'linear'});
		$j('#reaction').focus();
	}
	
	/*
		REACTIES OPEN / SLUITEN
	*/
	function reaction_openclose(pElem,pElem2,pImg){
		if(pElem.css('display') == 'none'){
			pElem.show('fast');
			//pElem2.show('fast');
			pImg.attr('src','i/i_reac_close.png');
		}else{
			pElem.hide('fast');
			//pElem2.hide('fast');
			pImg.attr('src','i/i_reac_open.png');
		}
	}
	
	/*
		REACTIES
	*/	
	function reaction_load(){
    	reaction_load_page(0);
    }
    
    function reaction_load_page(pPage){
    	$j("#blue_content").load(get_root_url() + 'ajax/reacties.php?id=' + c_var_id + '&lang=' + c_var_country + '&page='+pPage + '&rand=' + Math.random());
    }
	
	function reaction_place(pReaction,pId){
		$j("#blue_content").load(get_root_url() + 'ajax/reacties.php?id=' + c_var_id + '&lang=' + c_var_country + '&reaction=' + escape(pReaction) + '&reaction_id=' + escape(pId) + '&rand=' + Math.random());
	}
    
	function reaction_vote(pReaction,pVote){
		$j("#blue_content").load(get_root_url() + 'ajax/reacties.php?id=' + c_var_id + '&lang=' + c_var_country + '&reaction_id=' + escape(pReaction) + '&vote=' + escape(pVote) + '&rand=' + Math.random());
	}
	
	/*
		BLAUWE CONTENT BALK LEGEN
	*/
	function clear_content(){
		$j("#blue_content").html('<br><center><img src="i/loading.gif"></center><br>');
	}
	
	/*
		ROOT URL VAN SITE ACHTERHALEN
	*/
	function get_root_url(){
		var myloc = window.location.href;
		var locarray = myloc.split("/");
		
		var url = '';
		var i = 0
		while(i < locarray.length - 3){
			url = url + locarray[i] + "/";
			i++;
		}
		
		if(c_url_root != '') return c_url_root;
			else return url;
	}
	
	/*
		MEER GAMES
	*/
	function more_load(){
		arraytext = generateArraytext();
		$j("#blue_content").load(arraytext + "/" + c_url_more + '?rand=' + Math.random());
	}
	
	function moreGamesNav(page){
		arraytext = generateArraytext();
		
		var splittedUrl = c_url_more.split("_");
		more_link = '';
		for(i = 0; i < splittedUrl.length-1; i++){
			more_link += splittedUrl[i] + '_'; 
		}
		more_link = more_link + page + '.html';
		
	    $j("#blue_content").load(arraytext + "/" + more_link + '?rand=' + Math.random());
	}
	
	function generateArraytext()
	{
		var myloc = window.location.href;
		var locarray = myloc.split("/");
		delete locarray[(locarray.length-1)];
		var arraytext = locarray.join("/");
		return arraytext;
	}
	
	/*
		SLIDER
	*/
	function slider_event(piNewValue){
		document.getElementById('flashobj').style.width = f_w * (piNewValue / 100)+ 'px';
		document.getElementById('flashobj').style.height = f_h * (piNewValue / 100)+ 'px';
	}
	
	function slider_reset(){
		slider.setValue(100);
		slider_event(100);
	}
	
	/*
		TABS
	*/
	function openTab(pId){
		
		if(pId == 1){
			document.getElementById('tab_1').className = 'tab_on';
			$j("#blue_content").hide();
			$j("#content_description").show();
		}else{
			document.getElementById('tab_1').className = 'tab_off';
			clear_content();
			$j("#content_description").hide();
			$j("#blue_content").show();		
		}
		if(pId == 2){
			document.getElementById('tab_2').className = 'tab_on';
			reaction_load();
		}
			else document.getElementById('tab_2').className = 'tab_off';
		if(pId == 3){
			document.getElementById('tab_3').className = 'tab_on';			
			more_load();
		}
		else document.getElementById('tab_3').className = 'tab_off';
	}