﻿
/*******************************************************************/
/*                                                                 */
/* Copyright (c) 2005-2009 Jasob.com                               */
/*                                                                 */
/* This obfuscated code was created by Jasob 3.5 Trial Version.    */
/* The code may be used for evaluation purposes only.              */
/* To obtain full rights to the obfuscated code you have to        */
/* purchase the license key (http://www.jasob.com/Purchase.html).  */
/*                                                                 */
/*******************************************************************/

var RPSUtilsX=new function(){this.tooltip=false;this.tooltipShadow=false;this.shadowSize=4;this.tooltipMaxWidth=600;this.tooltipMinWidth=100;this.iframe=false;this.tooltip_is_msie=(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('opera')== -1&&document.all);};var RPSUtils=RPSUtilsX;RPSUtilsX.changePage=function(url){parent.document.location.href=url;};RPSUtilsX.defaultSearchBy=function(val1,val2){if(val1>val2)return 1;else if(val1<val2)return-1;else return 0;};RPSUtilsX.isMarketOpening=function(){var strTime=$get('clock').innerHTML;var rcTime=strTime.split(':');var time_val=parseInt(rcTime[0])*100+parseInt(rcTime[1]);if(time_val>=825&&time_val<=1105)return true;else return false;};RPSUtilsX.setCookie=function(name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=name+'='+value+((expiredays==null)?'':'; expires='+exdate.toGMTString());};RPSUtilsX.getCookie=function(name){if(document.cookie.length>0){c_start=document.cookie.indexOf(name+'=');if(c_start!= -1){c_start=c_start+name.length+1;c_end=document.cookie.indexOf(';',c_start);if(c_end== -1)c_end=document.cookie.length;return document.cookie.substring(c_start,c_end).replace(/ /g,'');}}return '';};RPSUtilsX.Delete_Cookie=function(name){if(RPSUtilsX.getCookie)document.cookie=name+";expires=Thu, 01-Jan-1970 00:00:01 GMT";};RPSUtilsX.quickSearch=function(arr,val,cmpFunc){if(cmpFunc==undefined)cmpFunc=RPSUtilsX.defaultSearchBy;var left=0;var right=arr.length-1;var midle;var cmpRsl;while(left<=right){if(cmpFunc(arr[left],val)==0)return left;if(left==right)return-1;if(cmpFunc(arr[right],val)==0)return right;midle=Math.floor((right+left)/2);cmpRsl=cmpFunc(arr[midle],val);switch(cmpRsl){case-1:left=midle+1;right=right-1;break;case 0:return midle;case 1:right=midle-1;left=left+1;break;}}return-1;};RPSUtilsX.dateTimeToString=function(d){var year=d.getFullYear();if(year==1901)return '';var day=d.getDate();if(day<10)day='0'+day;var month=d.getMonth()+1;if(month<10)month='0'+month;var hour=d.getHours();if(hour<10)hour='0'+hour;var min=d.getMinutes();if(min<10)min='0'+min;var sec=d.getSeconds();if(sec<10)sec='0'+sec;return hour+':'+min+':'+sec+' '+day+'/'+month+'/'+year;};RPSUtilsX.dateToString=function(d){var year=d.getFullYear();if(year==1901)return '';var day=d.getDate();if(day<10)day='0'+day;var month=d.getMonth()+1;if(month<10)month='0'+month;return day+'/'+month+'/'+year;};RPSUtilsX.removeSeparatorFromDgtStr=function(num,thounsandSeparator,precisionSeparator){if(!thounsandSeparator)thounsandSeparator=',';if(!precisionSeparator)precisionSeparator='.';num=num+'';var str=num.split(thounsandSeparator).join('')+'';str=parseFloat(str)+'';return str;};RPSUtilsX.numToStringWithDgtGrp=function(num,thounsandSeparator,precisionSeparator){if(!thounsandSeparator)thounsandSeparator=',';if(!precisionSeparator)precisionSeparator='.';num=num+'';var str=RPSUtilsX.removeSeparatorFromDgtStr(num,thounsandSeparator,precisionSeparator);var sign='';if(str.charAt(0)=='-')sign='-';str=Math.abs(str)+'';var int_len=str.indexOf(precisionSeparator);var rsl='';if(int_len>=0)rsl=str.substring(int_len,str.length);if(int_len<0)int_len=str.length;var separator_count=Math.floor(int_len/3);if(separator_count*3==int_len)separator_count--;for(var i=1;i<=separator_count;i++)rsl=thounsandSeparator+str.substring(int_len-i*3,int_len-(i-1)*3)+rsl;rsl=sign+str.substring(0,int_len-(i-1)*3)+rsl;return rsl;};RPSUtilsX.showTooltip=function(clientX,clientY,tooltipTxt){var bodyWidth=Math.max(document.body.clientWidth,document.documentElement.clientWidth)-20;var bodyHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-20;if(!RPSUtilsX.tooltip){RPSUtilsX.tooltip=document.createElement('DIV');RPSUtilsX.tooltip.id='rpsoft_tooltip';RPSUtilsX.tooltipShadow=document.createElement('DIV');RPSUtilsX.tooltipShadow.id='rpsoft_tooltipShadow';document.body.appendChild(RPSUtilsX.tooltip);document.body.appendChild(RPSUtilsX.tooltipShadow);if(RPSUtilsX.tooltip_is_msie){RPSUtilsX.iframe=document.createElement('IFRAME');RPSUtilsX.iframe.frameborder='5';RPSUtilsX.iframe.src='#';RPSUtilsX.iframe.style.zIndex=10000;RPSUtilsX.iframe.style.position='absolute';document.body.appendChild(RPSUtilsX.iframe);}}RPSUtilsX.tooltip.style.display='block';RPSUtilsX.tooltipShadow.style.display='block';if(RPSUtilsX.tooltip_is_msie)RPSUtilsX.iframe.style.display='block';var st=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;var leftPos=clientX+10;var topPos=clientY+10;RPSUtilsX.tooltip.style.width=null;RPSUtilsX.tooltip.innerHTML=tooltipTxt;RPSUtilsX.tooltip.style.left=leftPos+'px';RPSUtilsX.tooltip.style.top=topPos+st+'px';RPSUtilsX.tooltipShadow.style.left=leftPos+RPSUtilsX.shadowSize+'px';RPSUtilsX.tooltipShadow.style.top=clientY+10+st+RPSUtilsX.shadowSize+'px';if(RPSUtilsX.tooltip.offsetWidth>RPSUtilsX.tooltipMaxWidth){RPSUtilsX.tooltip.style.width=RPSUtilsX.tooltipMaxWidth+'px';}var tooltipWidth=RPSUtilsX.tooltip.offsetWidth;var tooltipHeight=RPSUtilsX.tooltip.offsetHeight;if(tooltipWidth<RPSUtilsX.tooltipMinWidth)tooltipWidth=RPSUtilsX.tooltipMinWidth;RPSUtilsX.tooltip.style.width=tooltipWidth+'px';RPSUtilsX.tooltipShadow.style.width=RPSUtilsX.tooltip.offsetWidth+'px';RPSUtilsX.tooltipShadow.style.height=RPSUtilsX.tooltip.offsetHeight+'px';if((leftPos+tooltipWidth)>bodyWidth){RPSUtilsX.tooltip.style.left=(RPSUtilsX.tooltipShadow.style.left.replace('px','')-((leftPos+tooltipWidth)-bodyWidth))+'px';RPSUtilsX.tooltipShadow.style.left=(RPSUtilsX.tooltipShadow.style.left.replace('px','')-((leftPos+tooltipWidth)-bodyWidth)+RPSUtilsX.shadowSize)+'px';}if((topPos+tooltipHeight)>bodyHeight){RPSUtilsX.tooltip.style.top=(RPSUtilsX.tooltipShadow.style.top.replace('px','')-((tooltipHeight)))+'px';RPSUtilsX.tooltipShadow.style.top=(RPSUtilsX.tooltipShadow.style.top.replace('px','')-((tooltipHeight))+RPSUtilsX.shadowSize)+'px';}if(RPSUtilsX.tooltip_is_msie){RPSUtilsX.iframe.style.left=RPSUtilsX.tooltip.style.left;RPSUtilsX.iframe.style.top=RPSUtilsX.tooltip.style.top;RPSUtilsX.iframe.style.width=RPSUtilsX.tooltip.offsetWidth+'px';RPSUtilsX.iframe.style.height=RPSUtilsX.tooltip.offsetHeight+'px';}};RPSUtilsX.hideTooltip=function(){if(RPSUtilsX.tooltip!=false){RPSUtilsX.tooltip.style.display='none';RPSUtilsX.tooltipShadow.style.display='none';if(RPSUtilsX.tooltip_is_msie)RPSUtilsX.iframe.style.display='none';}}
