jQuery(document).ready(function(){
	addGoogleStats('UA-1092064-17');
						
	jQuery("#close_tip").click(function () { 
		schowaj_tipy();
	});
	
	jQuery(".open_tips").click(function () { 
		if(jQuery.cookie('tip_open')) schowaj_tipy(); else pokaz_tipy();
	});
	
	jQuery('#fmp3').flash(
		{ src: 'http://id.joe.pl/flash/player.swf', height: 70, width: 156 },
		{ version: 7 },
		function(htmlOptions) {
			$this = jQuery(this);
			htmlOptions.flashvars.song_url = $this.attr('href');
			htmlOptions.wmode = 'transparent';
			htmlOptions.allowScriptAccess = 'always';
			$this.before(jQuery.fn.flash.transform(htmlOptions));						
		} 
	);
	jQuery('#fmp3').hide();
	
	jQuery('#fvideo').flash(
		{ height: 373, width: 620 },
		{ version: 8 },
		function(htmlOptions) {
			$this = jQuery(this);
			htmlOptions.wmode = 'transparent';
			htmlOptions.src = $this.attr('href');
			$this.before(jQuery.fn.flash.transform(htmlOptions));						
		}
	);
	jQuery('#fvideo').hide();
	
	jQuery('#gw a').click(function () {
		raterValue = jQuery(this).attr('title').split('/');
		raterValue = raterValue[0];
		jQuery.post('vote.php', { "rating": raterValue }, function(response){
			ret = response.split('#');
			jQuery('.rank_info').html(ret[0]);
			if(ret[1])jQuery('#gw_ocena').html(ret[1]);
		});
	});
	
	if(blokuj){
		jQuery('.tresc_play').disableTextSelect(); 
		jQuery('.ch_kom > p').disableTextSelect();
	}
	
	jQuery("#pobierz_play").click(function () { 
	  jQuery(".kody_play").toggle(); 
	  jQuery(this).toggleClass("kody_close_active");

	});
});

function potwierdz(msg){
	if (confirm(msg))return true;
	else return false;
}

function schowaj_tipy(){	
	jQuery(".ch_tipy").hide();
	jQuery.cookie('tip_open', '', { expires: -1, path: '/', domain: '.joe.pl', secure: false });
}

function pokaz_tipy(nocookies){
	jQuery(".ch_tipy").show();
	//jest tez wywolanie na pustym profilu 
	jQuery.cookie('tip_open', '1', { expires: 700, path: '/', domain: '.joe.pl', secure: false });
}