$(document).ready(function() {

	$(".arajanlat.btn").click(function() {
		if ($("#overlay").length > 0) {
			$("#overlay, #box").show()
			$("#overlay, #close").unbind("click").click(function() {
				$("#overlay, #box").hide()
			})
			return false;
		}
	})

	$(".tabber a").click(function() {
		$(".tabber a").removeClass("activetab").addClass("passivetab")
		$(this).removeClass("passivetab").addClass("activetab")
		$(".tabdiv").hide().eq($(this).index(".tabber a")).show()
	})
	
	
		$(".search, .newsletterTextInput").each(function() {
			jQuery.data(this, "default", $(this).val());
		}).focus(function() {
			if ($(this).val() == jQuery.data(this, "default")) {
				$(this).val("");
			}
			$(this).addClass("irokbele");
		}).blur(function() {
			if ($(this).val() == "") {
				$(this).val(jQuery.data(this, "default"));
			}
			$(this).removeClass("irokbele");
		})




})

FB.init({
   appId  : '190686617643660',
   status : true, // check login status
   cookie : true, // enable cookies to allow the server to access the session
   xfbml  : true, // parse XFBML
   oauth : true // enables OAuth 2.0
 });

function login_with_facebook() {
   FB.login(function(response) {
     if (response.authResponse) {  window.location = "/nextadmin/xfacebook/?access_token="+response.authResponse.accessToken  }
   }, {scope: 'email'});    
}
function pair_with_facebook() {
   FB.login(function(response) {
       if (response.authResponse) {  window.location = "/nextadmin/fiok/facebook_profil/parosit/?access_token="+response.authResponse.accessToken  }
   }, {scope: 'email'});    
}


