var JQbook=function(){var D="",B="",C=false;return{events:{USER_NOT_LOGGED_IN:"User_is_not_loggedin",CONNECTION_READY:"Facebook_is_connected_and_ready",CONNECTION_READY_PERMISSIONS_NONE:"User_connected_but_did_not_allow_the_extended_permissions_you_requested",CONNECTION_FAILED:"User_authentication_failed",ON_USERINFO_FOUND:"User_data_recieved",ON_USERINFO_NOTFOUND:"User_data_not_found",ON_WALLINFO_FOUND:"User_wall_data_found",ON_WALLINFO_NOTFOUND:"User_wall_data_not_found",ON_LIKESINFO_FOUND:"User_likes_data_found",ON_LIKESINFO_NOT_FOUND:"User_likes_data_not_found",ON_MOVIESINFO_FOUND:"User_movies_data_found",ON_MOVIESINFO_NOT_FOUND:"User_movies_data_not_found",ON_NOTESINFO_FOUND:"User_notes_data_found",ON_NOTESINFO_NOT_FOUND:"User_notes_data_not_found",ON_GROUPSINFO_FOUND:"User_groups_data_found",ON_GROUPSINFO_NOT_FOUND:"User_groups_data_not_found",ON_IMAGESINFO_FOUND:"User_images_data_found",ON_STREAM_PUBLISH_SUCCESS:"STREAM_PUBLISH_SUCCEEDED",ON_STREAM_PUBLISH_FAILED:"STREAM_PUBLISH_FAILED"},defaults:{appID:"",permissions:"email,publish_stream,read_stream,user_groups,user_notes,user_birthday"},options:function(E){if(E==undefined||E==""){E={}}return $.extend({},JQbook.defaults,E)},init:function(E){JQbook.defaults.permissions=E.permissions!=null?E.permissions:JQbook.defaults.permissions;JQbook.defaults.permissions=JQbook.defaults.permissions==""?null:JQbook.defaults.permissions;FB.init({appId:JQbook.options(E).appID,status:true,cookie:true,xfbml:true});JQbook.loginStatus()},loginStatus:function(E){FB.getLoginStatus(function(F){if(F.session){C=true;JQbook.uid(F.session.uid);$("#fb-root").trigger(JQbook.events.CONNECTION_READY,[{uid:F.session.uid}]);A(E,F)}})},login:function(E){FB.getLoginStatus(function(F){if(F.session){C=true;JQbook.uid(F.session.uid);$("#fb-root").trigger(JQbook.events.CONNECTION_READY,[{uid:F.session.uid}]);A(E,F)}else{FB.login(function(G){if(G.session){if(G.perms){C=true;JQbook.uid(G.session.uid);$("#fb-root").trigger(JQbook.events.CONNECTION_READY,[{uid:G.session.uid}]);A(E,G)}else{C=true;JQbook.uid(G.session.uid);$("#fb-root").trigger(JQbook.events.CONNECTION_READY_PERMISSIONS_NONE);A(E,JQbook.events.CONNECTION_READY_PERMISSIONS_NONE)}}else{$("#fb-root").trigger(JQbook.events.CONNECTION_FAILED);A(E,false)}},{perms:JQbook.options().permissions})}})},userInfo:function(E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.api("/me",function(F){if(!F||F.error){$("#fb-root").trigger(JQbook.events.ON_USERINFO_NOTFOUND);A(E,false);return(false)}$("#fb-root").trigger(JQbook.events.ON_USERINFO_FOUND,[F]);A(E,F);JQbook.name(F.name);JQbook.uid(F.id)})},userWall:function(F,E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }if(F==null||F==""){F=50}FB.api({method:"fql.query",query:"SELECT actor_id, message FROM stream WHERE source_id = "+JQbook.uid()+" limit "+F},function(G){$("#fb-root").trigger(JQbook.events.ON_WALLINFO_FOUND,[G]);A(E,G)})},userLikes:function(E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.api("/"+JQbook.uid()+"/likes",function(F){if(!F||F.error){$("#fb-root").trigger(JQbook.events.ON_LIKESINFO_NOT_FOUND);A(E,false);return(false)}$("#fb-root").trigger(JQbook.events.ON_LIKESINFO_FOUND,[F.data]);A(E,F.data)})},userMovies:function(E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.api("/"+JQbook.uid()+"/movies",function(F){if(!F||F.error){$("#fb-root").trigger(JQbook.events.ON_MOVIESINFO_NOT_FOUND);A(E,false);return(false)}$("#fb-root").trigger(JQbook.events.ON_MOVIESINFO_FOUND,[F.data]);A(E,F.data)})},userNotes:function(E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.api("/"+JQbook.uid()+"/notes",function(F){if(!F||F.error){$("#fb-root").trigger(JQbook.events.ON_NOTESINFO_NOT_FOUND);A(E,false);return(false)}$("#fb-root").trigger(JQbook.events.ON_NOTESINFO_FOUND,[F.data]);A(E,F.data)})},userGroups:function(E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.api("/"+JQbook.uid()+"/groups",function(F){if(!F||F.error){$("#fb-root").trigger(JQbook.events.ON_GROUPSINFO_NOT_FOUND);A(E,false);return(false)}$("#fb-root").trigger(JQbook.events.ON_GROUPSINFO_FOUND,[F.data]);A(E,F.data)})},userProfileIMGS:function(E){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.api({method:"fql.query",query:"SELECT pic, pic_square,pic_big FROM profile WHERE id = "+JQbook.uid()},function(F){$("#fb-root").trigger(JQbook.events.ON_IMAGESINFO_FOUND,[F]);A(E,F)})},streamPublish:function(F,J,H,K,E,L,I,G){if(C==false){JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN);return }FB.ui({method:"stream.publish",message:"",display:I,attachment:{name:F,caption:"",description:(J),href:E,media:[{type:"image",src:H,href:E}]},action_links:[{text:K,href:E}],user_prompt_message:L},function(M){if(M&&M.post_id){$("#fb-root").trigger(JQbook.events.ON_STREAM_PUBLISH_SUCCESS,[M]);A(G,M)}else{$("#fb-root").trigger(JQbook.events.ON_STREAM_PUBLISH_FAILED);A(G,false)}})},uid:function(E){if(E==null||E==""){return B}else{B=E}},name:function(E){if(E===null||E===""){return D}else{D=E}},debug:function(E){if(window.console&&window.console.log){window.console.log(E)}}};function A(F,E){if(typeof F=="function"){F(E)}}}();var AM_I_LOGGED_IN=false;var signanddrive_post={};$(document).ready(function(){JQbook.init({appID:"114000205296916",permissions:""})});function sendMessagetoWall(E,D,C,A,B){signanddrive_post.init_message=E;signanddrive_post.link_name=D;signanddrive_post.link=C;signanddrive_post.msg=A;signanddrive_post.img=B;JQbook.login(_send_bk_message)}function _send_bk_message(A){if(A.session){_finally_send_to_wall(signanddrive_post.init_message,signanddrive_post.link_name,signanddrive_post.link,signanddrive_post.msg,signanddrive_post.img)}else{JQbook.login(_send_bk_message)}}function _finally_send_to_wall(E,D,C,A,B){FB.ui({method:"stream.publish",message:E,attachment:{name:D,caption:"",description:(A),href:C,media:[{type:"image",src:B,href:C}]},action_links:[{text:"link",href:C}],user_prompt_message:D},function(F){if(F&&F.post_id){}else{}})}var Browser={init:function(){this.name=this.searchString(this.dataBrowser)||"unknown"},searchString:function(E){for(var D=0;D<E.length;D++){var G=E[D].string;var F=E[D].prop;this.versionSearchString=E[D].versionSearch||E[D].identity;if(G){if(G.indexOf(E[D].subString)!=-1){return E[D].identity}}else{if(F){return E[D].identity}}}},dataBrowser:[{string:navigator.vendor,subString:"Apple",identity:"Safari"}]};Browser.init();
