var xmlHttp;function checkSymbol(){if(document.getElementById("searchId").value==0){alert("Please select the company, market or sector from the list")}else{sId=new String(document.getElementById("searchId").value);idArr=sId.split("_");xmlHttp=GetXmlHttpObject(function(){stateChanged_checksymbol(str)});if(xmlHttp==null){alert("Browser does not support HTTP Request");return}var a="/ajax_check_symbol.php";a=a+"?op="+idArr[0]+"&type="+idArr[1];a=a+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged_checksymbol;xmlHttp.open("GET",a,true);xmlHttp.send(null)}}function stateChanged_checksymbol(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){var a=xmlHttp.responseText;if(a==0){document.formsearch.Symbol.style.color="#dad5df";document.formsearch.Symbol.value="Incorrect Symbol !!!"}else{document.location.href=a}}}function currconverter(b,c,d){xmlHttp=GetXmlHttpObject(function(){currconverter(str)});if(xmlHttp==null){alert("Browser does not support HTTP Request");return}var a="/ajax_currency_converter.php";a=a+"?fcurr="+b+"&tcurr="+c+"&amt="+d;a=a+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged_currconverter;xmlHttp.open("GET",a,true);xmlHttp.send(null)}function stateChanged_currconverter(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){document.getElementById("result").innerHTML=xmlHttp.responseText}}function GetXmlHttpObject(c){var b=null;if(navigator.userAgent.indexOf("Opera")>=0){alert("Opera not supported...");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}}document.onmousedown=dragHandler;function showcurrency(a,b){dragOK=false;if(convertdivId.style.display=="block"){convertdivId.style.display="none"}else{convertdivId.style.display="block";convertdivId.style.top=a+"px";convertdivId.style.left=b+"px";document.convert.amount.value="1";document.convert.from.value="AED";document.convert.to.value="USD";document.getElementById("result").innerHTML=""}}function converter_reset(){document.convert.amount.value="1";document.convert.from.value="AED";document.convert.to.value="USD";document.getElementById("result").innerHTML=""}function findPositionX(b){if(typeof(b.offsetParent)!="undefined"){for(var c=0,a=0;b;b=b.offsetParent){c+=b.offsetLeft}return c}else{return b.x}}function findPositionY(b){if(typeof(b.offsetParent)!="undefined"){for(var c=0,a=0;b;b=b.offsetParent){a+=b.offsetTop}return a}else{return b.y}}var ajaxBox_offsetX=0;var ajaxBox_offsetY=0;var minimumLettersBeforeLookup=1;var ajax_list_objects=new Array();var ajax_list_cachedLists=new Array();var ajax_list_activeInput=false;var ajax_list_activeItem;var ajax_list_optionDivFirstItem=false;var ajax_list_currentLetters=new Array();var ajax_optionDiv=false;var ajax_optionDiv_iframe=false;var ajax_list_MSIE=false;if(navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("Opera")<0){ajax_list_MSIE=true}var currentListIndex=0;function ajax_getTopPos(b){var a=b.offsetTop;while((b=b.offsetParent)!=null){a+=b.offsetTop}return a}function ajax_list_cancelEvent(){return false}function ajax_getLeftPos(b){var a=b.offsetLeft;while((b=b.offsetParent)!=null){a+=b.offsetLeft}return a}function ajax_option_setValue(c,b){if(!b){b=this}var a=b.innerHTML;if(ajax_list_MSIE){a=b.innerText}else{a=b.textContent}if(!a){a=b.innerHTML}selval=new String(a);selarr=selval.split(" ");ajax_list_activeInput.value=selarr[0];if(document.getElementById("autoCompPlace").value=="compairCompName"){if(document.getElementById("selectedTab").value=="2"){sId=new String(b.id);idArr=sId.split("_");if(document.getElementById("compareCompId")){document.getElementById("compareCompId").value=idArr[0]}}}ajax_options_hide();switch(document.getElementById("autoCompPlace").value){case"compairCompName":storeCompaireSymbols();break;case"txtRsCompName":storeRsSymbol();break;case"mainSearch":document.getElementById("searchId").value=b.id;checkSymbol();break}}function ajax_options_hide(){if(ajax_optionDiv){ajax_optionDiv.style.display="none"}if(ajax_optionDiv_iframe){ajax_optionDiv_iframe.style.display="none"}}function ajax_options_rollOverActiveItem(a,b){if(ajax_list_activeItem){ajax_list_activeItem.className="optionDiv"}a.className="optionDivSelected";ajax_list_activeItem=a;if(b){if(ajax_list_activeItem.offsetTop>ajax_optionDiv.offsetHeight){ajax_optionDiv.scrollTop=ajax_list_activeItem.offsetTop-ajax_optionDiv.offsetHeight+ajax_list_activeItem.offsetHeight+2}if(ajax_list_activeItem.offsetTop<ajax_optionDiv.scrollTop){ajax_optionDiv.scrollTop=0}}}function ajax_option_list_buildList(f,b){ajax_optionDiv.innerHTML="";ajax_list_activeItem=false;if(ajax_list_cachedLists[b][f.toLowerCase()].length<=0){ajax_options_hide();return}ajax_list_optionDivFirstItem=false;var d=false;for(var c=0;c<ajax_list_cachedLists[b][f.toLowerCase()].length;c++){if(ajax_list_cachedLists[b][f.toLowerCase()][c].length==0){continue}d=true;var e=document.createElement("DIV");var a=ajax_list_cachedLists[b][f.toLowerCase()][c].split(/###/gi);if(ajax_list_cachedLists[b][f.toLowerCase()].length==1&&ajax_list_activeInput.value==a[0]){ajax_options_hide();return}e.innerHTML=a[a.length-1];e.id=a[0];e.className="optionDiv";e.onmouseover=function(){ajax_options_rollOverActiveItem(this,false)};e.onclick=ajax_option_setValue;if(!ajax_list_optionDivFirstItem){ajax_list_optionDivFirstItem=e}ajax_optionDiv.appendChild(e)}if(d){ajax_optionDiv.style.display="block";if(ajax_optionDiv_iframe){ajax_optionDiv_iframe.style.display=""}ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem,true)}}function ajax_option_list_showContent(d,b,c,f){if(f!=currentListIndex){return}var g=b.value;var e=ajax_list_objects[d].response;var a=e.split("|");ajax_list_cachedLists[c][g.toLowerCase()]=a;ajax_option_list_buildList(g,c)}function ajax_option_resize(a){ajax_optionDiv.style.top=(ajax_getTopPos(a)+a.offsetHeight+ajaxBox_offsetY)+"px";ajax_optionDiv.style.left=(ajax_getLeftPos(a)+ajaxBox_offsetX)+"px";if(ajax_optionDiv_iframe){ajax_optionDiv_iframe.style.left=ajax_optionDiv.style.left;ajax_optionDiv_iframe.style.top=ajax_optionDiv.style.top}}function ajax_showOptions(c,d,f,h){if(h.keyCode==13||h.keyCode==9){return}if(ajax_list_currentLetters[c.name]==c.value){return}if(!ajax_list_cachedLists[f]){ajax_list_cachedLists[f]=new Array()}ajax_list_currentLetters[c.name]=c.value;if(!ajax_optionDiv){ajax_optionDiv=document.createElement("DIV");ajax_optionDiv.id="ajax_listOfOptions";document.body.appendChild(ajax_optionDiv);if(ajax_list_MSIE){ajax_optionDiv_iframe=document.createElement("IFRAME");ajax_optionDiv_iframe.border="0";ajax_optionDiv_iframe.style.width=ajax_optionDiv.clientWidth+"px";ajax_optionDiv_iframe.style.height=ajax_optionDiv.clientHeight+"px";ajax_optionDiv_iframe.id="ajax_listOfOptions_iframe";document.body.appendChild(ajax_optionDiv_iframe)}var n=document.getElementsByTagName("INPUT");for(var l=0;l<n.length;l++){if(!n[l].onkeyup){n[l].onfocus=ajax_options_hide}}var b=document.getElementsByTagName("SELECT");for(var l=0;l<b.length;l++){b[l].onfocus=ajax_options_hide}var j=document.body.onkeydown;if(typeof j!="function"){document.body.onkeydown=ajax_option_keyNavigation}else{document.body.onkeydown=function(){j();ajax_option_keyNavigation()}}var g=document.body.onresize;if(typeof g!="function"){document.body.onresize=function(){ajax_option_resize(c)}}else{document.body.onresize=function(){g();ajax_option_resize(c)}}}if(c.value.length<minimumLettersBeforeLookup){ajax_options_hide();return}ajax_optionDiv.style.top=(ajax_getTopPos(c)+c.offsetHeight+ajaxBox_offsetY)+"px";ajax_optionDiv.style.left=(ajax_getLeftPos(c)-335)+"px";if(ajax_optionDiv_iframe){ajax_optionDiv_iframe.style.left=ajax_optionDiv.style.left;ajax_optionDiv_iframe.style.top=ajax_optionDiv.style.top}ajax_list_activeInput=c;ajax_optionDiv.onselectstart=ajax_list_cancelEvent;currentListIndex++;if(ajax_list_cachedLists[f][c.value.toLowerCase()]){ajax_option_list_buildList(c.value,f,currentListIndex)}else{var m=currentListIndex/1;ajax_optionDiv.innerHTML="";var k=ajax_list_objects.length;ajax_list_objects[k]=new sack();var a=d+"?"+f+"=1&letters="+c.value.replace(" ","+");ajax_list_objects[k].requestFile=a;ajax_list_objects[k].onCompletion=function(){ajax_option_list_showContent(k,c,f,m)};ajax_list_objects[k].runAJAX()}if(document.getElementById("searchId")){document.getElementById("searchId").value=0}document.getElementById("autoCompPlace").value=c.id}function ajax_option_keyNavigation(a){if(document.all){a=event}if(!ajax_optionDiv){return}if(ajax_optionDiv.style.display=="none"){return}if(a.keyCode==38){if(!ajax_list_activeItem){return}if(ajax_list_activeItem&&!ajax_list_activeItem.previousSibling){return}ajax_options_rollOverActiveItem(ajax_list_activeItem.previousSibling,true)}if(a.keyCode==40){if(!ajax_list_activeItem){ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem,true)}else{if(!ajax_list_activeItem.nextSibling){return}ajax_options_rollOverActiveItem(ajax_list_activeItem.nextSibling,true)}}if(a.keyCode==13||a.keyCode==9){if(ajax_list_activeItem&&ajax_list_activeItem.className=="optionDivSelected"){ajax_option_setValue(false,ajax_list_activeItem)}if(a.keyCode==13){return false}else{return true}}if(a.keyCode==27){ajax_options_hide()}}document.documentElement.onclick=autoHideList;function autoHideList(a){if(document.all){a=event}if(a.target){source=a.target}else{if(a.srcElement){source=a.srcElement}}if(source.nodeType==3){source=source.parentNode}if(source.tagName.toLowerCase()!="input"&&source.tagName.toLowerCase()!="textarea"){ajax_options_hide()}}function showFib(){if(fibPanelId.style.display=="block"){fibPanelId.style.display="none"}else{fibPanelId.style.display="block"}}function showSr(){if(srPanelId.style.display=="block"){srPanelId.style.display="none"}else{srPanelId.style.display="block"}}function moveHandler(a){if(a==null){a=window.event}if(a.button<=1&&dragOK){savedTarget.style.left=a.clientX-dragXoffset+"px";savedTarget.style.top=a.clientY-dragYoffset+"px";return false}}function cleanup(a){document.onmousemove=null;document.onmouseup=null;savedTarget.style.cursor=orgCursor;dragOK=false}function dragHandler(b){var a="-moz-grabbing";if(b==null){b=window.event;a="move"}var c=b.target!=null?b.target:b.srcElement;orgCursor=c.style.cursor;if(c.className=="popupControls"){savedTarget=c;c.style.cursor=a;dragOK=true;dragXoffset=b.clientX-parseInt(savedTarget.style.left);dragYoffset=b.clientY-parseInt(savedTarget.style.top);document.onmousemove=moveHandler;document.onmouseup=cleanup;return false}}function DeleteMessage(b){var a=confirm(b);if(a){return true}else{return false}}var tgs=new Array("div","td","tr","a");var szs=new Array("7pt","8pt","9pt","10pt","11pt","12pt","13pt");var startSz=1;function ts(b,h){if(!document.getElementById){return}var k=document,f=null,g=startSz,e,c,a;g+=h;if(g<0){g=0}if(g>6){g=6}startSz=g;if(!(f=k.getElementById(b))){f=k.getElementsByTagName(b)[0]}f.style.fontSize=szs[g];for(e=0;e<tgs.length;e++){a=f.getElementsByTagName(tgs[e]);for(c=0;c<a.length;c++){a[c].style.fontSize=szs[g]}}}function tsz(b,g){if(!document.getElementById){return}var h=document,f=null,e,c,a;if(!(f=h.getElementById(b))){f=h.getElementsByTagName(b)[0]}f.style.fontSize=g;for(e=0;e<tgs.length;e++){a=f.getElementsByTagName(tgs[e]);for(c=0;c<a.length;c++){a[c].style.fontSize=g}}}var enableCache=true;var jsCache=new Array();var dynamicContent_ajaxObjects=new Array();function ajax_showContent(a,c,b){document.getElementById(a).innerHTML=dynamicContent_ajaxObjects[c].response;if(enableCache){jsCache[b]=dynamicContent_ajaxObjects[c].response}dynamicContent_ajaxObjects[c]=false}function ajax_loadContent(a,b){if(enableCache&&jsCache[b]){document.getElementById(a).innerHTML=jsCache[b];return}var c=dynamicContent_ajaxObjects.length;document.getElementById(a).innerHTML="Loading content - please wait";dynamicContent_ajaxObjects[c]=new sack();dynamicContent_ajaxObjects[c].requestFile=b;dynamicContent_ajaxObjects[c].onCompletion=function(){ajax_showContent(a,c,b)};dynamicContent_ajaxObjects[c].runAJAX()}function sack(file){this.AjaxFailedAlert="Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";this.requestFile=file;this.method="POST";this.URLString="";this.encodeURIString=true;this.execute=false;this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(err){this.xmlhttp=null}}if(!this.xmlhttp&&typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest()}if(!this.xmlhttp){this.failed=true}};this.setVar=function(name,value){if(this.URLString.length<3){this.URLString=name+"="+value}else{this.URLString+="&"+name+"="+value}};this.encVar=function(name,value){var varString=encodeURIComponent(name)+"="+encodeURIComponent(value);return varString};this.encodeURLString=function(string){varArray=string.split("&");for(i=0;i<varArray.length;i++){urlVars=varArray[i].split("=");if(urlVars[0].indexOf("amp;")!=-1){urlVars[0]=urlVars[0].substring(4)}varArray[i]=this.encVar(urlVars[0],urlVars[1])}return varArray.join("&")};this.runResponse=function(){eval(this.response)};this.runAJAX=function(urlstring){this.responseStatus=new Array(2);if(this.failed&&this.AjaxFailedAlert){alert(this.AjaxFailedAlert)}else{if(urlstring){if(this.URLString.length){this.URLString=this.URLString+"&"+urlstring}else{this.URLString=urlstring}}if(this.encodeURIString){var timeval=new Date().getTime();this.URLString=this.encodeURLString(this.URLString);this.setVar("rndval",timeval)}if(this.element){this.elementObj=document.getElementById(this.element)}if(this.xmlhttp){var self=this;if(this.method=="GET"){var totalurlstring=this.requestFile+"?"+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true)}else{this.xmlhttp.open(this.method,this.requestFile,true)}if(this.method=="POST"){try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}}this.xmlhttp.send(this.URLString);this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;self.onCompletion();if(self.execute){self.runResponse()}if(self.elementObj){var elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response}else{self.elementObj.innerHTML=self.response}}self.URLString="";break}}}}};this.createAJAX()}var x_offset_tooltip=5;var y_offset_tooltip=0;var ajax_tooltipObj=false;var ajax_tooltipObj_news=false;var ajax_tooltipObj_iframe=false;var ajax_tooltip_MSIE=false;if(navigator.userAgent.indexOf("MSIE")>=0){ajax_tooltip_MSIE=true}function ajax_showTooltip(d,a){if(!ajax_tooltipObj){ajax_tooltipObj=document.createElement("DIV");ajax_tooltipObj.style.position="absolute";ajax_tooltipObj.id="ajax_tooltipObj";document.body.appendChild(ajax_tooltipObj);var b=document.createElement("DIV");b.className="ajax_tooltip_arrow";b.id="ajax_tooltip_arrow";ajax_tooltipObj.appendChild(b);var c=document.createElement("DIV");c.className="ajax_tooltip_content";ajax_tooltipObj.appendChild(c);c.id="ajax_tooltip_content";if(ajax_tooltip_MSIE){ajax_tooltipObj_iframe=document.createElement('<IFRAME frameborder="0">');ajax_tooltipObj_iframe.style.position="absolute";ajax_tooltipObj_iframe.border="0";ajax_tooltipObj_iframe.frameborder=0;ajax_tooltipObj_iframe.style.backgroundColor="#FFF";ajax_tooltipObj_iframe.src="about:blank";c.appendChild(ajax_tooltipObj_iframe);ajax_tooltipObj_iframe.style.left="0px";ajax_tooltipObj_iframe.style.top="0px"}}ajax_tooltipObj.style.display="block";ajax_loadContent("ajax_tooltip_content",d);if(ajax_tooltip_MSIE){ajax_tooltipObj_iframe.style.width=ajax_tooltipObj.clientWidth+"px";ajax_tooltipObj_iframe.style.height=ajax_tooltipObj.clientHeight+"px"}ajax_positionTooltip(a)}function ajax_showTooltip_news(d,a){if(!ajax_tooltipObj_news){ajax_tooltipObj_news=document.createElement("DIV");ajax_tooltipObj_news.style.position="absolute";ajax_tooltipObj_news.id="ajax_tooltipObj_news";document.body.appendChild(ajax_tooltipObj_news);var b=document.createElement("DIV");b.className="ajax_tooltip_arrow_news";b.id="ajax_tooltip_arrow_news";ajax_tooltipObj_news.appendChild(b);var c=document.createElement("DIV");c.className="ajax_tooltip_content_news";ajax_tooltipObj_news.appendChild(c);c.id="ajax_tooltip_content_news";if(ajax_tooltip_MSIE){ajax_tooltipObj_news_iframe=document.createElement('<IFRAME frameborder="0">');ajax_tooltipObj_news_iframe.style.position="absolute";ajax_tooltipObj_news_iframe.border="0";ajax_tooltipObj_news_iframe.frameborder=0;ajax_tooltipObj_news_iframe.style.backgroundColor="#FFF";ajax_tooltipObj_news_iframe.src="about:blank";c.appendChild(ajax_tooltipObj_news_iframe);ajax_tooltipObj_news_iframe.style.left="0px";ajax_tooltipObj_news_iframe.style.top="0px"}}ajax_tooltipObj_news.style.display="block";ajax_loadContent("ajax_tooltip_content_news",d);if(ajax_tooltip_MSIE){ajax_tooltipObj_news_iframe.style.width=ajax_tooltipObj_news.clientWidth+"px";ajax_tooltipObj_news_iframe.style.height=ajax_tooltipObj_news.clientHeight+"px"}ajax_positionTooltip_news(a)}function ajax_positionTooltip(a){var b=(ajaxTooltip_getLeftPos(a)+a.offsetWidth);var c=ajaxTooltip_getTopPos(a);var d=document.getElementById("ajax_tooltip_content").offsetWidth+document.getElementById("ajax_tooltip_arrow").offsetWidth;ajax_tooltipObj.style.left=b+"px";ajax_tooltipObj.style.top=c+"px"}function ajax_positionTooltip_news(a){var b=(ajaxTooltip_getLeftPos(a)+a.offsetWidth);var c=ajaxTooltip_getTopPos(a);var d=document.getElementById("ajax_tooltip_content_news").offsetWidth+document.getElementById("ajax_tooltip_arrow_news").offsetWidth;ajax_tooltipObj_news.style.left=b+"px";ajax_tooltipObj_news.style.top=c+"px"}function ajax_hideTooltip(){ajax_tooltipObj.style.display="none"}function ajaxTooltip_getTopPos(b){var a=b.offsetTop;while((b=b.offsetParent)!=null){if(b.tagName!="HTML"){a+=b.offsetTop}}return a}function ajaxTooltip_getLeftPos(b){var a=b.offsetLeft;while((b=b.offsetParent)!=null){if(b.tagName!="HTML"){a+=b.offsetLeft}}return a}function ajax_hideTooltip_news(){ajax_tooltipObj_news.style.display="none"}var xmlHttp;function ValidateForm(a){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(a)){if(a=="username@domain.com"){alert("Your Email is incorrect");return(false)}showSubscriber(a);return(false)}alert("Your Email is incorrect");return(false)}function showSubscriber(b){xmlHttp=GetXmlHttpObject(function(){showSubscriber(st)});if(xmlHttp==null){alert("Browser does not support HTTP Request");return}var a="/subscribers.php";a=a+"?op="+b;a=a+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged_subscriber;xmlHttp.open("GET",a,true);xmlHttp.send(null)}function stateChanged_subscriber(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){document.getElementById("user").value=xmlHttp.responseText}}function GetXmlHttpObject(c){var b=null;if(navigator.userAgent.indexOf("Opera")>=0){alert("Opera not supported...");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}};