var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18935062-1']);
_gaq.push(['_trackPageview']);

function makeSWF(u,w,h,a)
{
	var c = '';
	if(navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length)
	{
		for(var i in a)
		{
			c += (c!=''?' ':'')+i+'='+a[i];
		}
		return '<embed src="'+u+'" type="application/x-shockwave-flash" '+c+' width="'+w+'" height="'+h+'"></embed>';
	}
	else
	{
		a['movie'] = u;
		for(var i in a)
		{
			c +='<param name="'+i+'" value="'+a[i]+'" />';
		}
		return '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+w+'" height="'+h+'">'+c+'</object>';
	}
}

function HTTPRequest(url, opt)
{
	request = XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Msxml2.XMLHTTP');
	for (i in opt.headers)
	{
		request.setRequestHeader(i, opt.headers[i]);
	}
	opt && (request.onreadystatechange = function()
	{
		if (request.readyState == 4 && request.status == 200)
		{
			opt.onready && opt.onready(request);
			typeof(opt) == 'function' && opt(request.responseText);
		}
		else
		{
			opt.onerror && opt.onerror(request);
		}
	});
	request.open(opt.method ? opt.method : 'GET', url, true);
	return request;
}

function slide_page()
{
	HTTPRequest(this.href+'?ajax', function(text)
	{
		document.getElementById('body').innerHTML = text;
	}).send('');
	return false;
}

function wait4object()
{
	var iv = setInterval(function () {
		if (this.readyState == 4) {
			clearInterval(iv)
			alert("Object loaded (maybe).")
		}
	}, 100);
}
function loaded()
{
	/*a = document.getElementsByTagName('A');
	for (i in a)
	{
		if (a[i].host == 'www.alphatech-ca.com')
		{
			a[i].onclick = slide_page;
		}
	}*/
	
}
