if (typeof YAHOO == "undefined") {var YAHOO = {};}
if (typeof YAHOO.adspecs == "undefined") {YAHOO.adspecs = {};}
YAHOO.util.Event.onContentReady("top-nav-menu", function () {
	var oMenuBar = new YAHOO.widget.MenuBar("top-nav-menu", { 
		autosubmenudisplay: true, 
		hidedelay: 750, 
		lazyload: true 
	});
	oMenuBar.render();
});
YAHOO.util.Event.onContentReady("extra-top-nav-menu", function () {
	var oMenuBar2 = new YAHOO.widget.MenuBar("extra-top-nav-menu", { 
		autosubmenudisplay: true, 
		hidedelay: 750, 
		lazyload: true 
	});
	oMenuBar2.render();
});
YAHOO.util.Event.onContentReady("international-menu", function () {

/*
	 Instantiate a MenuBar:  The first argument passed to the 
	 constructor is the id of the element in the page 
	 representing the MenuBar; the second is an object literal 
	 of configuration properties.
*/

var oMenuBar1 = new YAHOO.widget.MenuBar("international-menu", { 
											autosubmenudisplay: true, 
											hidedelay: 750, 
											lazyload: true });

/*
	 Call the "render" method with no arguments since the 
	 markup for this MenuBar instance is already exists in 
	 the page.
*/

oMenuBar1.render();

});
/*
function search(){
	//clearText(document.getElementById("searchfield"));
	var site = document.getElementById("site").value;
	var adunit = document.getElementById("adunit").value;
	//var position = document.getElementById("position").value;
	var position = "none";
	//alert(position);
	window.location = "search.php?site="+site+"&adunit="+adunit+"&position="+position;
	
	if (document.getElementById("searchfield").value != ""){
		window.location = "search.php?site="+document.getElementById("searchfield").value.toLowerCase()+"&adunit=none&position=none";
	}
	else {
		window.location = "search.php?site="+site+"&adunit="+adunit+"&position="+position;
	}
	
}
*/
function search(){
	var site = document.getElementById("site").value;
	var adunit = document.getElementById("adunit").value;
	var position = document.getElementById("position").value;
	var rmFilters = new Array();
	if (document.getElementById("expandable-chk").checked){
		rmFilters.push("expandable");
	}
	if (document.getElementById("polite-chk").checked){
		rmFilters.push("polite");
	}
	if (document.getElementById("videobanner-chk").checked){
		rmFilters.push("videobanner");
	}
	if (document.getElementById("polling-chk").checked){
		rmFilters.push("polling");
	}
	if (document.getElementById("streaming-chk").checked){
		rmFilters.push("streaming");
	}
	if (document.getElementById("surveying-chk").checked){
		rmFilters.push("surveying");
	}
	if (document.getElementById("inbannerstreaming-chk").checked){
		rmFilters.push("inbannerstreaming");
	}
	if (document.getElementById("instreamvideo-chk").checked){
		rmFilters.push("instreamvideo");
	}
	if (document.getElementById("politedownload-chk").checked){
		rmFilters.push("politedownload");
	}
	if (document.getElementById("wallpaper-chk").checked){
		rmFilters.push("wallpaper");
	}
	if (document.getElementById("tearback-chk").checked){
		rmFilters.push("tearback");
	}
	if (document.getElementById("floating-chk").checked){
		rmFilters.push("floating");
	}

	var rmFilterString = (rmFilters.length > 0)? "&rmfilters="+rmFilters.join(",") : "";
	var siteSearchString = "site="+site; 
	window.location = "search.php?"+siteSearchString+"&adunit="+adunit+"&position="+position+rmFilterString;

}