window.onload = setDiv;
window.onresize = reFF;


function setDiv() {
	  var d = document.getElementById('navcontainer');
	  var rs = document.getElementById('rtSide');
	  if (document.getElementById('pageContentDivCat') && document.getElementById('pageContentDivCat').clientHeight) { 
		var wh = document.getElementById('pageContentDivCat').clientHeight; 
		var ww = document.getElementById('pageContentDivCat').clientWidth; 
	
		if (wh > 800 && d) {
			d.style.height = wh-53 + 'px'; 
			
		}
		
		
		
	  }
	  var f = document.getElementById('footerDiv');
	  if (document.getElementById("homeDiv")) {
	  	//document.getElementById("footerSpacer").style.display = "none";
	  	//f.style.position = "relative";
	  	document.getElementById("footerDivTxt").style.textAlign = "left";
	  	document.getElementById("footerDivTxt").style.paddingLeft = 20 + 'px';
	  	//document.getElementById("footerDivTxt").style.paddingTop = 2 + 'px';
	  	
	  	//d.clientHeight + 60 + 'px';
	  } else {
	  	if (d) f.style.top = d.clientHeight + 60 + 'px';
	  	if (!rs) f.style.marginLeft = '-500px';
	  }
	  if (f_clientWidth() < 900) {
	  	document.body.style.left = '0';
	  	document.body.style.marginLeft = '0';
	  	
	  }
	
  
}

function reFF() {
	var ua = navigator.userAgent.toLowerCase(); 
	if (ua.indexOf("firefox")>-1) { 
		//location.href = location.href;
	}
	if (f_clientWidth() < 900) {
		document.body.style.left = '0';
		document.body.style.marginLeft = '0';	  	
	} else {
		document.body.style.left = '50%';
		document.body.style.marginLeft = '-450px';	  	
	}
	
}



function thisMovie(movieName) {
  if (navigator.appName.indexOf("Microsoft") != -1) {
      return window[movieName];
  } else {
      return document[movieName];
  }
}

function resetSlideshow(){
	thisMovie("asms08_ex").resetSlides();
}


function zIndexFlip(){
	document.getElementById("sideNav").style.zIndex=51;
	document.getElementById("mainDiv").style.zIndex=50;
}

function zIndexFlipFla(){
	document.getElementById("sideNav").style.zIndex=6;
	document.getElementById("mainDiv").style.zIndex=5;
}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function ekSearch(){
	var q = document.getElementById("searchStr").value;
	if (q) location.href = "/search.php?q=" + q;
}

function validate_email(field){
	apos=field.indexOf("@")
	dotpos=field.lastIndexOf(".")
	if (apos<1||dotpos-apos<2) {
		return false;
	} else {
		return true;
	}
}

