

/**
 * @author Primal Skill
 * 
 */


if (typeof FL == 'undefined') {
	var FL = {};
}

FL.namespace = function(srcName) {
	var arg = arguments, name=null, obj=null, i;
	name = srcName.split('.');
	obj = FL;
	
	for (i=0; i<name.length; i++) {
		obj[name[i]] = obj[name[i]] || {};
		obj = obj[name[i]];
	}
	
	return obj;
}

FL.getWindowHeight = function() {
	var windowHeight=0;
	
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;	
}

FL.users = {
	userPanelLogin : function() {
		var form = document.getElementById('frmUserPanel');
		var inputs = form.getElementsByTagName('input');

		
		for (var j=0; j<inputs.length; j++) 
		{
			FL.users.addInputSubmitEvent(form, inputs[j]);
		}
		
		var anchor = document.getElementById('btnLogin');
			anchor.onclick = function() {
				form.submit();
				return false;
			};
	},
	addInputSubmitEvent : function(form, input) {
	    input.onkeydown = function(e) {
	        e = e || window.event;
	        if (e.keyCode == 13) {
	            form.submit();
	            return false;
	        }
    	};
	}
}

FL.autocomplete = {
	off : function(srcInputID) {
		var tag = document.getElementById(srcInputID)
	
		if (tag) {
			tag.value = '';
		}
		
	} //end of turnOff
} //end of genericAutocomplete
 



