var ibic_home;
if (!ibic_home) ibic_home = {};
ibic_home.auth = {};

$(function() {
	ibic_home.auth.initialize();
});



ibic_home.auth.initialize = function () {
	ibic_home.auth.detectClient();
};

ibic_home.auth.detectClient = function() {
	var form = $('form')[0];
	if (jsVer) {
		$(form).append('<input type="hidden" name="jsVersion" value="'+jsVer+'"/>');
	}

	var flashVer = ibic_flash.GetSwfVer();
	if (flashVer && flashVer != -1) {
		$(form).append('<input type="hidden" name="flashVersion" value="'+flashVer+'"/>');
	}

	if (navigator && navigator.cookieEnabled) {
		$(form).append('<input type="hidden" name="cookieEnabled" value="'+navigator.cookieEnabled+'"/>');
	}

	var innerWidth = null;
	var innerHeight = null;
	if (window.innerWidth) {
		innerWidth = window.innerWidth;
		innerHeight = window.innerHeight;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		innerWidth = document.documentElement.clientWidth;
		innerHeight = document.documentElement.clientHeight;
	} else if (document.body.clientWidth) {
		innerWidth = document.body.clientWidth;
		innerHeight = document.body.clientHeight;
	}
	if (innerWidth) {
		$(form).append('<input type="hidden" name="innerWidth" value="'+innerWidth+'"/>');
	}
	if (innerHeight) {
		$(form).append('<input type="hidden" name="innerHeight" value="'+innerHeight+'"/>');
	}

	if (screen.width) {
		$(form).append('<input type="hidden" name="width" value="'+screen.width+'"/>');
	}
	if (screen.height) {
		$(form).append('<input type="hidden" name="height" value="'+screen.height+'"/>');
	}
	if (screen.availWidth) {
		$(form).append('<input type="hidden" name="availWidth" value="'+screen.availWidth+'"/>');
	}
	if (screen.availHeight) {
		$(form).append('<input type="hidden" name="availHeight" value="'+screen.availHeight+'"/>');
	}
	if (screen.colorDepth) {
		$(form).append('<input type="hidden" name="colorDepth" value="'+screen.colorDepth+'"/>');
	}
};
