/* ====================================================
General Site variables script
==================================================== */

pagelink		= document.location;
pagename		= document.title;
sitename		= 'avkuk.co.uk';
siteurl			= 'http://www.avkuk.co.uk';
developer		= 'Peaknet LTD';
developerurl	= 'http://www.peaknet.ltd.uk';
setupdomain		= 'http://test.';
defaultStatus	= '';
software		= navigator.appName;
version			= parseInt(navigator.appVersion);
loc			= location.protocol;



/* ====================================================
NEW Detect for correct browser to determine CSS file
==================================================== */

if (document.all)					{ browser="ie"; }
else if	(document.layers)		 		{ browser="n4"; }   
else if (!document.all && document.getElementById && software=="Opera")	{ browser="Opera"; }
else if (!document.all && document.getElementById)	{ browser="n6"; }
else if (software=="")					{ browser="Mozilla"; }

/* ====================================================
Local or Live?
==================================================== */

if (loc == "http:" || loc == "https:")
	{
	rootPath = '/';
	}

	else

	{
	rootPath = '';
	}

/* ====================================================
Print the year
==================================================== */

var now		= new Date
thisyear	= now.getYear()

if (thisyear <= 1900) { thisyear = thisyear + 1900 }


function loadPageExtras(){

	thisPage = location.pathname;
	
	if(thisPage == '/'){
	
		startHomeBillboards();		
	}


}


function ieMenus(){

	menulis = $("ul#topmenu").children("li");
	rightmenulis = $("ul#rightfittingsmenus").children("li");
	
	$(menulis).each(function(){
	
		$(this).mouseover(function(){
			
			$(this).css("background-color","#00478a");
			$(this).children("ul").css("left","0px");
		});
	
		$(this).mouseout(function(){
		
			$(this).css("background-color","");
			$(this).children("ul").css("left","-10000px");
		});
	});
	
	$(rightmenulis).each(function(){
	
		$(this).mouseover(function(){
			
			$(this).children("ul").css({"left":"auto","right":"177px","width":"140px"});
		});
	
		$(this).mouseout(function(){
		
			$(this).children("ul").css({"left":"-10000px","right":"auto"});
		});
	});
}

var homeBillTimer;
function startHomeBillboards(){

	billboardsCount = $("div#homeFittings").children("div.homeFittings");
	
	if(billboardsCount.length>0){
		
		$("div#homeFittings").css("background-image","none");
		$(billboardsCount[0]).show();
		$(billboardsCount[0]).css("z-index",10);
		$("div#homeFittings").attr("billboard","0");
		var homeBillTimer = setTimeout("rotateHomeBillboards()",6000);
	}
}

function rotateHomeBillboards(){

	clearTimeout("homeBillTimer");
	billboardsCount = $("div#homeFittings").children("div.homeFittings");
	
	thisBillboard = $("div#homeFittings").attr("billboard");
	thisZindex = $(billboardsCount[thisBillboard]).css("z-index");
	
	nextBillboard = parseInt(thisBillboard)+1;
	if(thisBillboard >= billboardsCount.length-1)nextBillboard = 0;
	nextZindex = parseInt(thisZindex)+1;
	
	$(billboardsCount[nextBillboard]).css("z-index",nextZindex);
	$(billboardsCount[nextBillboard]).fadeIn("slow",function(){
		
		$(billboardsCount[thisBillboard]).hide();
		$("div#homeFittings").attr("billboard",nextBillboard);
		var homeBillTimer = setTimeout("rotateHomeBillboards()",6000);
	});
}

/* ====================================================
Things to do when page is loaded
==================================================== */

function loaded()
{
document.prodfind.search_text.focus();
// alert('page loaded!');
}

/* ====================================================
Generic Pop-Up Window function
==================================================== */

function popUp(url)
{
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}

/* ====================================================
Output footer menu options + Date area
==================================================== */

function footMenu()
{
document.write('<A href="/" target="_top">Home</a> | <a href="#back" onclick="history.go(-1);">Back</A> | <a href="#top">Top</A> | <a href="/search.htm">Search</A> | <a href="/corporate.htm">Corporate</A> | <a href="/carriage.htm">Delivery</A>| <a href="/jobs.htm">Jobs</A> | <a href="/contact.htm">Contact</A>');
}

function footDate()
{
document.write('<SPAN TITLE="Please email us before using any imagery or content from this site. Ta.">© '+thisyear+ ' AVK UK Ltd</SPAN>');
}


/* ====================================================
Page <TITLE> reminder
==================================================== */

if (document.title == 'not set')
{
alert('John or Simon have forgotten to set the page <TITLE> for this page - BAD, BAD, BAD!');
}

/* ====================================================
Down Function for Icon Pages
==================================================== */

function down(icon)
{
icon.className = 'glogoslotdown';
}

/* =========================================================================================================================
End of file
========================================================================================================================= */


