var xmlhttp;
var div_id;

function load(path, id, action)
{		
	div_id=id;		
	xmlhttp=GetXmlHttpObject();
		
	if (xmlhttp==null)
	{
		alert ("Your browser does not support XMLHTTP!");
		return;
	}
	
	var url = path.replace('?', ':q:');
	
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	{
		return new XMLHttpRequest();
	}
	
	if (window.ActiveXObject)
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}

function stateChanged()
{
	if (xmlhttp.readyState==4)
	{
		document.getElementById(div_id).innerHTML=xmlhttp.responseText;
	}
}

$(document).ready(function(){
	$('#banner').innerfade({
		animationtype: 'fade',
		speed: 'slow',
		timeout: 10000,
		type: 'sequence',
		containerheight: '355px'
	});
	$('#projects').innerfade({
		animationtype: 'fade',
		speed: 'slow',
		timeout: 8000,
		type: 'random',
		containerheight: '122px'
	});
	$('#news').innerfade({
		animationtype: 'slide',
		speed: 'slow',
		timeout: 5000,
		type: 'random',
		containerheight: '122px'
	});
	
	$("a.single_image").fancybox({
		'hideOnContentClick': true,
		'autoDimensions':false,
		'autoScale': false,
		'overlayShow':true
	});

	$("a.wallpaper").fancybox({
		'hideOnContentClick': true,
		'autoDimensions':true,
		'autoScale': true,
		'overlayShow':true,
		'centerOnScroll':true
	});

	$("a.about_tiles").fancybox({
		'hideOnContentClick': true,
		'autoDimensions':true,
		'autoScale': true,
		'overlayShow':true,
		'titlePosition':'over'
	});

	$(".case_flash").fancybox({
	    'padding'           : 0,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
	
	$(document).bind("contextmenu",function(e){  
		return false;  
	});
	
});

