	var urls    = new Array();
	var windows = new Array();
	var timeoutId = null;
	var url       = "";
	var refresh   = 5;
	var myWindow  = null;
	var currentURL = 0;
	var numURLs    = 0;
	var separate   = false;
	var toolbar    = 1;

	function doIt()
	{
		//alert("Status " + windows[0] + " and " + windows[0].closed );
		if ( windows[0] && !windows[0].closed )
		{
			doRefresh();
		}
		else
		{
			reset();
			var f = document.forms[0].form;

			refresh = 5;

			separate = document.getElementById("separate").checked;
			toolbar  = ( document.getElementById("toolbar").checked ? 1 : 0 );
			refresh  = document.getElementById("refresh").value;

			for ( var i=0; i<20; i++ )
			{
				id  = "url" + i;		
				url = document.getElementById(id).value;
				if ( url != "" )
				{
					if ( url.indexOf( 'http://' ) == -1 )
					{
						url = "http://" + url;
					}

					if ( url.indexOf( 'lazywebtools' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}

					if ( url.indexOf( 'lfs.net' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}

					if ( url.indexOf( 'lfsforum' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}

					if ( url.indexOf( 'majorfm' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}

					if ( url.indexOf( 'liddell' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}

					if ( url.indexOf( 'onebillionpageviews' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}
					
					if ( url.indexOf( '1billionpageviews' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}

					if ( url.indexOf( 'satradiodot' ) != -1 )
					{
						alert("You may not use the refresher with this site.");
						return;
					}
					urls[i] = url;
					numURLs++;
				}			
			}

			if ( urls.length == 0 )
			{
				alert("Please enter at least 1 URL")
				return;
			}

			var answer = confirm("This page refresher must not be used for malicious purposes.\nLazyWebTools is not responsible for the use of this tool.\nPlease note that when using this tool it is still YOUR IP address that hits the target site.\nBy hitting OK you can continue to use the tool and you agree that you are not using this tool for malicious purposes.\n\nContinue?")
            if (!answer)
		    {
				return;
			}
			if (separate)
			{
			    for (var k=0; k<numURLs; k++)
			    {
				    windows[k] = window.open(urls[k],'mywin'+k, 'toolbar=' + toolbar + ',resizable=1,scrollbars=1'); 
			    }
			}
			else
			{
				windows[0] = window.open(urls[currentURL++],'mywin', 'toolbar=' + toolbar + ',resizable=1,scrollbars=1'); 	
			}			
			timeoutId = setTimeout( "doRefresh()", refresh*1000 );
		}		
	}

	function doRefresh()
	{		
		clearTimeout(timeoutId);

		try
		{
			if (separate)
			{			
				for (var k=0; k<numURLs; k++)
				{
					if ( windows[k] && !windows[k].closed )
					{
						windows[k].location.href = urls[k];
					}
				}
			}
			else
			{
				if ( windows[0] && !windows[0].closed )
				{
			        if ( currentURL == numURLs )
		            {
			            currentURL = 0;
		            }
					windows[0].location.href = urls[currentURL];
					currentURL++;
				}
			}			
			timeoutId = setTimeout( "doRefresh()", refresh*1000 );
		}
		catch(e)
		{
			// do nothing
		}		
	}

	function reset()
	{
		urls       = new Array();
		windows    = new Array();
		currentURL = 0;
		numURLs    = 0;
		clearTimeout(timeoutId);
	}

