if (document.layers) {nn=1;ie=0}
if (document.all) {nn=0;ie=1}

function showAndHide(which)
{
        if (ie)
                {
					if(document.all[which].style.visibility=="visible"){
					   document.all[which].style.visibility = "hidden"; 
					}
					else{
					   document.all[which].style.visibility = "visible"; 
					}   
                   
                }
         
                
        if (nn)
                {
					if(document.layers[which].visibility=="show"){
					   document.layers[which].visibility = "hide";
					}
					else{
					  document.layers[which].visibility = "show";
					}
					
                }
        }
        
function showlayer2(which)
        {
        if (ie)
                {
                document.all[which].style.visibility = "visible";
                }
        if (nn)
                {
                document.layers[which].visibility = "show";
                }
        }

function hidelayer2(which)
        {
                if (ie)
                        {
                        document.all[which].style.visibility = "hidden";
                        }
                if (nn)
                        {
                        document.layers[which].visibility = "hide";
                        }
        }



      function MakeArray(n) {
              this.length = n
              for (var i = 1; i<=n; i++) {
                      this[i] = new Image()
                      }
              return this
      }

       function mover(num) {
					var o = window.event.srcElement;
					if (o){
							var cID = o.src;
							if (cID != null && cID != ""){
									cID = cID.replace("_but.gif","1_but.gif");
									cID = cID.replace("_titl.gif","1_titl.gif");
									o.src = cID
							}    
					}   
      }

      function mout(num) {
					var o = window.event.srcElement;
					if (o){
							var cID = o.src;
							if (cID != null && cID != ""){
									cID = cID.replace("1_but.gif","_but.gif");
									cID = cID.replace("1_titl.gif","_titl.gif");
									o.src = cID
							}    
					}   
      
                }
 
          
    function OpenClocks(){
var iWidth = 760 ;
var iHight = 430 ;
var iLeft = (screen.width - iWidth) / 2 ;
var iTop = (screen.height - iHight) / 2 ;

eval("window.open('General/clocks.asp','','top=" + iTop + ",left=" + iLeft + ", width=" + iWidth + ",height=" + iHight + ",scrollbars=no');");
}

function OpenRates(){
var iWidth = 710 ;
var iHight = 380 ;
var iLeft = (screen.width - iWidth) / 2 ;
var iTop = (screen.height - iHight) / 2 ;

eval("window.open('General/rates.asp','','top=" + iTop + ",left=" + iLeft + ", width=" + iWidth + ",height=" + iHight + ",scrollbars=no');");

}      



function NewMailAccount(){

    iWindowHeight = 170 ;
	iWindowWidth = 420 ;
	iWidth = window.screen.width ;
	iHeight = window.screen.height ;
	iWidth = (iWidth -iWindowWidth) / 2 ;
	iHeight = (iHeight - iWindowHeight ) / 2  ;
	eval("window.open('freemail.asp','','left=" + iWidth + ",top=" + iHeight + ",width=" + iWindowWidth + ",height=" + iWindowHeight + ",scrollbars=no');");
    //window.open("freemail.asp","","width=420,height=200,scrollbars=no,noresizable" );

}

function OpenWin()
{
	window.open("General/clockrates.asp","","width=250,height=250,scrollbars=no");
}




function setToField(btn,cboName)
{
	if (btn=='0' || document.frmitem[cboName].value=='0')
		document.frmitem[cboName].selectedIndex = btn ;
}

function setToField_Txt(fTo,fFrom)
{ 
	if (document.frmitem[fTo].value=='')
		document.frmitem[fTo].value = document.frmitem[fFrom].value ;
}
	
		
function RefreshWindow()
	{

	 document.search1.submit ();
	}  
		

	
function MoveNext(filename) // calling in loginTbl.asp
		{
			iWindowHeight = 180 ;
			iWindowWidth = 420 ;
			iWidth = window.screen.width ;
			iHeight = window.screen.height ;
			iWidth = (iWidth -iWindowWidth) / 2 ;
			iHeight = (iHeight - iWindowHeight ) / 2  ;
			eval("window.open(filename,'','left=" + iWidth + ",top=" + iHeight + ",width=" + iWindowWidth + ",height=" + iWindowHeight + ",scrollbars=no');");
		
		}	
	
function check_keycode()
{
	if (((window.event.keyCode<48)||(window.event.keyCode>57))&&(window.event.keyCode!=46))
	{
		event.returnValue=false;
	}
}	


function check_keycode_number()
{
	//alert(window.event.keyCode);
	
	if (!((window.event.keyCode>=48)&&(window.event.keyCode<=57)))
	{
		event.returnValue=false;
	}
}	



function openwin_logintbl(if_opener,the_User) // calling in index.asp
		{
			iWindowHeight = 129;
			iWindowWidth = 170 ;
			iWidth =248;
			iHeight = 411;
			if (the_User > 0 )
			{
				window.document.location.href = 'http://www.idexonline.com/market_report.asp';

			}
			else
			{
				eval("window.open('http://www.idexonline.com/loginTbl.asp?if_market_report=Y&if_opener='+if_opener,'','left=" + iWidth + ",top=" + iHeight + ",width=" + iWindowWidth + ",height=" + iWindowHeight + ",scrollbars=no,resizable=no');");

			}
		}

