// JavaScript Document
function check_value(e,formid,fieldid)
{
	var oform = document.forms[formid];
	if (oform.elements[fieldid].value != "") oform.submit();
	else alert('Please provide search criteria');
	e.cancelBubble = true;
	e.returnValue = false;
	 if (e.stopPropagation)
	 {
	   e.stopPropagation();
	   e.preventDefault();
	 }	
}


function swap_pics(iid, pic)
{
	if(document.all)
	{
		var oitem = document.all[iid];
		oitem.src = pic;
	}
	if (!document.all && document.getElementById)
	{
		var oitem = document.getElementById(iid);
		oitem.src = pic;
	}
	
src = ["images/store1.jpg", "images/store2.jpg", "images/store3.jpg", "images/store4.jpg"]
url = ["http://freewarejava.com", "http://javascriptkit.com", "http://dynamicdrive.com", "http://www.geocities.com"]
duration = 4;
ads=[]; 
ct=0;

function switchAd() {
	var n=(ct+1)%src.length;
	if (ads[n] && (ads[n].complete || ads[n].complete==null))
	{
		document["store_img"].src = ads[ct=n].src;
	}
	ads[n=(ct+1)%src.length] = new Image;
	ads[n].src = src[n];
	setTimeout("switchAd()",duration*1000);
}
function doLink(){
	location.href = url[ct];
} 

onload = function()
{
	if (document.images)
	switchAd();
}


}

