// JavaScript Document

	// Function to find the browser and return the ID
	function fnFindBrowserID(theID)
	{
		if (document.layers)// for Mozila
		{
			theID = document.layers[theID];
		}
		else if (document.all)// IE
		{
			theID = document.all[theID];
		}
		else // Others
		{
			theID = document.getElementById(theID);
		}
		return theID;	
	}
	
	// Because differant browsers use differant words for 'show' this function is used
	function fnVisible(theID)
	{		
		// Hidden and visible are differant for each browser, this will use the corect one for each		
		if (document.layers)// for Mozila
		{
			visible = 'show';
		}
		else if (document.all)// IE
		{
			visible = 'visible';
		}
		else // Others
		{
			visible = 'visible';
		}
		return visible;		
	}
	
	// Because differant browsers use differant words for 'hide' this function is used
	function fnHidden(theID)
	{		
		// Hidden and visible are differant for each browser, this will use the corect one for each		
		if (document.layers)// for Mozila
		{
			hidden  = 'hide';
		}
		else if (document.all)// IE
		{
			hidden  = 'hidden';
		}
		else // Others
		{
			hidden  = 'hidden';
		}
		return hidden;			
	}
	
	// This function swaps an image for another in a given id
	function fnSwapImage(theID, theImage)
	{
		// Function to change an image to another image.
		theID = fnFindBrowserID(theID);		
		theID.src=theImage;		
	}
	
	// Takes in an id and some text and changes the text in the id to the new text
	function fnChangeText(theID, theText)
	{
		theID = fnFindBrowserID(theID);
		theID.firstChild.nodeValue=theText;
	}
		
	// This function will take an id and hide it by making the display none
	function fnHide(theID)
	{
		theID = fnFindBrowserID(theID);
		theID = theID.style.display="none";
	}
	
	// This function will take an id and hide it by making the display none
	function fnShow(theID)
	{
		theID = fnFindBrowserID(theID);
		theID.style.display="block";
	}
	
	// This function will take in any ID and colour and change the ID's background colour to the given colour
	function fnChangeColour(theID, theColour)
	{
		theID = fnFindBrowserID(theID);
		theID.style.background=theColour;
		//alert(thisID);
	}
	
	// This is a function to add a class to all the image buttons. This is done like this because osCommerce doesn't have classes in buttons
	function addClassToImageInputs()
	{
		var els = document.getElementsByTagName('input');
		var elsLen = els.length;
		var i = 0;
		for ( i=0;i<elsLen;i++ )
		{
			if ( els[i].getAttribute('type') )
			{
				if ( els[i].getAttribute('type') == "image" )
				els[i].className = 'clInputImage';
			}
		}
	}
	addClassToImageInputs();
	
	// This function will take in an ID and class and change the id to the class
	function fnChnageClass(theID, theClass)
	{	
		theID = fnFindBrowserID(theID);
		
		if (document.layers)// for Mozila
		{
			theID.setAttribute("class", theClass);
		}
		else if (document.all)// IE
		{
			theID.setAttribute("className", theClass); // IE being funny and uses className not class
		}
		else // Others
		{
			theID.setAttribute("class", theClass);
		}		
		
		return;	
	}
	
	var bookmarkurl="http://www.partycrew.co.uk"
	var bookmarktitle="Party Crew - You know what to do, Call in Party Crew"
	
	function addbookmark()
	{
		if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)//IE
		window.sidebar.addPanel( bookmarktitle, bookmarkurl, '' );//Moz
	}

//add javascript:addbookmark(); to the HTML to call the function

	
//---------------------------------------------------------------------------------------------------------------------------------

// Hitslink script
/*wa_account="partycrew"; wa_location=93;
wa_pageName=location.pathname;  // you can customize the page name here
document.cookie='__support_check=1';wa_hp='http';
wa_rf=document.referrer;wa_sr=window.location.search;
wa_tz=new Date();if(location.href.substr(0,6).toLowerCase()=='https:')
wa_hp='https';wa_data='&an='+escape(navigator.appName)+ 
'&sr='+escape(wa_sr)+'&ck='+document.cookie.length+
'&rf='+escape(wa_rf)+'&sl='+escape(navigator.systemLanguage)+
'&av='+escape(navigator.appVersion)+'&l='+escape(navigator.language)+
'&pf='+escape(navigator.platform)+'&pg='+escape(wa_pageName);
wa_data=wa_data+'&cd='+
screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
'&tz='+wa_tz.getTimezoneOffset()+'&je='+ navigator.javaEnabled();
wa_img=new Image();wa_img.src=wa_hp+'://counter.hitslink.com/statistics.asp'+
'?v=1&s='+wa_location+'&acct='+wa_account+wa_data+'&tks='+wa_tz.getTime();
document.getElementById('wa_u').src=wa_hp+'://counter.hitslink.com/track.js';*/


