if(typeof(jq) == 'undefined') {
	jq = jQuery.noConflict();
}

jq(document).ready(function($) {
	jq('noscript').remove();
});

function findLike() {
	return false;
}

var fbutils = {
	like: function(link, show, x, y) {
//		log('fbutils.like()', 'group');
		jq('#like').remove();
		
		xpos = parseInt(x);
		ypos = parseInt(y);
		
//		log('x: '+xpos);
//		log('y: '+ypos);
//		log('show: '+show);
	
		if(show == 'show') {
			link = escape(link);
			var iframsrc = '';
			
			if(String(window.location.href).match(/https/g)) {
				iframsrc = 'https://www.facebook.com/plugins/like.php?locale=pl_PL&href='+link+'&layout=button_count&show_faces=false&width=120&action=like&font=tahoma&colorscheme=light&height=21';
			} else {
				iframsrc = 'http://www.facebook.com/plugins/like.php?locale=pl_PL&href='+link+'&layout=button_count&show_faces=false&width=120&action=like&font=tahoma&colorscheme=light&height=21';
			}
			
			//
			var likeme = jq('<iframe>').attr({id: 'like', scrolling: 'no', frameborder: '0', src: iframsrc}).css({ overflow: 'hidden', width: '120px', height: '20px', position: 'absolute', zIndex: 999});
			likeme.css({top: ypos, left: xpos, border: 'none', background: '#ECEEF5', padding: '1px 0 0 1px'/*, display: 'none'*/});
			
			if(jq.browser.msie) {
				likeme.css({height: 21, width: 120});
			}
			
			jq('.flashWrapper').before(likeme);

			return true;
		}
		
//		log('fbutils.like()', 'groupEnd');
		return false;		
	},
	
	likevisible: function(v) {
		if(v == 'visible') { jq('#like').css({zIndex: 999}); } else { jq('#like').css({zIndex: 0}); }
	},
	
	movelike: function(x,y) {
		
		xpos = parseInt(x);
		ypos = parseInt(y);
		
		//xpos = xpos < 0 ? 0 : xops;
		//ypos = ypos < 0 ? 0 : ypos;
		
		jq('#like').css({top: ypos, left: xpos, zIndex: 999/*, display: 'block'*/});
	}
}

