<!--
// jscript.js - default javascript file

flashInstalled = 0;
flashVersion = 0;

try {

 document.execCommand("BackgroundImageCache", false, true);

} catch(err) {}

// Preloads all of the onmouseover images
function PreLoadImages()
{
	if (document.images)
	{
		images = new Array();

		var i = 0;
		for( var i=0; i<=PreLoadImages.arguments.length; i++)
		{
			images[ i ] = new Image();
			images[ i ].src = PreLoadImages.arguments[i];
		}
	}
}

function PreLoadCustom()
{
	if (document.images)
	{
		customImages = new Array();

		var i = 0;
		for( var i=0; i<=PreLoadCustom.arguments.length; i++)
		{
			customImages[ i ] = new Image();
			customImages[ i ].src = PreLoadCustom.arguments[i];
		}
	}
}

// Call the image preload function
PreLoadImages(	"images/h_home_over.gif",
		"images/h_email_over.gif",
		"images/h_sitemap_over.gif",
		"images/t_aboutus_over.gif",
		"images/t_cliental_over.gif",
		"images/t_solutions_over.gif",
		"images/t_manufacturers_over.gif",
		"images/t_offers_over.gif",
		"images/t_templates_over.gif",
		"images/t_contacts_over.gif",
		"images/t_information_over.gif",
		"images/t_accreditations_over.gif",
		"images/t_additional_divisions_over.gif",
		"images/t_news_over.gif",
		"images/t_community_over.gif",
		"images/t_testimonials_over.gif",
		"images/t_countries_serviced_over.gif");

// Returns an object given its id
function GetObject( id )
{
	var obj = document.all ? document.all[ id ] : document.getElementById( id );
	return obj;
}

// updates the specified image with the given filename
// (used on mouseover and mouseout events
function UpdateImage( id, filename )
{
	var obj = GetObject( id );
	obj.src = filename;
}

// used to open links in a new window (a replacement for target)
function NewWindow( link )
{
	window.open(link, '_blank');
}

function Currency( num ) 
{
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	pence = num%100;
	num = Math.floor(num/100).toString();
	if(pence<10)
	pence = "0" + pence;
	//for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	//num = num.substring(0,num.length-(4*i+3))+','+
	//num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + pence);
}

// detects whether flash player is installed
function DetectFlash()
{
	if( navigator.plugins && navigator.plugins.length )
	{
		var plugin = navigator.plugins[ "Shockwave Flash" ];
		if( plugin )
		{
			flashInstalled = 1;
			if( plugin.description )
			flashVersion = plugin.description.charAt( plugin.description.indexOf( '.' ) - 1 );
		}
		else
			flashInstalled = 0;
		
		if( navigator.plugins[ "Shockwave Flash 2.0" ] )
		{
			flashInstalled = 1;
			flashVersion = 2;
		}
	}
	else if( navigator.mimeTypes && navigator.mimeTypes.length )
	{
		var type = navigator.mimeTypes[ 'application/x-shockwave-flash' ];
		if( type && type.enabledPlugin )
			flashInstalled = 1;
		else
			flashInstalled = 0;
	}
	else 
	{
		// Internet Explorer
		for( var i = 9; i > 0; i-- )
		{
			try
			{
				var flash = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash." + i );
				flashInstalled = 1;
				flashVersion = i;
				return;
			}
			catch(e)
			{
			
			}
		}
	}
}

function ChangeDiv( className, div )
{
	var divs = document.getElementsByTagName( "div" );
	for( var i = 0; i < divs.length; i++ )
	{
		var currentDiv = divs[ i ];
		if( currentDiv.className == className )
		{
			if( currentDiv.id == div )
				currentDiv.style.display = "block";
			else
				currentDiv.style.display = "none";
		}
	}			
}

-->
