function bookmarksite(title, url){
  if (document.all)
  window.external.AddFavorite(url, title);
  else if (window.sidebar)
  window.sidebar.addPanel(title, url, "")
}

//Popup
/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
//Popup


function showMaps(unidade){
  $('#popup iframe').attr('src','googlemaps.php?unidade='+unidade);
	$('#popup').modal({
    overlay:80
  });
}

  	// <![CDATA[
		$.easing.easeOutQuart = function (x, t, b, c, d) {
			return -c * ((t=t/d-1)*t*t*t - 1) + b;
		};

		jQuery(function( $ ){
			$('#listEventos').serialScroll({
				items:'a',
				prev:'#eventos_patrocinadores a.left',
				next:'#eventos_patrocinadores a.right',
				axis:'x',
				offset:-100, //when scrolling to photo, stop 230 before reaching it (from the left)
				start:1, //as we are centering it, start at the 2nd
				duration:500,
				force:true,
				stop:true,
				lock:false,
				cycle:true, //don't pull back once you reach the end
				easing:'easeOutQuart', //use this easing equation for a funny effect
				jump: false //click on the images to scroll to them
			});
      $('div#duplasPresentation a').mouseover(function (e) {
        var index = $('div#duplasPresentation a').index(this);
        var getBox = 'div#duplasPresentation a:eq('+index+')';
        origTitle = $(getBox).attr('title');
        $(getBox).attr('origTitle', origTitle);
        var parts = origTitle.split(' - ');
        if(index >= 10){
          getDesc = 'div#duplaBaloonRev';
          var getPos = (index * 49) + 11;
          $(getDesc).addClass('reverse');
        } else {
          getDesc = 'div#duplaBaloon';
          var getPos = (index * 49) + 288;
        }
        $(getDesc + ' strong').html(parts[0]);
        $(getDesc + ' span').html(parts[1]);
        $(getBox).addClass('hover');
        $(getDesc).css({
          display: "block",
          left: getPos
        });
        $(getBox).alt = '';
        $(getBox).attr('title','');
      });
      $('div#duplasPresentation a').mouseout(function (e) {
        var index = $('div#duplasPresentation a').index(this);
        var getBox = 'div#duplasPresentation a:eq('+index+')';
        $(getBox).removeClass('hover');
        origTitle = $(getBox).attr('origTitle');
        $(getBox).attr('title', origTitle);
        $(getDesc).removeClass('reverse');
        $(getDesc).css('display','none');
      });
		});
  	// ]]>

function showGen(getPage){
   $('body').append('<div id="popup"><!-- --></div>');
   $('#popup').html('<iframe src="'+getPage+'" frameborder="0" width="600" height="450"></iframe>');
	$('#popup').modal({
    overlay:80
  });
}

function printIt(getSlug){
  $.post("print.php",{
    title: $('div#subColA h1').html(),
    content: $('div#subColA div.txt').html(),
    siteName: 'World Cosplay Summit - Etapa JBC Brasil',
    siteURL: 'http://henshin.uol.com.br/wcs',
    slug: getSlug
  },function(html){
    $('body *').css('display','none');
    $('body').css('background','transparent none');
    $('body').append('<div id="print"><!-- --></div>');
    $('#print').css('display','block');
    $('#print').html(html);
    $('#print div.boxCatalogo').css('display','block'); //para formatar conteúdos específicos
  });
}
