﻿var fbConnectBtn='<a href="#" onclick="FB.Connect.requireSession(); return false;" ><img border="0" id="fb_login_image" src="http://wiki.developers.facebook.com/images/6/6f/Connect_iphone.png" alt="Connect"/></a>';
function onFBConnected() {
    if(document.getElementById('fbConnect'))
        document.getElementById('fbConnect').innerHTML="";
    if(document.getElementById("fbProfilePic"))
        document.getElementById("fbProfilePic").style.display="";
        
} 
function onFBNotConnected() { 
     FB.ensureInit(function() {
        FB.Connect.get_status().waitUntilReady(function(status) {
            if (status == FB.ConnectState.userNotLoggedIn && document.getElementById('fbConnect') )    {
                document.getElementById('fbConnect').innerHTML=fbConnectBtn;
            }
            if (status == FB.ConnectState.appNotAuthorized && document.getElementById('fbConnect'))    {
                document.getElementById('fbConnect').innerHTML=fbConnectBtn;
            }
        });
    });
}

function sendmeSearch(term,adres){
    window.location=adres+term.value;
}

$(document).ready(function(){
   if($('#onlineusers')!=null){ $('#onlineusers').load('/ajaxPublicProxy.aspx?cmd=onlineusers');	
   }
   if($('#vitrinmotorlari')!=null){
    $('#vitrinmotorlari').slideUp("slow");
    $('#vitrinmotorlari').load('/ajaxPublicProxy.aspx?cmd=vitrinmotorlari');
    $('#vitrinmotorlari').slideDown("slow");
    }
});