﻿
//
//  EDC header.js
//

/* Search button filter menu functions */

//var g_iSearchButtonTimer = Number(0);
//function SearchButtonMouseOver() {
//	document.getElementById('HAT-filter-menu').style.display = 'block';
//	clearTimeout(g_iSearchButtonTimer);
//}

//function SearchButtonMouseOut() {
//	g_iSearchButtonTimer = setTimeout("HideSearchFilterMenu()", 200 );
//}

//function HideSearchFilterMenu() {
//	document.getElementById('HAT-filter-menu').style.display = 'none';
//}

/* Search functions */

// Trap Enter events in the document so that the default aspx form is not submitted
//function BodyKeyPress(e) {
//	var key;      
//	if(window.event)
//		key = window.event.keyCode; //IE
//	else
//		key = e.which; //firefox      

//	return (key != 13);
//}

//// Handle the key press in the search field
//function SearchKeyPress(strKey) {
//	if ( strKey == 13 ) {
//		SearchEDC();
//	}
//}

//// Send the user to the search page for the EDC
//function SearchEDC() {
//	// Verify that the user entered search text
//	var strQuery = String(document.getElementById('q').value);

//	// Redirect them to the search page
//	var strSearchUrl = String(document.getElementById('SearchUrl').value);
//	document.location = ( strSearchUrl + "?q=" + escape(strQuery.replace(":","")) + "&source=top" );
//}

function emailFriendEDC(location) {
	var width = "492";
	var heigth = "550";
	if (!location) { location = "en_US";}
	if (location == "pl_PL") {width = "562";}
	if (location == "cs_CZ"|location == "es_MX"|location == "es_LA"|location == "es_ES"|location == "nl_NL"|location == "pt_BR") {width = "542";}
	if (location == "he_IL") {width = "502";}
	if (location == "fr_FR"|location == "vi_VN") {width = "462";}
	if (location == "uk_UA") {width = "455";}
	var shareUrl = "http://www.intel.com/sites/sitewide/" + location + "/emailfriend.htm?param=" + document.location.href;
	openWin(shareUrl,width,heigth,"no","no","no","yes",60,40,"emailfriend");
}

function EDCControlBarShowLanguageMenu() {
	EDCControlBarDontHideLanguageMenu();
	document.getElementById('EDC-control-bar-language-menu').style.display = 'block';
	if (document.getElementById('EDC-default-marquee-2-find-it-fast-filter') != null) {
		document.getElementById('EDC-default-marquee-2-find-it-fast-filter').style.display = 'none';
	}
}

var iEDCControlBarLanguageMenuTimerID = null;

function EDCControlBarHideLanguageMenuLater() {
	EDCControlBarDontHideLanguageMenu();
	iEDCControlBarLanguageMenuTimerID = setTimeout('EDCControlBarHideLanguageMenuNow();', 1000);
}

function EDCControlBarDontHideLanguageMenu() {
	// Clear the timer, if any
	clearTimeout(iEDCControlBarLanguageMenuTimerID);
	iEDCControlBarLanguageMenuTimerID = null;
}

function EDCControlBarHideLanguageMenuNow() {
	EDCControlBarDontHideLanguageMenu();
	// Hide the menu
	document.getElementById('EDC-control-bar-language-menu').style.display = 'none';

	if (document.getElementById('EDC-default-marquee-2-find-it-fast-filter') != null) {
		document.getElementById('EDC-default-marquee-2-find-it-fast-filter').style.display = 'block';
	}	
}

