window.onerror = SymError;
goPhotos();
goSupply();
var supplyPos = 600;
var count = 0;
var count2 = 0;
var changeBlank = 0;
var changeSupply = 80; 		//time red text scrolling for
var changeSupplyLength = 24;	//total time black text shown
var changeSupplyFlashing = 6;	//


function goPhotos()
{

}

function goSupply()
{
	var SupplyInterval = setInterval(NextSupply, 100);
}

function NextPhoto()
{
var PhotoInterval = setInterval(NextPhoto, 4000);
	var PhotoSrc = "images/";
	var Photos = new Array('rotate1.jpg','rotate2.jpg','rotate3.jpg','rotate4.jpg','rotate5.jpg');
	var CurrentPhotoURL = document.images["Advert"].src;
	var CurrentPhoto = CurrentPhotoURL.substr(CurrentPhotoURL.lastIndexOf("/")+1);
	var x = 0;
	while ((CurrentPhoto != Photos[x]) && (x < Photos.length)) {x++;}
	if (x == (Photos.length - 1)) {x=0;} else {x=x+1;}
	document.images["Advert"].src = PhotoSrc + Photos[x];
}

function NextSupply()
{
	if ( count < changeSupply )
	{
		NextSupplyRolling()
	}
	else
	{
		NextSupplyContact()
		if( count > changeSupply + changeSupplyLength )
		{
			count=1;
		}
	}
	count++;
}


function NextSupplyContact()
{

	if ( count2 < changeSupplyFlashing )
	{
		count2++;
	}
	else
	{
		if ( changeBlank == 0 )
		{
			count2 = changeSupplyFlashing -2;
		}
		else
		{
			count2 = 0;
		}
		
		changeBlank = 1 - changeBlank;		
	}
	if ( changeBlank == 0 )
	{
		supplyDescr.innerHTML = "<div class=blackLargeBoldCenter>Contact Us Now!! For more information, samples & competitive quotations!!</div>"
	}	
	else
	{
		supplyDescr.innerHTML = ""
	}
}

function NextSupplyRolling()
{
	var txtSupply = "Other Promotional Gifts, Promotional Merchandise, Promotional Incentives, Promotional Business Gifts, Key Fobs, Key rings, Key Tags, Key Holders, Perspex Key ring, Window Key ring, Photo Key ring, Leather Key Fobs,  Bonded Leather Key Fobs, Hide Leather Key Fobs, Medallion Key rings, Metal Key rings, Custom Cast Key rings, Enamelled Key rings, Ad-Loop Key rings, Plastic Key rings, Surf Key rings, Injection Moulded Key rings, Flexi Moulded Key rings, Liquid Key rings, Floating Key rings, Action Key rings, Functional Key rings, Torch Key rings, Can Opener Key rings, Tape Measure Key rings, Karabina Key rings, Spirit Level Key rings, Floating Foam Key rings, Stress Key rings, Wooden Key rings, Crystal Key rings, Quality Metal Key rings, Unique Key rings, Modern Key rings, Compass Key rings, Steering Wheel Key rings, Tax Disc Holders, Rear Window Stickers, Document Wallets, ";
	if ( supplyPos < ( txtSupply.length - 60))
	{
		supplyDescr.innerHTML = "We can supply: " + txtSupply.substr(supplyPos, 60);
	}
	else
	{
		supplyDescr.innerHTML = "We can supply: " + txtSupply.substr(supplyPos, 60) + txtSupply.substr(0, 60 - txtSupply.length + supplyPos);
	}
	if ( supplyPos == txtSupply.length - 1 )
	{
		supplyPos = 60;
	}


	supplyPos ++;
}

function SymError()
{ 
	return true;
}
	

function popup(URL,width,height)
{	      
	var newwin=window.open(URL,"pop","toolbar=no,statusbar=no,width="+width+",height="+height+",top=200,left=300")      
}      

function openurl(URL)
{	      
	var newwin=window.open(URL,"pop","")      
}
  
function PreloadImages()      
{        
	if(document.images)	
	{	  
		if(!document.Preloaded)
		{	    
			document.Preloaded = new Array();		
	    		var nCounter , nLen = document.Preloaded.length, saArguments = PreloadImages.arguments;
	    		for(nCounter = 0; nCounter < saArguments.length; nCounter++)	
	    		{
	      			document.Preloaded[nLen] = new Image;
	      			document.Preloaded[nLen++].src = saArguments[nCounter];
            		}
   	  	}
        }
}
    
