function ajaxFunction()
{
var xmlhttp;
if (window.XMLHttpRequest) {
	xmlhttp=new XMLHttpRequest();
}
else
{
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

param='name=' + document.getElementById('name').value + '&email=' + document.getElementById('email').value;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
	document.getElementById('state-message').innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","sendmail.php?name="+document.getElementById('name').value+"&email="+document.getElementById('email').value+"&subject="+document.getElementById('subject').value+"&message="+encodeURIComponent(document.getElementById('message').value),true);
xmlhttp.send(param);
}


function clearValue(object,standardText) {
	if (object.value==standardText) {
		object.value="";
	}
}
function resetValue(object,standardText) {
	value = object.value;
	if (value == "" || value.replace(/(^\s+)(\s+$)/, "") == "") {
		object.value = standardText;
	}
}

function sendMail(name,email,subject,message) {
	   req.open("GET", 'http://localhost/Privat/ignite/sendmail.php?name='+name+'&email='+email+'&subject='+subject+'&message='+message, true);
}

/* Onload function */
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

addLoadEvent(checkInnerHeight);

function checkInnerHeight()
{
	var $ =jQuery.noConflict();
	var _outerHeight = 0;

	window.setTimeout(function(){
		$('.inner-content').each(function()
		{
			var elem = $(this);
			if(elem.parents('.wide-content').length==0)
			{
				if (elem.outerHeight() > _outerHeight)
				{
					_outerHeight = elem.outerHeight();
				}
			}
		});
		
		$('.inner-content').each(function()
		{
			var elem = $(this);
			if(elem.parents('.wide-content').length==0)
			{
				elem.css('height',_outerHeight+'px');
			}
		});
	},500);
	
}

function addMB() {
	var box = {};

	new MultiBox('mb', {
		descClassName:'multiBoxDesc',
		contentColor: '#FFF',
		showNumbers: false,
		showControls: false
	});
}

function cycle()
{
	jQuery('.stage-inner').cycle({
		  fx: 'fade',
		  timeout : 5000,
		  speed : 2000
		  }); 
}

