var onloadFunction = function ()
	{
		createMenu();
		createFooter();
				
		MM_reloadPage(true);
	}
	
window.addEvent ('domready', function ()
	{
		onloadFunction ();
	});
	
var company_slider;

var returnToNewletters = function ()
{
	top.location = "../newletters.htm";
}

var createFooter = function ()
	{
		new Request.HTML (
			{
				url: 'http://www.quickmerlin.com/home/footer.html',
				update: $('footer'),
				method: 'get'
			}).send();
	}
	
var createMenu = function ()
	{
		new Request.HTML (
			{
				url: 'http://www.quickmerlin.com/home/menu.html',
				update: $('menu'),
				method: 'get',
				onComplete: function()
					{													
						$('company_menu_list').setPosition({relativeTo:$('company_dropdown'),position:'bottomLeft'});
						$('company_menu_list').hide();
						
						$('company_dropdown').addEvent('mouseover',function()
							{
								$('company_menu_list').show();
							});
							
						$('company_dropdown').addEvent('mouseout',function()
							{
								$('company_menu_list').hide();
							});
							
						$('services_menu_list').setPosition({relativeTo:$('services_dropdown'),position:'bottomLeft'});
						$('services_menu_list').hide();
						
						$('services_dropdown').addEvent('mouseover',function()
							{
								$('services_menu_list').show();
							});
							
						$('services_dropdown').addEvent('mouseout',function()
							{
								$('services_menu_list').hide();
							});
							
						$('contact_menu_list').setPosition({relativeTo:$('contact_dropdown'),position:'bottomLeft'});
						$('contact_menu_list').hide();
						
						$('contact_dropdown').addEvent('mouseover',function()
							{
								$('contact_menu_list').show();
							});
							
						$('contact_dropdown').addEvent('mouseout',function()
							{
								$('contact_menu_list').hide();
							});
							
						$('media_menu_list').setPosition({relativeTo:$('media_dropdown'),position:'bottomLeft'});
						$('media_menu_list').hide();
						
						$('media_dropdown').addEvent('mouseover',function()
							{
								$('media_menu_list').show();
							});
							
						$('media_dropdown').addEvent('mouseout',function()
							{
								$('media_menu_list').hide();
							});
					}
			}).send();
	}
	
var viewService = function(url)
	{
		var top_location = new String(top.location);
		
		if (top_location.indexOf('service_home') > -1)
		{
			top.location = url;
			top.location.reload();
			return false;
		}
		else
		{
			return true;
		}
	}
	
var MM_reloadPage = function (init) 
	{  	//reloads the window if Nav4 resized
		if (init==true) with (navigator)
		{
			if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
			{
				document.MM_pgW=innerWidth; 
				document.MM_pgH=innerHeight;
				onresize=MM_reloadPage; 
			}
		}
		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
		{
			location.reload();
		}
	}
	
function new_window (name, location, width, height)
{
	width < 1 ? width = 600 : width = width;
	
	height < 1 ? height = 600 : height = height;
		
	var top		= (screen.height - height)/2;
	var left	= (screen.width - width)/2;
	
	var strurl	= location;
	
	window.open(strurl, name, 'top=' + top + ',left=' + left + ',toolbar=no,scrollbars=yes,resizable=yes,height=' + height + ',width=' + width).focus();
}
