/* determining whether msie or netscape being used and what versions */
var IE4 = (document.all && !document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var IE5 = (document.all && document.getElementById) ? 1 : 0;
var N6 = (document.getElementById && !document.all) ? 1 : 0;
var ie = (IE4 || IE5) ? 1 : 0;
var n = (NS4 || N6) ? 1 : 0;
var IE5MAC = false;
var NS4MAC = false;

var MAC = (navigator.userAgent.indexOf("Mac")) // determines platform

/* Link function */
function go(url) {
	document.location.href=url
}

/* Go function for drop down navigations - either default formname of specified in function call*/
function dropdownListGo(optValue){

	if (document.all) { 

		location.href = document.all[optValue].value;

	}
	else if (document.getElementById) {
		
		location.href = document.getElementById(optValue).value;
		
	}
}

/* Go function for drop down navigations - either default formname of specified in function call*/
function dropdownNavGo(optValue){
	if (optValue != null) {
		if (optValue.value != "none") {
		location.href = optValue.value
		}
	} else if (document.formNav.dropdownNav.value != "none") { 
		location = document.formNav.dropdownNav.value
		}
}

/* Image rollover & preloads for images */
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function changeImage(imgName,imgObj) {
	document.images[imgName].src = eval(imgObj+".src")
}

/* Load flash file or alternate image */
function loadFlash(flashFile, altText, altImage, imageURL, width, height, loopOption)
{	
	var ShockMode = 0;
	if(CheckForFlash())
	{
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)
		{
			if (navigator.plugins && (navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 3.0"]))
				ShockMode = 1;
		}
		else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
			&& (navigator.userAgent.indexOf("Windows")>=0))
		{
			document.write('<' + 'script language="VBScript"' + '>\n');
			document.write('on error resume next \n');
			document.write('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash")))\n');
			document.write('<' + '/SCRIPT' + '> \n'); 
		
			ShockMode = 1;
		}
	
		if ( ShockMode )
		{
			if(width == '' && height == '')
			{
				document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" hspace="0" VIEWASTEXT>');
			}
			else
			{
				document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="' + width + '" height="' + height +'" hspace="0" VIEWASTEXT>');
			}
			
			document.write('<param name="movie" value="http://www.100percent-compensation.co.uk" />');
			document.write('<param name="quality" value="High" /> ');
			document.write('<param name="loop" value=' + loopOption +' /> ');
			document.write('<embed src="#" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="' + width + '" height="' + height +'" quality="High" loop="false" /></object>');	
		}
		else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0))
		{
			if(width == '' && height == '')
			{
				if(imageURL != '')
				{
					document.write('<a href="http://www.100percent-compensation.co.uk"><img src="" alt=' + altText + ' border="0" /></a>');
				}
				else
				{
					document.write('<img src="" alt=' + altText + ' border="0" />');
				}
			}
			else
			{
				if(imageURL != '')
				{
					document.write('<a href=""><img src="" alt=' + altText + ' border="0" width=' + width + ' height=' + height + '"/></a>');
				}
				else
				{
					document.write('<img src="" alt=' + altText + ' border="0" width=' + width + ' height=' + height + '"/>');
				}	
			}	
		}
	}
	else
	{
		if(width == '' && height == '')
		{
			if(imageURL != '')
			{
				document.write('<a href="http://www.100percent-compensation.co.uk"><img src="#" alt=' + altText + ' border="0" /></a>');
			}
			else
			{
				document.write('<img src="#" alt=' + altText + ' border="0" />');
			}	
		}
		else
		{
			if(imageURL != '')
			{
				document.write('<a href="http://www.100percent-compensation.co.uk"><img src="#" alt=' + altText + ' border="0" width=' + width + ' height=' + height + '"/></a>');
			}
			else
			{
				document.write('<img src="#" alt=' + altText + ' border="0" width=' + width + ' height=' + height + '"/>');
			}	
		}	
	}
}


function CheckForFlash()
{
	var flashinstalled = 0;
	var flashversion = 0;
	MSDetect = "false";
	
	if (navigator.plugins && navigator.plugins.length)	//Netscape check
	{	
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			flashinstalled = 2;
			if (x.description)
			{
				y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
		else
		{
			flashinstalled = 1;
		}					
			
		if (navigator.plugins["Shockwave Flash 2.0"])
		{
			flashinstalled = 2;
			flashversion = 2;
		}
	}
	else if (navigator.mimeTypes && navigator.mimeTypes.length)	//Netscape check
	{
		
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin)
		{
			flashinstalled = 2;
		}	
		else
		{
			flashinstalled = 1;
		}
	}
	else	//IE Check
	{
		for(var i=7; i>0; i--)
		{
			flashVersion = 0;
			try
			{
				var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				flashVersion = i;
				flashinstalled = 1;
				return flashinstalled;
			}
			catch(e){
			}
		}
	}	
	return flashinstalled;
}  


/* Pop Up Code */
/* Pop Up Code */
function PopUp(url,width,height)	{
	if (width=="new") {
		var newWindow = open (url, '_blank','width=740,height=410,location=1,status=1,toolbar=1,menubar=1,scrollbars=1,resizable=1');
	} else {
		if (width==null) width=437
		if (height==null) height=420
		var newWindow = open (url, '_blank','width='+width+',height='+height+',location=0,status=0,toolbar=0,menubar=0,scrollbars=1,resizable=1');
	}
	newWindow.focus ();
}
// HOME PAGE LOGIN BOXES CODE
function pviiClassNew(obj, new_style) {
    obj.className = new_style;
}
/* stylesheet fixes for individual browser bugs */
/* IE{Mac IE, non-Mac IE}, non-IE, NS6, non-NS4 */


if (MAC != -1)
{
	if (IE5)
	{
		IE5MAC = true; //determines if ie5 on a mac
	}
	else
	{
		if (NS4 || N6)
		{
			NS4MAC = true; // determines if net 4 or 6 on mac
		}
	}
}

document.write('<style>');
var Mac=(navigator.appVersion.indexOf('Mac')>-1)?1:0;

if (document.all) /* IE */
{
	
	if (Mac) /* Mac IE */
	{		
		document.write('UL {margin-left:20px;}');
		document.write('OL {margin-left:25px;}');
	}
	else /* non-Mac IE */
	{
		document.write('UL {margin-left:17px;}');
		if(navigator.appVersion.indexOf('6.'))
		{
			document.write('OL {margin-left:25px;}');
		}
		else
		{
			document.write('OL {margin-left:20px;}');
		}
	}
}
else /* non-IE */
{	
	document.write('UL {margin-left:-25px;}');
	document.write('OL {margin-left:-15px;}');
}

if (!document.all&&document.getElementById) /* NS6 */
{
	document.write('OL {margin-left:-12px;}');
}

document.write('</style>');






