<!--//
function mainFn(){
var	today=new Date(); // Initialize Date in raw form
var cr_year = today.getFullYear(); //Getting the current year	
 document.getElementById('cp_year').innerHTML = cr_year;
}

var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;
var lvitem          = 0;

function mopen(id)
{	
    document.getElementById("mnNav11").className = 'mnNavOff';
	
	lvitem = document.getElementById(id+'1');
    lvitem.className = 'mnNavOn';
	mcancelclosetime();
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
	ddmenuitem.style.display = 'block';
}
function mclose(){
       if(ddmenuitem){ 
	      ddmenuitem.style.visibility = 'hidden'; 
		  ddmenuitem.style.display = 'none';
	      lvitem.className = 'mnNavOff'; 
	   }
}
function mclosetime(){closetimer = window.setTimeout(mclose, timeout);}
function mcancelclosetime(){
 	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}


var srchVl = 'Ticker/Stub Lookup';
var uNameVl = 'User Name';
var uPassVl = 'Password';
var tkrLkpVl = 'Use Stock Ticker / Company Name';

function SrchCln(id){
	if((document.getElementById(id).value == srchVl)||(document.getElementById(id).value == uNameVl)||(document.getElementById(id).value == tkrLkpVl))
	{
		document.getElementById(id).value = '';
	} else if (document.getElementById(id).value == uPassVl){
		document.getElementById('uPass').style.display = 'none';
		document.getElementById('uPassW').style.display = 'block';
		document.getElementById('uPassW').focus();
	}
}
function fcsCln(id){
    if(document.getElementById(id).value == ''){
	 if((id == 'EntSrch1')||(id == 'EntSrch2')){document.getElementById(id).value = srchVl}
	 if((id == 'tkLkp1')||(id == 'tkLkp2')||(id == 'tkLkp3')){document.getElementById(id).value = tkrLkpVl}
	 if(id == 'uName'){document.getElementById(id).value = uNameVl}
	 if(id == 'uPass'){document.getElementById(id).value = uPassVl}
	 if(id == 'uPassW'){
		document.getElementById('uPassW').style.display = 'none';
		document.getElementById('uPass').style.display = 'block';
		document.getElementById('uPass').value = uPassVl;
	 }
	}
}

function formChk(){
var uName = document.getElementById("uName");
var uPass = document.getElementById("uPassW");
var uNameVal = uName.value;
var uPassVal = uPass.value;	
	
 if ((uNameVal.length < 3)||(uNameVal==uNameVl)){
    alert("Please enter your \'User Name\'! \nThe entry should not be less than 3 characters.");
    uName.focus();
   } else if ((uPassVal.length < 1)||(uPassVal==uPassVl)){
	   //alert(uPassVal);
    alert("Please enter your \"Password\"!");
    document.getElementById("uPass").focus();
  } else {
	//alert('you good to go!');
	document.getElementById("lgnForm").submit()
  }
}

function closeBlk(id){
document.getElementById(id).style.display = 'none'
}
function showBlk(id){
document.getElementById(id).style.display = 'block'
}
function lnkSlkt(id){
document.getElementById(id).className ='link regSlcted';
}

function checkReturn(key) {
  if(key == 13){ 
   formChk();
   return false;
 } else {
 return true;
 }
}


var handlePrevButtonState = function(type, args) {

    var enabling = args[0];
    var leftImage = args[1];
    if(enabling) {
        leftImage.src = "images/button/arrow_left_active.gif";    
    } else {
        leftImage.src = "images/button/arrow_left_inactive.gif";    
    }
    
};

var handleNextButtonState = function(type, args) {

    var enabling = args[0];
    var rightImage = args[1];
    
    if(enabling) {
        rightImage.src = "images/button/arrow_right_active.gif";
    } else {
        rightImage.src = "images/button/arrow_right_inactive.gif";
    }
    
};


var carousel; // for ease of debugging; globals generally not a good idea
var pageLoad = function() 
{
    carousel = new YAHOO.extension.Carousel("mycarousel", 
        {
            numVisible:        5,
            animationSpeed:    0.25,
            scrollInc:         4,
            navMargin:         20,
            prevElement:     "prev-arrow",
            nextElement:     "next-arrow",
            size:              18,
            prevButtonStateHandler:   handlePrevButtonState,
            nextButtonStateHandler:   handleNextButtonState
        }
    );

};


