/*********************************************** * Flashing Link Script- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ var flashlinks=new Array() function changelinkcolor(){ for (i=0; i< flashlinks.length; i++){ var flashtype=0 var flashcolor="red" if (flashtype==0){ if (flashlinks[i].style.color!=flashcolor) flashlinks[i].style.color=flashcolor else flashlinks[i].style.color='' } else if (flashtype==1){ if (flashlinks[i].style.backgroundColor!=flashcolor) flashlinks[i].style.backgroundColor=flashcolor else flashlinks[i].style.backgroundColor='' } } } function init(){ var i=0 if (document.all){ while (eval("document.all.flashlink"+i)!=null){ flashlinks[i]= eval("document.all.flashlink"+i) i++ } } else if (document.getElementById){ while (document.getElementById("flashlink"+i)!=null){ flashlinks[i]= document.getElementById("flashlink"+i) i++ } } setInterval("changelinkcolor()", 1000) } if (window.addEventListener) window.addEventListener("load", init, false) else if (window.attachEvent) window.attachEvent("onload", init) else if (document.all) window.onload=init var pos=0; var num_rows; function changePosition(id) { if (this.pos > 0 && this.pos <= num_rows) { div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("industry_name").value = ''; } this.pos = id; div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#ffffff'; } function updateSearch(id) { if (this.pos > 0 && this.pos <= num_rows) { div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("industry_name").value = ''; } this.pos = id; div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#ffffff'; document.getElementById("industry_name").value = document.getElementById(div_id +"_value").value.replace(/&/gi, '&'); document.getElementById("suggestBox").style.visibility = 'hidden'; document.getElementById("industry_name").focus(); document.getElementById("industry_name").value = document.getElementById("industry_name").value; this.pos = 0; } function suggest(e) { var intKey = 0; e = (window.event)? event : e; intKey = (e.keyCode)? e.keyCode: e.charCode; if (intKey == 40) //down { //SWITCH THEM OFF if (this.pos>0 && this.pos<=num_rows) { div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("industry_name").value = ''; } //SWITCH THEM ON if (this.pos+1<=num_rows) { this.pos = this.pos+1; div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#ffffff'; document.getElementById("industry_name").value = document.getElementById(div_id + "_value").value.replace(/&/gi, '&'); } else if(this.pos+1 == num_rows+1) { this.pos = this.pos +1; } } else if (intKey == 38) //up { //SWITCH THEM OFF if (this.pos>0 && this.pos<=num_rows) { div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("industry_name").value = ''; } //SWITCH THEM ON if (this.pos-1>0) { this.pos = this.pos-1; div_id = "s"+this.pos; document.getElementById(div_id).style.background = '#ffffff'; input_text = document.getElementById("industry_name").value = document.getElementById(div_id + "_value").value.replace(/&/gi, '&'); } else if (this.pos-1==0) { this.pos = this.pos-1; } } else { this.pos=0; getSuggestions(); } } function getSuggestions() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="/suggest.php?str="+document.getElementById("industry_name").value+"&city_name=" + document.getElementById('city_name').value +"&sid="+Math.random(); xmlHttp.onreadystatechange=displaySuggestions; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function displaySuggestions() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { trimmed = xmlHttp.responseText.replace(/^\s+|\s+$/g, ''); delim = trimmed.indexOf(":==:"); num_rows = parseInt(trimmed.substr(0,delim)); remaining = trimmed.substr(trimmed.indexOf(":==:")+4); trimmed = remaining; if (remaining!='') { document.getElementById("suggestBox").style.visibility = 'visible'; document.getElementById("suggestBox").innerHTML=remaining; } else { document.getElementById("suggestBox").style.visibility = 'hidden'; this.pos = 0; } } } function GetXmlHttpObject() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return xmlHttp; } var pocs=0; var num_rowsc; function changePosition_c(id) { if (this.posc > 0 && this.posc <= num_rowsc) { div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("city_name").value = ''; } this.posc = id; div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#ffffff'; } function updateSearch_c(id) { if (this.posc > 0 && this.posc <= num_rowsc) { div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("city_name").value = ''; } this.posc = id; div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#ffffff'; document.getElementById("city_name").value = document.getElementById(div_id +"_value").value.replace(/&/gi, '&'); document.getElementById("suggestBoxc").style.visibility = 'hidden'; document.getElementById("city_name").focus(); document.getElementById("city_name").value = document.getElementById("city_name").value; this.pos = 0; } function suggest_c(e) { var intKey = 0; e = (window.event)? event : e; intKey = (e.keyCode)? e.keyCode: e.charCode; if (intKey == 40) //down { //SWITCH THEM OFF if (this.posc>0 && this.posc<=num_rowsc) { div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("city_name").value = ''; } //SWITCH THEM ON if (this.posc+1<=num_rowsc) { //alert('city_down on'); this.posc = this.posc+1; div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#ffffff'; document.getElementById("city_name").value = document.getElementById(div_id + "_value").value.replace(/&/gi, '&'); } else if(this.posc+1 == num_rowsc+1) { this.posc = this.posc +1; } } else if (intKey == 38) //up { //SWITCH THEM OFF if (this.posc>0 && this.posc<=num_rows) { div_id = "sc"+this.pos; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("city_name").value = ''; } //SWITCH THEM ON if (this.posc-1>0) { this.posc = this.posc-1; div_id = "sc"+this.posc; document.getElementById(div_id).style.background = '#ffffff'; input_text = document.getElementById("city_name").value = document.getElementById(div_id + "_value").value.replace(/&/gi, '&'); } else if (this.posc-1==0) { this.posc = this.posc-1; } } else { this.posc=0; getSuggestions_c(); } } function getSuggestions_c() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="/suggest_city.php?str="+document.getElementById("city_name").value+"&sid="+Math.random(); xmlHttp.onreadystatechange=displaySuggestions_c; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function displaySuggestions_c() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { trimmed = xmlHttp.responseText.replace(/^\s+|\s+$/g, ''); delim = trimmed.indexOf(":==:"); num_rowsc = parseInt(trimmed.substr(0,delim)); //alert(num_rowsc); remaining = trimmed.substr(trimmed.indexOf(":==:")+4); trimmed = remaining; if (remaining!='') { document.getElementById("suggestBoxc").style.visibility = 'visible'; document.getElementById("suggestBoxc").innerHTML=remaining; } else { document.getElementById("suggestBoxc").style.visibility = 'hidden'; this.posc = 0; } } } var posb=0; var num_rowsb; function changePosition_b(id) { if (this.posb > 0 && this.posb <= num_rowsb) { div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("search").value = ''; } this.posb = id; div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#ffffff'; } function updateSearch_b(id) { if (this.posb > 0 && this.posb <= num_rowsb) { div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("search").value = ''; } this.posb = id; div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#ffffff'; document.getElementById("search").value = document.getElementById(div_id +"_value").value.replace(/&/gi, '&'); document.getElementById("suggestBoxb").style.visibility = 'hidden'; document.getElementById("search").focus(); document.getElementById("search").value = document.getElementById("search").value; this.posb = 0; } function suggest_b(e) { var intKey = 0; e = (window.event)? event : e; intKey = (e.keyCode)? e.keyCode: e.charCode; if (intKey == 40) //down { //SWITCH THEM OFF if (this.posb>0 && this.posb<=num_rowsb) { div_id = "sb"+this.posc; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("search").value = ''; } //SWITCH THEM ON if (this.posb+1<=num_rowsb) { //alert('city_down on'); this.posb = this.posb+1; div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#ffffff'; document.getElementById("search").value = document.getElementById(div_id + "_value").value.replace(/&/gi, '&'); } else if(this.posb+1 == num_rowsb+1) { this.posb = this.posb +1; } } else if (intKey == 38) //up { //SWITCH THEM OFF if (this.posb>0 && this.posb<=num_rows) { div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#F1F8FF'; document.getElementById("search").value = ''; } //SWITCH THEM ON if (this.posb-1>0) { this.posb = this.posb-1; div_id = "sb"+this.posb; document.getElementById(div_id).style.background = '#ffffff'; input_text = document.getElementById("search").value = document.getElementById(div_id + "_value").value.replace(/&/gi, '&'); } else if (this.posb-1==0) { this.posb = this.posb-1; } } else { this.posb=0; getSuggestions_b(); } } function getSuggestions_b() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="/suggest_bus.php?str="+document.getElementById("search").value +"&city_name=" + document.getElementById("city_name").value +"&industry_name=" +document.getElementById("industry_name").value +"&sid="+Math.random(); xmlHttp.onreadystatechange=displaySuggestions_b; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function displaySuggestions_b() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { trimmed = xmlHttp.responseText.replace(/^\s+|\s+$/g, ''); delim = trimmed.indexOf(":==:"); num_rowsb = parseInt(trimmed.substr(0,delim)); //alert(num_rowsc); remaining = trimmed.substr(trimmed.indexOf(":==:")+4); trimmed = remaining; if (remaining!='') { document.getElementById("suggestBoxb").style.visibility = 'visible'; document.getElementById("suggestBoxb").innerHTML=remaining; } else { document.getElementById("suggestBoxb").style.visibility = 'hidden'; this.posb = 0; } } } function clickedon(id) { if(document.getElementById('city_name').value=='') { document.getElementById('city_name').value='Find your Area'; }else if(id=='city_name' && document.getElementById('city_name').value=='Find your Area') { document.getElementById('city_name').value=''; } if(document.getElementById('industry_name').value=='') { document.getElementById('industry_name').value='Search by Category'; }else if(id=='industry_name' && document.getElementById('industry_name').value=='Search by Category') { document.getElementById('industry_name').value=''; } if(document.getElementById('search').value=='') { document.getElementById('search').value='Business Name'; }else if(id=='search' && document.getElementById('search').value=='Business Name') { document.getElementById('search').value=''; } document.getElementById('suggestBoxc').style.visibility='hidden'; document.getElementById('suggestBox').style.visibility='hidden'; document.getElementById('suggestBoxb').style.visibility='hidden'; }