function AddSymbolToInputBoxes(sym){sym_exists=false;for(i=0;i<=7;i++){if((eval("window.document.formsearchsymbol.sym_"+i).value==sym)&&(eval("window.document.formsearchsymbol.sym_"+i).value!="")){sym_exists=true;alert("Symbol "+sym+" is already exists");break}}if(!sym_exists){input_empty=false;for(i=0;i<=7;i++){if(eval("window.document.formsearchsymbol.sym_"+i).value==""){input_empty=true;eval("window.document.formsearchsymbol.sym_"+i).value=sym;break}}if(!input_empty){alert("Sorry you cannot compare mor than (8) companies")}}}var xmlHttp_comps;var xmlHttp_sectors;var id_comps;var id_sectors;function showCompLists(b){id_comps="complists";var a="ajax_compare_comp.php?Symbol="+b;xmlHttp_comps=GetXmlHttpObject(stateChanged_complists);xmlHttp_comps.open("GET",a,true);xmlHttp_comps.send(null)}function showSectorLists(b){id_sectors="sectorlists";var a="ajax_compare_sector.php?Symbol="+b;xmlHttp_sectors=GetXmlHttpObject(stateChanged_sectorlists);xmlHttp_sectors.open("GET",a,true);xmlHttp_sectors.send(null)}function stateChanged_complists(){if(xmlHttp_comps.readyState==4||xmlHttp_comps.readyState=="complete"){document.getElementById(id_comps).innerHTML=xmlHttp_comps.responseText}}function stateChanged_sectorlists(){if(xmlHttp_sectors.readyState==4||xmlHttp_sectors.readyState=="complete"){document.getElementById(id_sectors).innerHTML=xmlHttp_sectors.responseText}}function GetXmlHttpObject(c){var b=null;if(navigator.userAgent.indexOf("Opera")>=0){alert("This code doesn't work in Opera");return}if(navigator.userAgent.indexOf("MSIE")>=0){var a="Msxml2.XMLHTTP";if(navigator.appVersion.indexOf("MSIE 5.5")>=0){a="Microsoft.XMLHTTP"}try{b=new ActiveXObject(a);b.onreadystatechange=c;return b}catch(d){alert("Error. Scripting for ActiveX might be disabled");return}}if(navigator.userAgent.indexOf("Mozilla")>=0){b=new XMLHttpRequest();b.onload=c;b.onerror=c;return b}};