function getCurrentData() {
	var theDate = new Date();
	document.editblock.month.value = theDate.getMonth() + 1;
	document.editblock.year.value = theDate.getYear();
	document.editblock.date.value = theDate.getDate();
}
function getWindowHeight() {
	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;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('mainConteiner').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				document.getElementById('mainConteiner').style.height = (windowHeight - footerHeight) + 'px';
//				footerElement.style.position = 'relative';
//				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
//				document.getElementById('mainConteiner').style.height = 'inherit';
//				footerElement.style.position = 'static';
			}
		}
	}
}
function AddToFavorite() {
    if ( document.all ) window.external.AddFavorite( window.top.location.href, 'Foris Telecom Ltd' );
    else alert("Press 'Ctrl + D'." );
}
function checkFile() {
	if(document.category.title.value=="" || document.category.link.value=="") {
		alert("An file name and menu item is required!");
		return false;
	}
	var rex = /^([0-9a-z]([-_]?[0-9a-z]))/;
	if (document.category.link.value.match(rex) == null) {
		alert("An file name is not valid Only letters (a-z) or numbers (0-9) is required");
		return false;
	}
}
function hideLink(val) {
	if (val == '2') {
		document.getElementById('link').style.display = 'none';
		document.category.link.value = 'menuitem';
	} else {
		document.getElementById('link').style.display = 'block';
		document.category.link.value = '';
	}
}
function getDiv(name){
	var div = document.getElementById(name);
	if(div.style.display == 'none') {
		div.style.display = 'block';
	} else {
	div.style.display = 'none';
	}
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}