
/* General Site variables script */

pagelink		= document.location;
siteDomain	= document.domain;
pagename		= document.title;
sitetitle		= 'ukpackaging.com © ';
siteurl		= 'http://www.ukpackaging.com';
securityLevel	= location.protocol;
pagePath		= location.pathname;



/* Things to do when the page finishes loading */

function loaded()
	{
	}
	
	
/* Hide something with an ID */

function hide(chosenOne)
	{
	document.getElementById(chosenOne).className = 'hidden';
	}
	


/* ====================================================
Detect for correct browser to determine CSS file
==================================================== */

if	     (document.layers)		               		{ browser="n4"; }
else if  (document.all)		 	                    { browser="ie"; }
else if  (!document.all && document.getElementById)	{ browser="n6"; }


/* ====================================================
Left menu rollover script
==================================================== */

function menuON(slot)	{ slot.className='menuslotON';	}
function menuOFF(slot)	{ slot.className='menuslot';	}

/* ====================================================
HI-lite for form fields
==================================================== */

function hi(field)	{ field.className = 'formboxHI'; 	}
function lo(field)	{ field.className = 'formbox';		}

/* ====================================================
Previous Page
==================================================== */

function previous() { history.go(-1); }

/* ====================================================
Print Today's DATE function - Y2K + Netscape friendly
==================================================== */

var months=new Array(13);

months[1]	= "January";
months[2]	= "February";
months[3]	= "March";
months[4]	= "April";
months[5]	= "May";
months[6]	= "June";
months[7]	= "July";
months[8]	= "August";
months[9]	= "September";
months[10]	= "October";
months[11]	= "November";
months[12]	= "December";

var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)
year = year + 1900;

function year() { document.write(year); }

defaultStatus	= sitetitle + year;


/* ======================================================
End of file
====================================================== */




function format2dp(value)
{
	var tmpValue  = String(parseInt(value * 100));
	var intLength = tmpValue.length;
	return tmpValue.substring(0, intLength-2) + '.' + tmpValue.substr(intLength-2, 2);
}




function cookieGet(strName)
{
	var arrCookie       = document.cookie.split('; ');
	//var arrEachCookie = new Array();
	var strValue        = '';
	
	for( var intLoop = 0; intLoop < arrCookie.length; intLoop++)
	{
		var arrEachCookie = arrCookie[intLoop].split('=');
		
		if(arrEachCookie[0] == strName)
		{
			var strValue = arrEachCookie[1];
		}
	}
	
	return strValue;
}




function cookieSet(strName, strValue, intHours)
{
	var dtmToday    = new Date();
	var dtmExpiry   = new Date(dtmToday.getTime() + (intHours * 60 * 60 * 1000));
	
	document.cookie = strName + "=" + escape(strValue) + "; expires=" + dtmExpiry.toGMTString();
}



function cookieDelete(strName)
{
	cookieSet(strName, null, -24);
}

var radiocount = 0;

function checkRadios(toggler)
{
radiocount = radiocount+5;
document.getElementById(toggler).checked = true;
document.getElementById(toggler).disabled = true;


if (radiocount >= 25)
	{
	//alert(radiocount);
	document.getElementById('agree').disabled = false;
	}

}