var c;
var mnSelected = 1;
var bgmn = new Array('','#C0E0FF', '#C8D5FF', '#E0CDF5', '#F2C6D2','#F7CDBD','#FFFF66','#FFFFFF','#E0D295','#C1E3A4','#9ADAD9','#9AB6DA','#D9A39B','#7096C4','#00CC99', '#9E3A3D','#A87182');
var ifiles = new Array('','index_web.html', 'index_site.html', 'index_news.html', 'index_blogs.html', 'index_images.html',
					   'index_yp.html', 'index_wp.html', 'index_stocks.html', 'index_jobs.html', 'index_audio.html',
						'index_video.html', 'index_classifieds.html', 'index_cities.html','index_homes.html','index_horoscopes.html','index_weather.html');
var cfiles = new Array('','web', 'site', 'news', 'blogs', 'images',
					   'yp', 'wp', 'stocks', 'jobs', 'audio',
						'video', 'classifieds', 'cities','homes','horoscopes','weather');
c=1;
function set_mn(current){
	location.href="?s=" + cfiles[current];
	return;
//   alert(current);
   for(var i = 1; i < bgmn.length; i++){
      if(i == current){
      c=i;
      //alert(current);
         document.getElementById('mn' + i).className='tcell'+i;
         document.getElementById('mn' + i).style.backgroundColor=bgmn[i];
         document.getElementById('box' + i).style.display="block";
      }else{
      //alert("sdsd");
         document.getElementById('mn' + i).className='tcell';
         document.getElementById('mn' + i).style.backgroundColor='#ffcc33';
         document.getElementById('box' + i).style.display="none";
      }
   }
}
function getcolor(current){
//alert(current);
   for(var i = 1; i < bgmn.length; i++){
      if(i == current){
         document.getElementById('mn' + i).className='tcell'+i;
         document.getElementById('mn' + i).style.backgroundColor=bgmn[i];
      }
      else if(i== c)
      {
         document.getElementById('mn' + i).className='tcell'+i;
         document.getElementById('mn' + i).style.backgroundColor=bgmn[i];
      }
      else{
         document.getElementById('mn' + i).className='tcell';
         document.getElementById('mn' + i).style.backgroundColor='#ffcc33';
      }
   }
}

function getcolorOut(){
   for(var i = 1; i < bgmn.length; i++){
      if(i== c)
      {
         document.getElementById('mn' + i).className='tcell'+i;
         document.getElementById('mn' + i).style.backgroundColor=bgmn[i];
		 document.getElementById('check').style.backgroundColor=bgmn[i];
      }
      else{
         document.getElementById('mn' + i).className='tcell';
         document.getElementById('mn' + i).style.backgroundColor='#ffcc33';
      }
   }
}


function openWin(lnk){
	window.open(lnk);
}

function checkweb(ref){
   var searchKey=ref.webt.value;
   openWin("http://www.avoo.com/web/index.php?q="+escape(searchKey));
   ref.webt.value="";
   return false;
}

function checksite(ref){
   var csite=ref.chsite.value;
   openWin("http://www.avoo.com/site/index.php?q="+escape(csite));
   ref.chsite.value="";
   return false;   
}

function checknews(ref){
   var keyword=ref.searchNews.value;
   openWin("http://www.avoo.com/news/index.php?q="+escape(keyword));
   ref.searchNews.value="";
   return false;   
}

function checkBlogs(ref){
   var blogs=ref.blogs.value;
   openWin("http://www.avoo.com/blogs/index.php?q="+escape(blogs));
   ref.blogs.value="";
   return false;   
}

function checkimages(ref){
   var keyword=ref.searchImage.value;
   openWin("http://www.avoo.com/pictures/index.php?q="+escape(keyword));
   ref.searchImage.value="";
   return false;   
}

function checkyellow(ref){
   var what=ref.what.value;
   var where=ref.where.value;
   openWin("http://www.avoo.com/yellowpages/index.php?what="+escape(what)+"&where="+escape(where));
   ref.what.value="Business Name or Category";
   ref.where.value="Zip Code or City";
   return false;   
}

function checkwhite(ref){
   var firstname=ref.firstname.value;
   var name=ref.name.value;
   var city_zip=ref.city_zip.value;
   var state_id=ref.state_id.value;
   openWin("http://www.avoo.com/whitepages/index.php?firstname="+escape(firstname)+"&name="+escape(name)+
						"&city_zip="+escape(city_zip)+"&state_id="+escape(state_id));
   ref.firstname.value="";
   ref.name.value="";
   ref.city_zip.value="";
   return false;   
}

function checkstock(ref){
   var cstock=ref.stock.value;
   openWin("http://www.avoo.com/stock/index.php?q="+escape(cstock));
   ref.stock.value="";
   return false;   
}

function checkjob(ref){
   var keyword=ref.keywords.value;
   var location=ref.locations.value;
   openWin("http://www.avoo.com/jobs/index.php?keywords="+escape(keyword)+"&locations="+escape(location));
   ref.keywords.value="keywords";
   ref.locations.value="locations";
   return false;   
}


function checkaudio(ref){   
   var audio=ref.audio.value;
   openWin("http://www.avoo.com/audio/index.php?q="+escape(audio));
   ref.audio.value="";
   return false;   
}

function checkvideo(ref){
   var video=ref.video.value;
   openWin("http://www.avoo.com/video/index.php?q="+escape(video));
   ref.video.value="";
   return false;   
}

function checkClassifieds(ref){
   var classifieds=ref.classifieds.value;
   openWin("http://www.avoo.com/classifieds/index.php?q="+escape(classifieds));
   ref.classifieds.value="";
   return false;   
}


function checkCities(ref){
   var city=ref.city.value;
   openWin("http://www.avoo.com/cities/index.php?q="+escape(city));
   ref.city.value="Zip or City & ST";
   return false;   
}

function checkHomes(ref){
   var state=ref.state.options[ref.state.selectedIndex].value;
   var city=ref.city.value;
   var zip=ref.zip.value;
   var typechoice=ref.typechoice.options[ref.typechoice.selectedIndex].value;
   //propview.php?show_thumbs=1
   openWin("http://www.avoo.com/homes/index.php?state="+escape(state) + "&city=" + escape(city) + 
					"&zip=" + zip + "&typechoice=" + escape(typechoice));
   ref.city.value="";
   ref.zip.value="";
   return false;
}

function checkHoroscopes(ref){
   var hor=ref.horoscopes.value;
   openWin("http://www.avoo.com/horoscopes/index.php?q="+escape(hor));
   ref.horoscopes.value="";
   return false;   
}

function checkWeather(ref){
   var weather=ref.weather.value;
   openWin("http://www.avoo.com/weather/index.php?q="+escape(weather));
   ref.weather.value="";
   return false;   
}