function setClass(element, className) {
	element.setAttribute('class', className);
	element.setAttribute('className', className);
};

function checkUser(response) {
	if (!document.getElementById("rememberMeGigya").checked) {
		gigya.services.socialize.plugins.login.hideWelcome('gigyaLoginDiv');
	}
	if (response.user) {
		if (!response.user.isSiteUID) {
			showModalBubble('bubble_1', 'content_left', 60, 60);
			createGigyaLinking('bubble_1_content', response);
			gigya.services.socialize.plugins.login.hideWelcome('gigyaLoginDiv');
		} else {
			gigyaLogin(response);
		}
	}
};

function checkLogin(response) {
	gigya.services.socialize.getUserInfo(gigyaConf, {
		callback : checkUser
	});
};

function gigyaReset() {
	gigya.services.socialize.logout(gigyaConf,{});
	gigya.services.socialize.plugins.login.hideWelcome('gigyaLoginDiv');
};

window.onload = function () {
	document.getElementById('std_form')['browser'].value = getBrowser();

	gigya.services.socialize.addEventHandlers(gigyaConf, {  
		onLogin: checkLogin
	});  

	gigya.services.socialize.showLoginUI(gigyaConf, {   
		width: 240,
	    height: 40,
	    showTermsLink:false,
	    showWhatsThis: false,
	    hideGigyaLink:true,
	    lastLoginIndication: 'welcome',
	    lastLoginButtonSize : 25,
	    useHTML:true,
	    buttonsStyle: 'standard',
	    containerID: 'gigyaLoginDiv'
	});  
};
