$(document).ready(function() {
	
	$("iframe.iframe_login").load(function() {
		var id = $(this).attr("id").substr("site".length);
		//alert(id);
		if (id == siteId) {
			//The login to the requested site is complete, do the redirect
			window.setTimeout("window.location = redirectUrl", 1000);
		}
	});
	
	if (typeof loginUrl != 'undefined') {
		window.setTimeout("window.location = loginUrl", 2000);
	}
});