function ifrmLoad(idFr,ifHt,mdl,dir){
var mdl_dir = 0;
var frmId = 0;
var i = 0;
if (dir=='prd1'){ 
	chk = new Array
	chk[1] = "md10"
	chk[2] = "md11"
	chk[3] = "md12"
	chk[4] = "md13"
	chk[5] = "md14"
	chk[6] = "md15"
	chk[7] = "md16"
	chk[8] = "md17"
	chk[9] = "md18"
	chk[10] = "md19"
	chk[11] = "md20"
	chk[12] = "md21"
	chk[13] = "md22"
	chk[14] = "md23"
	chk[15] = "md24"
} else if (dir=='prd2'){
	chk = new Array
	chk[0] = ""
	chk[1] = "md25"
	chk[2] = "md26"
	chk[3] = "md27"
	chk[4] = "md28"
	chk[5] = "md29"
	chk[6] = "md30"
	chk[7] = "md31"
	chk[8] = "md32"
	chk[9] = "md33"
	chk[10] = "md34"
	chk[11] = "md35"
	chk[12] = "md36"
	chk[13] = "md37"
	chk[14] = "md38"
	chk[15] = "md39"
	chk[16] = "md40"
	chk[17] = "md41"
	chk[18] = "md42"
	chk[19] = "md43"
	chk[20] = "md44"
} else if (dir=='prd3'){
	chk = new Array
	chk[0] = ""
	chk[1] = "md47"
	chk[2] = "md48"
	chk[3] = "md49"
	chk[4] = "md50"
	chk[5] = "md51"
	chk[6] = "md52"
	chk[7] = "md53"
	chk[8] = "md54"
	chk[9] = "md55"
	chk[10] = "md56"
	chk[11] = "md57"
	chk[12] = "md58"
	chk[13] = "md59"
	chk[14] = "md60"
	chk[15] = "md61"
	chk[16] = "md62"
	chk[17] = "md63"
	chk[18] = "md64"
	chk[19] = "md65"
	chk[20] = "md66"
	chk[21] = "md67"
	chk[22] = "md68"
	chk[23] = "md69"
	chk[24] = "md70"
	chk[25] = "md71"
	chk[26] = "md72"
} else if (dir=='mn'){
	chk = new Array
	chk[0] = ""
	chk[1] = "md10"
	chk[2] = "md11"
	chk[3] = "md12"
	chk[4] = "md13"
	chk[5] = "md14"
	chk[6] = "md15"
	chk[7] = "md25"
	chk[8] = "md26"
	chk[9] = "md27"
	chk[10] = "md28"
	chk[11] = "md29"
	chk[12] = "md30"
	chk[13] = "md47"
	chk[14] = "md48"
	chk[15] = "md49"
	chk[16] = "md50"
	chk[17] = "md51"
	chk[18] = "md52"
}
         
	
if (dir == 'mn'){
  mdl_dir ='main_mdls/';
  frmId = 'ifrmLdMn';
} else {
 var dirL=dir.length;
 var dirTb=dir.charAt(dirL - 1);	
  mdl_dir ='prod_mdls/';	
  frmId = 'ifrmLdPr'+dirTb;

 var tbHt = parseInt(ifHt)+20;
 //alert (tbHt);
 if (dir == 'prd1'){
     document.getElementById("tbg1").style.height = tbHt+'px';
  } else if (dir == 'prd2') {
	 document.getElementById("tbg2").style.height = tbHt+'px';
  } else if (dir == 'prd3') {
	 document.getElementById("tbg3").style.height = tbHt+'px';
  }
 	 
}
for (i=1;i<chk.length;i++){
	document.getElementById(chk[i]).className ='';
       //document.getElementById("md"+[i]).className ='';
    }
   document.getElementById(mdl).className = 'slctMdl';
   document.getElementById(frmId).innerHTML = "<iFrame src=''></iFrame>";
   document.getElementById(frmId).innerHTML = "<iFrame id="+idFr+" src='"+mdl_dir+idFr+".html' width='100%' height='"+ifHt+"' frameborder='0' allowtransparency='true' scrolling='no'></iFrame>";
}

function wOpen(pUrl,mdl,h,sec){
  w="700";
  tp=((screen.height/2)-(h/2));
  lt=((screen.width/2)-(w/2));

  chWin = window.open ("../"+pUrl+".htm?mdlNum="+mdl+sec, pUrl,"width="+w+",height="+h+",left="+lt+",top="+tp+"");
}
//-->