/*!
 * @package js-social
 * @type js
 *
 * @file auth/social_login.js
 *
 * @author Nesterenko Dmitry (chebur.mail@gmail.com)
 */
function resizeWelcomePage(b){switch(b){case"fb":resize("600","500");break;case"tw":resize("600","490");break;case"gg":resize("520","540");break;case"mr":resize("600","470");break;case"vk":resize("600","400");break;case"od":resize("600","450");break;case"lj":resize("600","450");break}}$(document).ready(function(){var a=function(d){var m=520,g=540,e=Math.round((screen.availWidth-m)/2),n=Math.round((screen.availHeight-g)/2),k,c="",b;d=Object.extend({provider:false,url:false,urlParams:false,winName:"social_login",winParams:"scrollbars=yes, resizable=1, menubar=0, toolbar=0, status=0, location=0, directories=0, left="+e+", top="+n+", width="+m+", height="+g},d);if(d.urlParams&&typeof(d.urlParams)=="object"){var j=new Array();for(var f in d.urlParams){j.push(f+"="+d.urlParams[f])}c=j.join("&")}b="/auth/social/broker/provider/"+d.provider+"/";if(c){b+="?"+c}k=window.open(b,d.winName,d.winParams);resizeWelcomePage(d.provider);k.focus()};$$(".social-login-buttons").each(function(b){$(b).select("a").each(function(c){$(c).observe("click",function(){var d=c.getAttribute("data-provider");a({provider:d})}).onclick=Prototype.falseFunction})})});
