<!--
// ajax functions to send time offset back to server
function makeRequest(url) {
    var http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    if (!http_request) {
        //alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    //http_request.onreadystatechange = function() { alertContents(http_request); };
    http_request.open('GET', url, true);
    http_request.send(null);
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function confirmGoUrl(confirmtext, jumpurl) {
	if(confirm(confirmtext)) {location.href=jumpurl;}
}

function wordcount(s) {
	var formcontent=Trim(s);
	if(formcontent == "") {
		return 0;
	} else {
		formcontent=formcontent.split(" ");
		return formcontent.length;
	}
}

function LTrim(str) {
	var whitespace = new String(" \t\n\r");
	var s = new String(str);
	if (whitespace.indexOf(s.charAt(0)) != -1) {
		var j=0, i = s.length;
		while (j < i && whitespace.indexOf(s.charAt(j)) != -1) {
		j++; s = s.substring(j, i);
		}
	}
	return s;
}

function RTrim(str) {
	var whitespace = new String(" \t\n\r");
	var s = new String(str);
	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
		var i = s.length - 1;
		while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) {
			i--; s = s.substring(0, i+1);
		}
	}
	return s;
}

function Trim(str) {
	return RTrim(LTrim(str));
}

function set_chatlist(lines) {
	document.sendchatmessage.chatlist.value = lines;
	document.sendchatmessage.submit();
}

function popup(a,msg,look,x,y){ //v1.0.5
  var d=document; if (!a){var ln='pLayer';dx="";dy="";b=(d.layers)?1:0;
    nn=(b||d.getElementById &&!d.all)?1:0;l = new Object();
    l.s=b?d.layers[ln]:MM_findObj(ln).style;l.r=b?d.layers[ln].document:MM_findObj(ln);
    l.w=function (t) {if(b){l.r.write(t);l.r.close()}else l.r.innerHTML=t}
	if(b) d.captureEvents(Event.MOUSEMOVE);d.onmousemove=function(e)
	{dx=(nn)?e.pageX:event.x;dy=(nn)?e.pageY:event.y;}}if (a=='1') {l.s.visibility='hidden'}
  if (a=='2') {l.w('<span class="'+look+'">'+unescape(msg)+'</span>')
	if(d.all) dy=dy+d.body.scrollTop;x=(!x)?50:Number(x);
	y=(!y)?-20:Number(y);l.s.left=dx+x; l.s.top=dy+y;l.s.visibility='visible'}
}

function GP_popupConfirmMsg(msg) { //v1.0
  document.MM_returnValue = confirm(msg);
}

function flevPopupLink(){// v1.2
var v1=arguments,v2=window.open(v1[0],v1[1],v1[2]), v3=(v1.length>3)?v1[3]:false;if (v3){v2.focus();}document.MM_returnValue=false;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function tmt_winOpen(u,id,f,df){
	if(eval(id)==null||eval(id+".closed")){
	eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");}
	else if(df){eval(id+".focus()");}
	else{eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");}
}

function tmt_winControl(id,c){ 
	var d=eval(id)==null||eval(id+".closed"); if(!d){eval(id+"."+c);}
}

function get_cookie(Name) {
	var search = Name + "=";
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search);
		// if cookie exists
		if (offset != -1) { 
			offset += search.length; // set index of beginning of value
			end = document.cookie.indexOf(";", offset); // set index of end of cookie value
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end));
		}
	}
	return returnvalue;
}

function write_cookie(wert) {
	if(wert) {
		window.document.cookie="chatstring="+window.document.sendchatmessage.chatmsg.value;
	} else {
		window.document.cookie="chatstring=";
	}
}

function cut(objekt, laenge) {
	if(objekt.value.length > laenge) objekt.value=objekt.value.substr(0,laenge);
}

function changeImagePos(x,f) {
	if(!f) {
		document.articlecontent.cimage_pos.selectedIndex = x;
	} else {
		document.article.cimage_pos.selectedIndex = x;
	}
	for(i=0; i<=7; i++)	{
		if(i==x) {
			MM_swapImage('imgpos'+i,'','img/symbole/content_selected.gif',0);
		} else {
			MM_swapImage('imgpos'+i,'','img/leer.gif',0);
		}
	}
}

function changeImagePosMenu(f) {
	if(!f) {
		var x = document.articlecontent.cimage_pos.selectedIndex;
	} else {
		var x = document.article.cimage_pos.selectedIndex;
	}
	for(i=0; i<=7; i++)	{
		if(i==x) {
			MM_swapImage('imgpos'+i,'','img/symbole/content_selected.gif',0);
		} else {
			MM_swapImage('imgpos'+i,'','img/leer.gif',0);
		}
	}
	if(!f) {
		document.articlecontent.cimage_pos.focus();
	} else {
		document.article.cimage_pos.focus();
	}
}

function switchToggleFTP(field) {
	if(field.value=='0') {
		field.value='1';
	} else {
		field.value='0';
	}
	return parseInt(field.value);
}

function toggleAllFTP(field, proof) {
	for (i = 0; i < field.length; i++)
		if(proof) {
			 field[i].checked = true;
		} else {
    		field[i].checked = false ;
		}
}

function int_only(value) {
	value = parseInt(value);
	if(value<0) value = value * -1;
	return (value) ? value+"" : "";
}

function hideLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.display = "none";
	} else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.display = "none";
	} else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].display = "none";
	}
}

function showLayer(whichLayer) {
		//	alert(whichLayer);
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.display = "block";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.display = "block";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].display = "block";
	}
}

function doMapChange() {
	document.articlecontent.cmap_location_edited.value='1';
	//alert('Changed: '+document.articlecontent.cmap_location_edited.value);
}

function subrstr(str,nbr) {
   return str.substr(str.length-nbr);
   // return str.slice(-nbr)
}

// for placing text at position
function setCursorPos (textObj) {
	if (textObj.createTextRange) {
		textObj.cursorPos = document.selection.createRange().duplicate();
	}
}
function insertAtCursorPos (textObj, textFieldValue) {
	textObj.focus();
	if(document.all){ 
		if (textObj.createTextRange && textObj.cursorPos) {
			var cursorPos = textObj.cursorPos;
			cursorPos.text = cursorPos.text.charAt(cursorPos.text.length - 1) == ' ' ? textFieldValue + ' ' : textFieldValue;
		} else {
			textObj.value = textObj.value+textFieldValue;
		}
	} else {
		if(textObj.setSelectionRange){
			var rangeStart = textObj.selectionStart;
			var rangeEnd = textObj.selectionEnd;
			var tempStr1 = textObj.value.substring(0,rangeStart);
			var tempStr2 = textObj.value.substring(rangeEnd);
			textObj.value = tempStr1 + textFieldValue + tempStr2;
		} else {
			alert("This version of Mozilla based browser does not support setSelectionRange");
		}
	}
}

//tmtC_winOpen
var imageBrowser;
var uploadWin;
//tmtC_winOpenEnd
-->