//---------------------------------------------
// method.php
//---------------------------------------------
	function changeMenu(menuID, lastmnuID, menu, file, showID, func, method)
	{
		// set last menu to default color
		mouseOn(lastmnuID, '#036','#FFFFFF');

		// show selected div
		callAjaxHTTP(file, '', showID, func, method);

		// new menu colors
		mouseOn(menuID, '#369','#FFFFFF');
		if (menu == 1) lastMenuID = menuID;
		if (menu == 2) lastFXMenuID = menuID;

		//alert(menuID + ' - ' + lastmnuID);
		return true;
	}

	function divHTMLemail(id, responseTxt)
	{
		img = document.getElementById('secimage');
		img.src = 'captcha/CaptchaSecurityImages.php?width=100&height=40&characters=5&sid=' + Math.random();
		document.getElementById('security_code').value='';

		alert(responseTxt);
	}

// AJAX functions

			var http = false;

			if(navigator.appName == "Microsoft Internet Explorer") {
			  http = new ActiveXObject("Microsoft.XMLHTTP");
			} else {
			  http = new XMLHttpRequest();
			}

			function httpRequest(strURL, params) {
			  http.abort();
			  http.open('POST', strURL, true);
				http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	      http.setRequestHeader("Content-length", params.length);
  	    http.setRequestHeader("Connection", "close");
			  http.onreadystatechange=function() {
			    if(http.readyState == 4) {
			      //document.getElementById('divResult').innerHTML = http.responseText;
						img = document.getElementById('secimage');
						//	Change the image
						//img.src = 'create_image.php?' + Math.random();//'CaptchaSecurityImages.php?width=100&height=40&characters=5';
img.src = 'CaptchaSecurityImages.php?width=100&height=40&characters=5?' + Math.random();
						if(http.responseText=='Your message sent successfully.'){
							document.getElementById('name').value='';
							document.getElementById('email').value='';
							document.getElementById('subject').value='';
							document.getElementById('message').value='';
						}
						document.getElementById('security_code').value='';
			      alert(http.responseText);
			    }
			  }
			  http.send(params);	// if GET then null;
			}

			function getQueryStringContact(frm) {
			    var form = document.forms[frm];
			    qstr = 'name=' + escape(form.name.value);  // NOTE: no '?' before querystring
			    qstr = qstr + '&email=' + escape(form.email.value);  // NOTE: no '?' before querystring
			    qstr = qstr + '&subject=' + escape(form.subject.value);  // NOTE: no '?' before querystring
			    qstr = qstr + '&message=' + escape(form.message.value);  // NOTE: no '?' before querystring
			    qstr = qstr + '&security_code=' + escape(form.security_code.value);  // NOTE: no '?' before querystring
			    return qstr;
			}
       //httpRequest('sendmail.php', getQueryString('frmContact'));
//---------------------------------------------
// index.php
//---------------------------------------------
var lastDivID="divHome";
var lastMenuID="mnuHome";

var lastFXDivID="divWhatis";
var lastFXMenuID="mnuWhatis";

ns4 = document.layers;
ie = document.all;
ns6 = document.getElementById && !document.all;

function a(txt) {self.status = txt}
function b() {self.status = "(: JOBnik! :)"}

function returnOBJ(id)
{
	if (ie) return document.all[id];
	else if (ns6) return document.getElementById(id);
}

function mouseOn(id, bgcol, txtcol)
{
	obj = returnOBJ(id);
	obj.visited=bgcol;
	obj.style.color=txtcol;
}

function mouseOut(id, bgcol, txtcol, mnu)
{
	if (mnu==1) if (id==lastMenuID) return false;
	if (mnu==2) if (id==lastFXMenuID) return false;
	mouseOn(id,bgcol,txtcol);
}

function changeDiv(id, lastID, menuID, lastmnuID, menu)
{
	if (id==lastID) return false;
	if (ns4) {
		alert ("Sorry, but NS4 does not allow this.");
		return false;
	} else if (ie || ns6) {
		// hide last div
		obj = returnOBJ(lastID);
		obj.style.display="none";

		// set last menu to default color
		mouseOn(lastmnuID, '#CCCCFF','#FFFFFF');

		// show selected div
		obj = returnOBJ(id);
		obj.style.display="block";
		if (menu==1) lastDivID=id;
		if (menu==2) lastFXDivID=id;

		// new menu colors
		mouseOn(menuID, '#000099','#FFFFFF');
		if (menu==1) lastMenuID=menuID;
		if (menu==2) lastFXMenuID=menuID;
	}
	return true;
}

function menuStart(dDiv, mMenu)
{
	lastDivID=dDiv;
	lastMenuID=mMenu;
	changeDiv(lastDivID,'divHome',lastMenuID,'mnuHome',1)
	mouseOn(lastFXMenuID,'#000099','#FFFFFF');
	mouseOn(lastMenuID,'#000099','#FFFFFF');
	//mouseOut(lastMenuID,'#CCCCFF','#FFFFFF',1)
	b();
}

//---------------------------------------------
// contact.php
//---------------------------------------------
// all JS code replaced with AJAX and php on server.
