$(document).ready(function(){
  openComment(1);
  //$(document).pngFix();

//  $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
//  if ($.browser.chrome)
//  {
//    $("#ads").css("margin-top", "-20%");
//  }
//  $('iframe#iFrame-ads').attr({src: $('iframe#iFrame-ads').attr("src")});
});

function openComment(x){
  if((x*1) == 1){$('#facebook_comment_box_right').fadeIn(700);}
  else {
    $('#facebook_comment_box_right').fadeOut(700);
    $('#facebook_comment_box_right_comment_box').fadeIn(700);
  }
  return false;
}

function openTag(tag)
{
  //auto close
  var listTag=new Array("#b-register","#refill","#index");
  //var i=0;
  for (var i=0;i<3;i++) {
    if(tag != listTag[i]) {
      closeTag(listTag[i]);
      //break;
    }
  }

  var tagConvert = 'iframe#iframe-'+tag.substr(1);
  $(tagConvert).attr({
    src: $(tagConvert).attr("src")
  });
  
  $(tag).slideDown(1500,"easeOutExpo");
  $(tag).css({display: ""});
  return false;
}

function closeTag(tag)
{
  $(tag).slideUp(1300,"easeOutExpo");
  $(tag).css({display: "none"});
  return false;
}

function searchCss(x)
{
  if((x*1) == 1){
    $("#search-label").css("display", "none");
  }
  else{
    var value = $('#search_input').attr('value');
    if(value == "" || value == "none"){
      $("#search-label").css("display", "");
    }
  }
}


$(function() {
  $("#tabs").tabs();
});

//facebook
function resizeWindow()
{
//var b = $('#avatar-webpage-new-14_').innerWidth();
//c = (b-10)+'px';
//$('#avatar-webpage-new-14_ iframe').css("width", c);
}

window.fbAsyncInit = function() {
FB.init({appId: '157282437621814', status: true, cookie: true,xfbml: true});
FB.Event.subscribe('xfbml.render', resizeWindow);
};

(function()
{
 var e = document.createElement('script');
 e.async = true;
 e.src = document.location.protocol +
   '//connect.facebook.net/en_US/all.js';
 document.getElementById('fb-root').appendChild(e);
}());
//facebook

//google
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8042742-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//google

