﻿// -------------------------------------------------------
// LINEARLOGIX CORE LIBRARY
// -------------------------------------------------------

jQuery(document).ready(function() {
	// ensure a DOM-aware agent
	if (document.getElementById)
	{
		var preload_image_object = new Image();
		
		image_url = new Array();
		image_url[0] = 'images/m_1.png';
		image_url[1] = 'images/mi_0.png';
		image_url[2] = 'images/mi_1.png';

		for(x in image_url)
			jQuery('<img />').attr('src', image_url[x]).load(function() { jQuery('.profile').append(jQuery(this)); });	
	}

	// disable image dragging (FF)
	if(navigator.appName != "Microsoft Internet Explorer")
	{	
		var oElements = new Array();
	
		oElements[0] = 'menu1';
		oElements[1] = 'menu2';
		oElements[2] = 'menu3';
		oElements[3] = 'menu4';
		oElements[4] = 'menu5';
		oElements[5] = 'f1';
		oElements[6] = 'f2';		
		
		for(x in oElements)
		{
			if(document.getElementById(oElements[x]))
				jQuery('#' + oElements[x]).mousedown(function(event) { event.preventDefault(); });
		}
	}

	// disable text selection (IE)	
	if(navigator.appName == "Microsoft Internet Explorer")
	{
//		for(x=1;x<=2;x++)
//			if(document.getElementById('s' + x) != null)
//				document.getElementById('s' + x).onselectstart = function () { return false; }
			
		for(x=1;x<=5;x++)
		{
			if(document.getElementById('menu' + x) != null)
				document.getElementById('menu' + x).onselectstart = function () { return false; }		
		}
	}
});

function menuHighlight(eid, action)
{
	if(action)
	{
		jQuery('#' + eid).css('background', "url('images/m_1.png') no-repeat");
		jQuery('#' + eid).css('cursor', 'pointer');
	}	
	else
	{
		jQuery('#' + eid).css('background', "");	
		jQuery('#' + eid).css('cursor', 'default');
	}
}

function buttonHighlight(eid, action)
{
	jQuery('#' + eid).css('background', "url('images/" + eid + "_" + action + ".png') no-repeat");
}

function servicesHighlight(eid, action)
{
	if(action)
	{
		jQuery('#' + eid).css('background-color', '#c6c6c6');
		jQuery('#' + eid).css('cursor', 'pointer');
	}
	else
	{
		jQuery('#' + eid).css('background-color', '');
		jQuery('#' + eid).css('cursor', 'default');
	}
}
