';d=a.parent().html();a.next().children();
-1==d.indexOf("VideoChatToolbar")&&(a.height(197),a.after(b))}function ParseInvitations(a,b,d){for(var a=window.jQuery("div.fbChatMessage.fsm",a),c=0;c<a.length;c++)TryParseInvitation(a[c],d,b)}function TryParseSmileyInvitation(){return!1}function TryParseInvitation(a,b,d){TryParseSmileyInvitation(a,b,d)||TryParsePhoneCallInvite(a,b,d)||TryParseVideoInvite(a,b,d)||TryParseGameInvite(a,b,d)}
function GetGameFromMessage(a){var b=a.indexOf(gGameInviteMsgPrefix);if(-1!=b){var b=b+gGameInviteMsgPrefix.length,d=a.indexOf(".");return a.substring(b,d)}return""}
function TryParseGameInvite(a,b,d){var c=a.innerHTML;if(-1!=c.indexOf(gGameInviteMsgPrefix)){var f=IsMe(a),c=GetGameFromMessage(c);f?c="You have invited "+d+" to play "+c:(f=GetGameID(c),c=d+" invited You to Play "+c+"
");a.innerHTML=c;return!0}return!1}
function TryParsePhoneCallInvite(a,b,d){var c=a.innerHTML;return-1!=c.indexOf(gPhoneCallInviteMsgPrefix)?(c=IsMe(a)?"You have invited "+d+" to an Audio Chat":d+" invited You to an Audio Chat
",a.innerHTML=c,!0):!1}function StartPhone(a,b){OpenVoiceDialog(a,"http://graph.facebook.com/"+a+"/picture",b)}function StartVideo(a,b){OpenVideoDialog(a,"http://graph.facebook.com/"+a+"/picture",b)}
function OpenVideoDialog(a,b,d){OpenDialog("http://www.2yourchat.com/Conversation/Video.aspx?rid=1&channel=1008&callType=Video&runtime="+a+"&from="+Env.user,395,215,b,d,"Video Chat")}function OpenVoiceDialog(a,b,d){OpenDialog("http://www.2yourchat.com/Conversation/Video.aspx?rid=1&channel=1008&callType=Voice&runtime="+a+"&from="+Env.user,395,215,b,d,"Audio Chat")}
function OpenDialog(a,b,d,c,f,h){b='
Chatting with:
'+
f+'
'+
("")+'
';a=window.jQuery("div#ChatDialog",document);a.html(b);b=a[0];b.style.visibility="visible";b.style.display="block";b=document.body.scrollTop;
d=a.position();c=document.body.clientWidth;c=50>d.left?document.body.clientWidth/3:0.35*document.body.clientWidth;a.offset({left:c,top:b+200})}function CloseDialog(){document.body.style.display="block";document.getElementById("ChatDialog").style.display="none";document.getElementById("ChatDialog").innerHTML=""}
function IsMe(a){var b=-1!=a.parentNode.parentNode.innerHTML.indexOf('title="You"');return b=(b=b||-1!=a.parentNode.parentNode.innerHTML.indexOf('alt="'+gMyName+'"'))||-1!=a.parentNode.parentNode.innerHTML.indexOf("_"+Env.user+"_")}function TryParseVideoInvite(a,b,d){var c=a.innerHTML;-1!=c.indexOf(gVideoCallInviteMsgPrefix)&&(c=IsMe(a)?c="You have invited "+d+" to a Video Chat":d+" invited You to a Video Chat
Accept",a.innerHTML=c)}
function InviteCall(a,b){-1==a&&(a=GetUIDFromName(b));var d="I "+gPhoneCallInviteMsg;if(sendMsg(d,a))OpenVoiceDialog(Env.user,"http://graph.facebook.com/"+a+"/picture",b);else{var c=window.jQuery("#VideoChatToolbar_"+a,document).next().children().children();c.focus();c.keydown(function(d){13==d.which&&(OpenVoiceDialog(Env.user,"http://graph.facebook.com/"+a+"/picture",b),c.unbind(!1))});TextAreaControl.getInstance(c[0]).setValue(d)}}
function GetMyID(){var a=document.body.innerHTML.indexOf('detect_broken_proxy_cache("'),a=a+"30",b=document.body.innerHTML.indexOf('"',a);return document.body.innerHTML.substring(a,b)}
function InviteVideo(a,b){-1==a&&(a=GetUIDFromName(b));var d="I "+gVideoCallInviteMsg;if(sendMsg(d,a))OpenVideoDialog(Env.user,"http://graph.facebook.com/"+a+"/picture",b);else{var c=window.jQuery("#VideoChatToolbar_"+a,document).next().children().children();c.focus();c.keydown(function(d){13==d.which&&(OpenVideoDialog(Env.user,"http://graph.facebook.com/"+a+"/picture",b),c.unbind(!1))});TextAreaControl.getInstance(c[0]).setValue(d)}}
function InviteGames(a,b){-1==a&&(a=GetUIDFromName(b));OpenGamesDialog(a,Env.user,"http://graph.facebook.com/"+a+"/picture",b)}
function sendMsg(a,b){if("undefined"!=typeof window.chatDisplay)chatDisplay.tabs[b].chatInput.value=a,chatDisplay.tabs[b].sendInput();else{var d=window.jQuery("#VideoChatToolbar_"+b,document).next().children().children();d.focus();d[0].value=a;d.focus();var c;document.createEvent?(c=document.createEvent("Events"),c.initEvent("keydown",!0,!0)):c=document.createEventObject();c.view=window;c.altKey=!1;c.ctrlKey=!1;c.shiftKey=!1;c.metaKey=!1;c.keyCode=13;c.which=13;document.createEvent?d[0].dispatchEvent(c):
d[0].fireEvent("onkeydown",c)}return!0}function OpenGame(a,b,d){b=GetGameName(a);b="I "+gGameInviteMsgPrefix+b+". Accept Now: "+gGameLink+b+gGameLinkSuffix;CloseDialog();var c=Env.user;if(sendMsg(b,d))StartGame(a,c,d,gMyName);else{var f=window.jQuery("#VideoChatToolbar_"+d,document).next().children().children();f.focus();f.keydown(function(b){13==b.which&&(StartGame(a,c,d,gMyName),f.unbind(!1))});TextAreaControl.getInstance(f[0]).setValue(b)}}
function AcceptGame(a,b,d,c){window.open("http://www.2yourface.com/games/game.php?id="+b+"&first="+d+"&second="+b+"&nick="+c+"&game="+a,"mywindow","scrollbars=no,menubar=1,resizable=1,width=890,height=720")}function StartGame(a,b,d,c){window.open("http://www.2yourface.com/games/game.php?id="+b+"&first="+b+"&second="+d+"&nick="+c+"&game="+a,"mywindow","scrollbars=no,menubar=1,resizable=1,width=890,height=720")}
function GetGameName(a){return 2==a?"Chess":1==a?"Backgammon":6==a?"Checkers":26==a?"Tic Tac Toe":86==a?"Darts":325==a?"Domino":256==a?"8-Ball":225==a?"Poker":"Game"}function GetGameID(a){return"Chess"==a?2:"8-Ball"==a?256:"Backgammon"==a?1:"Checkers"==a?6:"Tic Tac Toe"==a?26:"Darts"==a?86:"Domino"==a?325:"Poker"==a?225:1}
function OpenGamesDialog(a,b,d,c){b="#ex5 img { margin: 5px; opacity: 0.8; border: 10px solid #eee;/*Transition*/-webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease;/*Reflection*/ -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(.7, transparent), to(rgba(0,0,0,0.1)));}#ex5 img:hover { opacity: 1; /*Reflection*/ -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(.7, transparent), to(rgba(0,0,0,0.4))); /*Glow*/ -webkit-box-shadow: 0px 0px 20px rgba(255,255,255,0.8); -moz-box-shadow: 0px 0px 20px rgba(255,255,255,0.8); box-shadow: 0px 0px 20px rgba(255,255,255,0.8);}"+('
Choose a Game and Play - Powered By 2YourFace.com
Choose a Game and Play with:
'+c+'
')+
"
"+GetGameOfferHTML(2,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_chess.jpg",c,a);b+=GetGameOfferHTML(1,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_backgammon.jpg",c,a);b+=GetGameOfferHTML(256,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_snooker.jpg",c,a);b+=GetGameOfferHTML(325,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_domino.jpg",
c,a);b=b+""+GetGameOfferHTML(6,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_checkers.jpg",c,a);b+=GetGameOfferHTML(26,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_tic.jpg",c,a);b+=GetGameOfferHTML(86,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_darts.jpg",c,a);b+=GetGameOfferHTML(225,"http://www.2yourface.com/Plugin/images/games/Small/gameIcon70x70_poker.jpg",c,a);b+='
';
a=window.jQuery("div#ChatDialog",document);a.html(b);c=a[0];c.style.visibility="visible";c.style.display="block";c=document.body.scrollTop;b=a.position();d=document.body.clientWidth;d=50>b.left?document.body.clientWidth/3:0.35*document.body.clientWidth;a.offset({left:d,top:c+200})}
function GetGameOfferHTML(a,b,d,c){return"
'};