	var oFrm, oHref;

	function isDigit(c)	{   
	   return ((c >= '0') && (c <= '9'));
	}
	
	function LTrim(s) {
	  while (1) {
	    if (s.substring(0, 1) != ' ') break;
	    s = s.substring(1, s.length);
	  }
	  return s;
	}
	
	function RTrim(s)	{
	  while (1) {
	    if (s.substring(s.length - 1, s.length) != ' ') break;
	    s = s.substring(0, s.length - 1);
	  }
	  return s;
	}
	
	function Trim(s){
	  return LTrim(RTrim(s));
	}
	
	function isEmpty(s)	{
	   return ((s == null) || (s.length == 0) || Trim(s)=='');
	}
	
	function isDigitStr(s)	{
		var iCnt, c;
		if (isEmpty(s)) return false;
		for (iCnt=0; iCnt<s.length; iCnt++)	{
			c = s.charAt(iCnt);
			if (!isDigit(c)) return false;
		}
		return true;
	}
	
	function onSearchFieldFocus(obj) {
		obj.value = '';
	}
	
	function onSearchFieldBlur(obj, dstr) {
		if (obj.value == '') obj.value = dstr;
	}
	
	function onSearchFormSubmit(oForm, dstr, sMsg) {
		if ((oForm.txtSearch.value.toLowerCase().replace(/ /g, '') == '') || (oForm.txtSearch.value == dstr)) {
			alert(sMsg);
			oForm.txtSearch.focus();
			return false;
		} else {
			return true;
		}
	}
	
	function send_article(rest, dstr){
		var url  = window.location.href;
		var link = url.replace(/\?.*/,"");
		window.location.href = "mailto:?subject=" + dstr + "&body=%0A" + link + "?" + rest;
	}
	
	function locateBannersBar() {
		var obj = document.getElementById('bannersArea');
		if (obj != null) {
			var xy = getRealLeftTop(obj);
			var pb = document.getElementById('bannersBar');
			if (pb != null)  {
				pb.style.left = xy[0] + 1;
				pb.style.top = xy[1] + 1;
				pb.style.display = '';
			}
		}
	}

	function locateMagazineBanners() {
		var obj = document.getElementById('magazineArea');
		if (obj != null) {
			var xy = getRealLeftTop(obj);
			var pb = document.getElementById('magazineBanners');
			if (pb != null)  {
				pb.style.left = xy[0];
				pb.style.top = xy[1] + 207;
				pb.style.width = pb.offsetWidth;
				pb.style.display = '';
			}
		}
	}	
	
	
	


	function ValidateField(obj) {
		var isOK = (((event.keyCode >= 48) && (event.keyCode <= 57)) || ((event.keyCode >= 96) && (event.keyCode <= 105)) || (event.keyCode == 8) || (event.keyCode == 46) || (event.keyCode == 9));
		return isOK;
	}
	
	function OpenPopUp(src, width, height, scroll, obj){
		width += 6 + (20);
		height += 25;
		var left = (screen.width - width)/2;
		var top = (screen.height - height)/2;
		var arObj = new Array(window.document, obj);
		if (window.showModalDialog != null) {
			window.showModalDialog(src, arObj, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;dialogLeft=' + left + 'px;dialogTop=' + top + 'px;help=0;status=0;scroll=' + scroll + ';unadorned=1');
		} else {
			window.open(src, 'customPopUp',	'width=' + width + ',height=' + height + 'left=' + left + 'top=' + top + ',status=no,scrollbars=' + scroll + ',directories=no,menubar=no,resizable=no,modal=yes,toolbar=no');
		}
	}

	function OpenCustomPopUp(title, source, width, height, scroll){
		var ar = new Array(source, width, height);
		width += 6 + (20);
		height += 25 + (52);
		showModalDialog('/site/documents/_sdat-popup.asp?title='+title,ar,'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;dialogLeft=' + parseInt(parseInt(parseInt(document.body.offsetWidth,10) - width,10)/2,10) + 'px;dialogTop=' + parseInt(parseInt(parseInt(screen.height,10) - height,10)/2,10) + 'px;help=0;status=0;scroll=' + scroll + ';unadorned=1');
	}
	
	function CustomHref(href){
		window.location.href=href;
	}

	function CheckSubmitSearch() {
		return (!(document.forms[0].SearchField.value.toLowerCase().replace(/ /g, '') == ''));
	}
	
	function onLoadPopUp(){
		if (! window.dialogArguments) return;
		document.all.mainimage.width = window.dialogArguments[1];
		document.all.mainimage.height = window.dialogArguments[2];
		document.all.mainimage.src = window.dialogArguments[0];
	}
		
	function SetFieldEmptyText(obj, dstr) {
		if (obj.value == dstr) obj.value = '';
		obj.select();
	}
	
	function SetFieldDefaultText(obj, dstr) {
		if (obj.value == '') obj.value = dstr;
	}

	function showHideUnit(sID){
		var oUnit, oImage;
		
		IE = true; NS = false; OB = false;
		if (document.layers) {IE = false; NS = true; OB = false;}
		if (document.all) {IE = true; NS = false; OB = false;}
		if (!document.all && document.getElementById) {IE = true; NS = false; OB = true;}	
		
		oUnit = document.getElementById(sID);
		if (NS) {
			if (oUnit.visibility == 'hide') {
				oUnit.visibility	= 'show';
			} else {
				oUnit.visibility	= 'hide';
			}
		} else {
			if (oUnit.style.display == 'none') {
				oUnit.style.display = '';
			} else {
				oUnit.style.display = 'none';
			}
		}
	}

	function goHref(sHref) {
		document.location.href = sHref;
	}

