var img_src_plus="http://www.weatherbug.com/aws/images/ico_expand_plus.gif";
var img_src_minus="http://www.weatherbug.com/aws/images/ico_expand_minus.gif";


// DO NOT EDIT BELOW THIS LINE __________________________________
// BEGIN code specific for the image switching (plus to minus)
var fileOnly_img_src_plus = fileOnly(img_src_plus);

function fileOnly (InString)  {
LastSlash=InString.lastIndexOf ('/', InString.length-1)
OutString=InString.substring  (LastSlash+1, InString.length)
return (OutString); 
}

function changepic(img_name) {
	if (fileOnly(document[img_name].src) == fileOnly_img_src_plus) 
	{
		img_src = img_src_minus;
	}
	else
	{
		img_src = img_src_plus;
	}
document[img_name].src=img_src;
}
// END code for image switching



//begin IE 4+ And NS6 dHTML Outlines
	function hideshow(which, img)
	{ 
		changepic(img); //added image switch - J. Alexander Fox
		var oWhich;
		if (!document.getElementById|document.all)
		{
			return
		}
		else
		{
			if (document.getElementById)
			{
				oWhich = eval ("document.getElementById('" + which + "')")
			}
			else
			{
				oWhich = eval ("document.all." + which)
			}
		}

		window.focus()

		if (oWhich.style.display=="none")
		{
			oWhich.style.display=""
		}
		else
		{
			oWhich.style.display="none"
		}
	}
	//end IE 4+ And NS6 dHTML Outlines
	function initoutlineExpandible(count)
	{	
		var i;
		var childid; 
		for(i=1; i<=count; i++)
		{
			childid = "outlineChild" + i
			hideshow(childid)
		}
	}

	function validatesearch()
	{	
		if ((LessonSearch.subjectarea.selectedIndex == 0 ) && (LessonSearch.grade.selectedIndex == 0 )
		&& (LessonSearch.language.selectedIndex == 0 ) && ((LessonSearch.keywords.value).length < 1) )
		{
			alert("Please enter valid search criteria");					
			return false;
		}				
		else
		{
				return true;
		}
	} // end validate
	
	function winName()
	{
		window.name = "LessonSearch" ;
		window.focus;
	}

	function popUp(url)
	{	
		var w = screen.width; 
		if (w<740) 
		{
			window.open(url, "WeatherBugAchieve",'left=0,top=0,toolbar=0,scrollbars=1,location=0,status=0,menubars=0,resizable=0,width=630,height=450');
		} 
		else if (w>=740 && w<835) 
		{ 
			window.open(url, "WeatherBugAchieve",'left=0,top=0,toolbar=0,scrollbars=1,location=0,status=0,menubars=0,resizable=0,width=800,height=500');
		}
		else 
		{ 
			window.open(url);
		} 
	} // end popup
	
	function resetForm()
	{
		document.LessonSearch.subjectarea.selectedIndex = 0;
		document.LessonSearch.language.selectedIndex = 0;
		document.LessonSearch.grade.selectedIndex = 0;
		document.LessonSearch.keywords.value = "";
	
	} // end resetForm