function refreshWidget(refreshLoginState, login) {
	var refresh = (refreshLoginState == 'true');
	if (refresh) {
		jQuery('#invigioWidget').load('/index.php?widgetajax', { login : login},function(){
			var links = jQuery('.jInvigioLink');
			links.bind('click', function(event) {
				if(jQuery('#ifrm').length > 0){
						jQuery('#ifrm').attr('src', jQuery(event.target).attr('rel'));	
				}else{
				    var baseUrl = (("https:" == document.location.protocol) ? "https://	" : "http://");
				    baseUrl += document.location.host;

					window.location.replace( baseUrl + '/finanse/kredyty_hipoteczne/kalkulator#' + jQuery(event.target).attr('rel'));
				}
				event.preventDefault();

			});
	
		});
}
}
function redirectToWidget(){
	if(self.document.location.hash.length > 0){
		if(self.document.location.hash.match('https:') != null){
			jQuery('#ifrm').attr('src', self.document.location.hash.replace('#', '') ) ;
		}
		
	}
}
