	google.load('orkut.share', '1');


	function show_facebook(url, titulo) {
		texto = getTexto(window.location.hash);
                titulo = getTitulo(window.location.hash);
                //url = url.replace('index.html', '') + '?t=' + titulo + '&d=' + texto;               
                url = url.replace('index.html', '');
		window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(url), 'sharer', 'toolbar=0,status=0,width=626,height=436');
        }

	function getTitulo(url) {
		if (url.indexOf('xburger') > -1) {
			return 'Hot Pocket X-Burguer';
		}
		if (url.indexOf('xfrango') > -1) {
			return 'Hot Pocket X-Frango';
		}
		if (url.indexOf('xbacon') > -1) {
			return 'Hot Pocket X-Bacon';
		}
		if (url.indexOf('xcalabresa') > -1) {
			return 'Hot Pocket X-Calabresa';
		}
		if (url.indexOf('xpicanha') > -1) {
			return 'Hot Pocket X-Picanha';
		}
		if (url.indexOf('rolls/frango') > -1) {
			return 'Hot Pocket Roll Frango com Requeijão';
		}
		if (url.indexOf('rolls/calabresa') > -1) {
			return 'Hot Pocket Roll Calabresa com Requeijão';
		}
		if (url.indexOf('presunto') > -1) {
			return 'Hot Pocket Roll Presunto com Requeijão';
		}
		if (url.indexOf('frango') > -1) {
			return 'Hot Pocket Pizza Frango com Requeijão';
		}
		if (url.indexOf('calabresa') > -1) {
			return 'Hot Pocket Pizza Calabresa';
		}
		//Qualquer outro resultado
		return 'Quem se vira, se dá bem.';	
	}
	
	function getTexto(url) {
		if (url.indexOf('xburger') > -1) {
			return 'Quem se vira com Hot Pocket X-Burguer, se dá bem. Clique e confira ';
		}
		if (url.indexOf('xfrango') > -1) {
			return 'Quem se vira com Hot Pocket X-Frango, se dá bem. Clique e confira ';
		}
		if (url.indexOf('xbacon') > -1) {
			return 'Quem se vira com Hot Pocket X-Bacon, se dá bem. Clique e confira ';
		}
		if (url.indexOf('xcalabresa') > -1) {
			return 'Quem se vira com Hot Pocket X-Calabresa, se dá bem. Clique e confira ';
		}
		if (url.indexOf('xpicanha') > -1) {
			return 'Quem se vira com Hot Pocket X-Picanha, se dá bem. Clique e confira';
      		}
		if (url.indexOf('rolls/frango') > -1) {
			return 'Quem se vira com Hot Pocket Roll Frango com Requeijão, se dá bem. Clique e confira ';
		}
		if (url.indexOf('rolls/calabresa') > -1) {
			return 'Quem se vira com Hot Pocket Roll Calabresa com Requeijão, se dá bem. Clique e confira ';
		}
		if (url.indexOf('presunto') > -1) {
			return 'Quem se vira com Hot Pocket Roll Presunto com Requeijão, se dá bem. Clique e confira ';
		}
		if (url.indexOf('frango') > -1) {
			return 'Quem se vira com Hot Pocket Pizza Frango  com Requeijão, se dá bem. Clique e confira';
		}
		if (url.indexOf('calabresa') > -1) {
			return 'Quem se vira com Hot Pocket Pizza Calabresa, se dá bem. Clique e confira ';
		}
		//Qualquer outro resultado
		return 'Quem se vira, se dá bem.';	
	}

	function show_orkut() {
		var params = {};
		url = window.location.href;
		url = url.replace('#/','');
		params[google.orkut.share.Field.TITLE] = getTitulo(window.location.hash);
		params[google.orkut.share.Field.DESTINATION_URL] = url;
		params[google.orkut.share.Field.CONTENT] = getTexto(window.location.hash) + ' ' + url;
		var connection = new google.orkut.share.Connection(params);
		connection.send('orkut.com', {});
		return (itulo = '|' + texto + '|' + url);
	};

	function alterar_titulo(titulo) {
		document.title = getTitulo(window.location.hash);
	}
	
	ExibeBotao = function(lnkProduto)
	{
		var lnkFacebook;
		$("#btnFaceBook").hide();
		$("#btnFaceBook iframe").removeAttr("src");
		
		lnkFacebook = 'like.jsp?u=' + lnkProduto;
	
		$("#btnFaceBook").show();
		$("#btnFaceBook iframe").attr("src",lnkFacebook);
		
	};

	OcultaBotao = function()
	{
		$("#btnFaceBook").hide();
	};

	function show_twitter(url) {

		window.twttr = window.twttr || {};

		var D = 550, A = 450, C = screen.height, B = screen.width, H = Math

				.round((B / 2) - (D / 2)), G = 0, F = document, E;

		if (C > A) {

			G = Math.round((C / 2) - (A / 2))

		}

		//Concertando erro do flash

		url = url.replace('index.html#/','');

		texto = getTexto(window.location.hash);

		//IE

		if ($.browser.msie ) {

			window.open('http://twitter.com/share?text='+ texto + '&url=' + url, 'ShareTwitter', 'left=' + H + ',top=' + G + ',width=' + D + ',height=' + A + ',personalbar=0,toolbar=0,scrollbars=1,resizable=1');

		} 

		else

		{

			window.twttr.shareWin = window.open('http://twitter.com/share?text='+ texto + '&url=' + url, 'left=' + H + ',top=' + G + ',width=' + D + ',height=' + A

			+ ',personalbar=0,toolbar=0,scrollbars=1,resizable=1');

		}

}

