﻿function OnTimeout(value) {
    alert("OOPS - Timeout");
}

function OnError(value) {
    alert("Oops - ERROR");
}
function Nuller() {
}
function OnUser(value) {
    if (value[0].toLocaleString() == "1") {
        
        FB.Connect.logout();
    }
    if (value[1].toLocaleString() == "-1") {
        alert("Error");
    }
    else {
        $("#userbox").html(value[1].toLocaleString());
    }
   tb_init('.thickbox');
}
function OnComplete(value) {

    document.getElementById('mycontent').innerHTML = value[0].toLocaleString();
    //alert(value[0].toLocaleString());
}
function OnCompleteFan(value) {

    document.getElementById('ap').innerHTML = value[0].toLocaleString();

    
}
function GetCategoryPage(Page, CategoryID, CountryID,TypeID) {
    reVal = MyAtlas.GetAjaxCategoryPage(Page, CategoryID,CountryID,TypeID, OnComplete, OnTimeout, OnError);
}
function GetFanPage(Page, PersonID) {
    reVal = MyAtlas.GetAjaxFanPage(Page, PersonID, OnCompleteFan, OnTimeout, OnError);
}
function GetMemberFanPage(Page, MemberID) {
    reVal = MyAtlas.GetMemberFanPage(Page, MemberID, OnCompleteFan, OnTimeout, OnError);
}

function getResult(sender, e) {
   
    $("body").fadeOut(2000);
    document.location.href = "/" + e.get_value();
}
function LogOut() {
    reval = MyAtlas.LogOut(OnUser, OnTimeout, OnError);
}
function LogIn() {
    reval = MyAtlas.LogIn(OnUser, OnTimeout, OnError);
}
function search() {
    
     document.location.href = "/search.aspx?q=" +$("#txt_Search").val();
 }
 $(function () {

     var prms = window.location.href;
     if (prms.indexOf("#") != -1) {
         var refm = prms.split("#")[1];
         reval = MyAtlas.CreateReferencer(refm, Nuller, OnTimeout, OnError);
     }
 });
