function reset() {
	//alert ("Resetten!");
	document.cookie = "timestamp=; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function openPopup (file, width, height) { // by MH
		thisTop = screen.height/2 - height/2;
		thisLeft = screen.width/2 - width/2;
		window.open (file, "popup", "width="+width+", height="+height+", top="+thisTop+", left="+thisLeft+", scrollbar=yes, status=no,menubar=no,location=no");
		
	}
	

function warning (item, mode) { // by MH
	if (mode == 1) warnstring = 'Wollen Sie tatsächlich den gesamten Artikel '+item+ ' löschen?';
	if (mode == 2) warnstring = 'Wollen Sie wirklich das Bild '+item+ ' löschen?';
	
	warnstring = warnstring + ' \nDieser Vorgang kann nicht rückgängig gemacht werden!';
	
	question = confirm (warnstring);
	if (question == false) return false;
}

function loader(url,div) {
	
	//alert ('Try to load a fucking html page ...');

	if (window.XMLHttpRequest) { // Non-IE browsers
		req = new XMLHttpRequest();
		req.dav = div;
		req.duv = 1;
		req.onreadystatechange = targetDiv;
		try {
			req.open("GET", url, true);
		} catch (e) {
			alert(e);
		}
		req.send(null);
	} 
	else if (window.ActiveXObject) { // IE
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = targetDiv;
			req.open("GET", url, true);
			req.send();

		}
	}
	//return false;
}

function targetDiv() {
	//alert ('ich bin da! dav: ' + dav);
	if (req.readyState == 4) { // Complete
		if (req.status == 200) { // OK response
			document.getElementById(req.dav).innerHTML = req.responseText;
			document.getElementById(req.dav).style.visibility = 'visible';
		} else {
			alert("Problem: " + req.statusText);
		}
	}
} 

function clearDiv (div) {
	document.getElementById (div).innerHTML='';
	document.getElementById('pages').style.visibility = 'hidden';
}

function checkForm() {
	falseFlag = 0;
	if (document.Formular.nome.value == '') {
		document.all.nome.style.backgroundColor="#FF99FF";
		falseFlag = 1;
	}
	
	if(document.Formular.correio.value.indexOf('@') == -1 || document.Formular.correio.value.indexOf('.') == -1) {
		document.all.correio.style.backgroundColor="#FF99FF";
		falseFlag = 1;
	}
	
	if (document.Formular.palavras.value == '') {
		//alert ('Please insert your message!');
		//document.Formular.palavras.focus();
		document.getElementById('wuzzi').style.backgroundColor="#FF99FF";
		falseFlag = 1;
	}
	
	if (falseFlag == 1) {
		document.getElementById('falso').style.visibility = 'visible';
		return false;
	}
}
/*Put the above in the header, then call it with the following:

<a onclick="return processAjax(this.href)" href="/internal-link.html">CLICK ME</a>
<div id="myDivName"></div>*/
