﻿function StartViewMap(a, b) { var c = document.getElementById(b); var d = ''; var e = document.getElementById('hintMap'); e.className = 'hintMapHover'; switch (a) { case 'USA': c.src = 'http://img.lavva.com/FirstPage/NorthAmericaH.gif'; break; case 'LatinAmerica': c.src = 'http://img.lavva.com/FirstPage/LatinAmericaH.gif'; break; case 'Europe': c.src = 'http://img.lavva.com/FirstPage/EuropeH.gif'; break; case 'AustraliaOceania': c.src = 'http://img.lavva.com/FirstPage/AustraliaOceaniaH.gif'; break; case 'Asia': c.src = 'http://img.lavva.com/FirstPage/AsiaH.gif'; break; case 'Africa': c.src = 'http://img.lavva.com/FirstPage/AfricaH.gif'; break; case 'MiddleEast': c.src = 'http://img.lavva.com/FirstPage/MiddleEastH.gif'; break; case '': c.src = 'http://img.lavva.com/FirstPage/mapColor.gif'; e.className = 'hintMap'; break } } function boldSuggs(a, b) { var c = a.get_completionList().children; var d = new RegExp(a._currentPrefix, "g"); var e = "<b>" + a._currentPrefix + "</b>"; for (var i = 0; i < c.length; i++) { c[i].innerHTML = c[i].innerHTML.replace(d, e) } } function showSuggs(a) { var b = a.get_completionList(); var c = $(b.parentNode).find("div.ppNFixedWrapper"); c.height($(b).height()); c.show() } function hideSuggs(a) { var b = a.get_completionList(); var c = $(b.parentNode).find("div.ppNFixedWrapper"); $(c).hide() } function selectSugg(a, b) { a.get_element().value = b.get_value() } function SaveQueryDataToCookie(a, b) { var c = $get(a).value; setCookie(b, c, null) } function setCookie(a, b, c) { var d = new Date(); d.setDate(d.getDate()); document.cookie = a + "=" + escape(b) + ((c == null) ? "; path=/" : ";expires=" + d.toGMTString() + +"; path=/") } function getCookie(a) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(a + "="); if (c_start != -1) { c_start = c_start + a.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) c_end = document.cookie.length; return unescape(document.cookie.substring(c_start, c_end)) } } return "" } function MakeSearch(a, b, c) { var d = "#"; var e = c.value; var f = getCookie('UserSearchQueryType'); if ((!e.trim && e != '') || (e.trim && e.trim() != '')) { if (b) { f = (f == '') ? 'web' : f; d = window.location.protocol + "//" + window.location.hostname + "/rts.aspx?q=" + encodeURIComponent(e.trim ? e.trim() : e) + "&st=" + f } else { f = (f == '') ? 'web' : f; var g = (b) ? "&chat=on" : ''; d = window.location.protocol + "//" + window.location.hostname + "/rts.aspx?q=" + encodeURIComponent(e.trim ? e.trim() : e) + "&st=" + f + g } window.location = d } else { return false } } function ChangeQueryType(a, b) { var c = document.getElementById(a); var d = -1; var e = false; var f = false; if (c != null) { if (b.indexOf('+') >= 0) e = true; var g = (e ? b : c.value).split('+', 4); if (g != null) { for (var i = 0; i < g.length; ++i) { if (b == g[i]) d = i } if (d < 0) { if (c.value.split('+', 4).length == 4) { e = f = true; g = [] } else { g.push(b); if (g.length == 4) e = true } } c.value = ParseQueryTypeToUrlFormat(g, d); if (c.value == 'web+images+videos+news+web+images+videos+news') { c.value = 'web+images+videos+news' } setCookie('UserSearchQueryType', c.value, null) } for (var i = 0; i < selectorItems.length; ++i) if (e) QueryTypeSynchronization(!f, selectorItems[i]); else { if (selectorItems[i].type.indexOf('+') >= 0) QueryTypeSynchronization(false, selectorItems[i]); else if (b == selectorItems[i].type) QueryTypeSynchronization(d < 0, selectorItems[i]) } } } function QueryTypeSynchronization(a, b) { var c = document.getElementById(b.textEl); var d = document.getElementById(b.imgEl); if (a) { if (d) d.checked = true; if (c) c.className = "stCheckBoxA" } else { if (d) d.checked = false; if (c) c.className = "stCheckBox" } } function SetQueryType(a, b) { var c = document.getElementById(a); if (c) c.value = b; for (var i = 0; i < selectorItems.length; ++i) { QueryTypeSynchronization(type == selectorItems[i].type, selectorItems[i]) } } function ParseQueryTypeToUrlFormat(a, b) { if (a.length > 0) { var c = ""; for (var i = 0; i < a.length; ++i) { if (i != b) { c += a[i] + '+' } } if (c.charAt(c.length - 1) == '+') c = c.substr(0, c.length - 1); if (c.charAt(0) == '+') c = c.substr(1, c.length); return c } return "" } function IsQueryWrong(a) { a = trim(a); if (a.match(/^\S/g)) return false; else return true } function trim(a) { return a.replace(/^\s+|\s+$/g, "") }