function openHintWindow(target,url){
	if (url == null){ url = ''; }
	return window.open(url,target,'width=400,height=325,resizable=1,menubar=0,status=0,scrollbars=1,toolbar=0');
}

function openReceiptWindow(target,url){
	if (url == null){ url = ''; }
	return window.open(url,target,'width=550,height=600,resizable=1,menubar=0,status=0,scrollbars=1,toolbar=0');	
}

function Banner(id){

	var id = id;
	var frequency = 7500;
	var banners = new Array();
	var position = 0;
	
	this.addBanner = function(img,txt,lnk){
		var b = new Object();
		b.img = img;
		b.txt = txt;
		b.lnk = lnk;
		banners[banners.length] = b;
	};
	
	this.run = function(){
		update();
		if (banners.length > 0){
			setInterval(nextBanner, frequency);			
		}
	};
	
	function nextBanner(){
		position++;
		if (position >= banners.length){
			position = 0;
		}
		update();
	};
	
	function update(){
		var banner = banners[position];
		
		// now update image
		var imgEl = document.getElementById(id);
		
		// find anchor tag
		var aEl = imgEl
		while (aEl != null && aEl.nodeName.toLowerCase() != 'a'){
			aEl = aEl.parentNode;
		}
		
		aEl.href = banner.lnk;
		imgEl.src = banner.img;
		imgEl.alt = banner.txt;	
	};
}

function searchFocus(e){
	if (e.value == 'Search for a product...'){
		e.value = '';
		e.style.color = '#000000';
	}
}

function searchBlur(e){
	if (e.value == ''){
		e.value = 'Search for a product...';
		e.style.color = '#999999';
	}
}
