function sizevalidate(formvar){
//pageTracker._linkByPost(this)
try
{
if (formvar.p2.value=="--")
{
alert("Please Select a Size");
return false;
}
else
{
	
try
{
	if (formvar.p1.value=="--")
	{
		alert("Please Select a Color");
		return false;	
	}
	
}
catch(e){}


}
}
catch(e){}

pageTracker._linkByPost(formvar);
return true;

}

var search_i=-1;
var last_search_i=-1;

//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/
var menuids=["treemenu1","treemenu2","treemenu3"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus_horizontal(){

var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);


for (var i=0; i<menuids.length; i++){
	try
	{
	var browserName=navigator.appName; 
  	var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu

			ultags[t].style.top="16px"

			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
	}
	catch(e){}
  }
}



function getY( oElement )
{
var iReturnValue = 0;
while( oElement != null ) {
iReturnValue += oElement.offsetTop;
oElement = oElement.offsetParent;
}
return iReturnValue;
}

function getX( oElement )
{
var iReturnValue = 0;
while( oElement != null ) {
iReturnValue += oElement.offsetLeft;
oElement = oElement.offsetParent;
}
return iReturnValue;
}

function closediv()
{
	document.all.lister.style.display = 'none';
}

function SearchAjax(Word)
{
	if ((Word!="") && (Word!="enter keyword for search") )
	{
	document.all.sterm.value = Word;

	valueer = Word.replace(" ","+");
	window.location = "Search_"+valueer;
	}
}

var xmlhttp


function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
document.getElementById("lister").style.display = "none";
}

function Ajax()
{
var args = Ajax.arguments;
	
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  return;
  }
var url="ajax.htm";
url=url+"?st="+args[1];
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}


function stateChanged()
{
if (xmlhttp.readyState==4)
{
if (xmlhttp.responseText.replace(" ","")!=""){
	document.getElementById("lister").innerHTML=xmlhttp.responseText;
	document.getElementById("lister").style.display = "";
	}
		else{
			document.getElementById("lister").innerHTML="";
	document.getElementById("lister").style.display = "none";
	}
}
}


function Sender()
{
	if (document.all.sterm.value != "")
	{
		document.all.lister.style.top = getY(document.all.sterm)+25;
		document.all.lister.style.left = getX(document.all.sterm)-12;		
		
		Ajax("send",escape(document.all.sterm.value));

	}
	else
	{
		document.all.lister.style.display = "none";
	}
}

function remove_last()
{
	last_search_i=search_i;
		
		if (document.getElementById('search_td_'+last_search_i))
			document.getElementById('search_td_'+last_search_i).className='navoff'
}

function UPsearch()
{
	try
	{
		remove_last()
		
		if ((search_i==-1) || (search_i==0))
		{
			search_i=document.getElementById('search_tbl').attributes['maxi'].value;
			//alert (document.getElementById('search_tbl').maxi)
		}
		else
			search_i= search_i-1;
			
		search_fld.value = document.getElementById('search_td_'+search_i).attributes['val'].value;
		document.getElementById('search_td_'+search_i).className='navon';
		
		
	}
	catch(e){}
}

function DOWNsearch()
{
	try
	{
		remove_last()
		
		if (search_i==document.getElementById('search_tbl').attributes['maxi'].value)
		{
			search_i=0;
		}
		else
			search_i++;
		
		search_fld.value = document.getElementById('search_td_'+search_i).attributes['val'].value;
		document.getElementById('search_td_'+search_i).className='navon';
		
	}
	catch(e){}
}

function checkerForm(e,valueer) {
	if (e.keyCode == 13) {
		valueer = valueer.replace(" ","+");
		window.location = "http://www.barefeetshoes.com/Search_"+valueer;
		document.getElementById("lister").innerHTML="";
		document.all.lister.style.display = "none";
	}
	else
	{
		if (e.keyCode == 40)//DOWN 
		{
			DOWNsearch()
			return false;
		}
		else
		{
			if (e.keyCode == 38)//UP 
			{
				UPsearch()
				return false;
			}
			else
			{
				if (e.keyCode == 27)//UP 
				{
					document.all.lister.style.display = "none";
				}
				else
				{
					search_i = -1;
				}
			}
		}
		
	}
	return true;
}

function checkerClicker() {
	Word = document.all.sterm.value;
	if ((Word!="") && (Word!="enter keyword for search") )
	{
	valueer = Word.replace(" ","+");
	window.location = "http://www.barefeetshoes.com/Search_"+valueer;
	}
	else
	{
		document.all.sterm.value="";
		document.all.sterm.focus();
	}
}