
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = ""; }
else { document.getElementById(d).style.display = "none"; }
}


/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/


var fadebgcolor="black"
 
////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
//document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=obj.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

function new_window(page,PWidth,PHeight,id) {
eval("urei"+id+"=window.open('"+page+"','urei1','toolbar=0,scrollbars=1,location=0,status=0,menubars=0,resizable=0,width="+PWidth+",height="+PHeight+"')")
eval("urei"+id+".window.moveTo((screen.width/2)-(PWidth/2),(screen.height/2)-(PHeight/2))")
}

function swapImage( imgName, imgSrc ) {
   x = document.getElementById( imgName );
	 if(x) { x.src = imgSrc; }
}

function check_window(checkimg){
   var ld_url= "./check_window.php?img="+checkimg;
   var attr = "width=925,height=400,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no,directories=no,status=no,copyhistory=no";
   window.open(ld_url,'checkwin',attr);
}
function imgOver(thisImg){
      // extract the file name of the image from the fully qualified source
	fullsrc = document[thisImg].src;
	srcArray = fullsrc.split("/");
    imgFile = srcArray[srcArray.length - 1];
    document[thisImg].src = "./images/"+thisImg+"_over.png";
}

function imgOut(thisImg){
      // extract the file name of the image from the fully qualified source
	fullsrc = document[thisImg].src;
	srcArray = fullsrc.split("/");
      imgFile = srcArray[srcArray.length - 1];

      // compare the file name to determine if it is a plus or a minus
    document[thisImg].src = "./images/"+thisImg+"_up.png";
}

function imgDown(thisImg){
      // extract the file name of the image from the fully qualified source
	fullsrc = document[thisImg].src;
	srcArray = fullsrc.split("/");
      imgFile = srcArray[srcArray.length - 1];

      // compare the file name to determine if it is a plus or a minus
    document[thisImg].src = "./images/"+thisImg+"_down.png";
}

function validateField (valfield, fieldtype){

  var img_file = valfield.name+"_img";

  switch(fieldtype)
  {
    case "phone":
      var tph = valfield.value;
      tph = tph.replace(/^\s+|\s+$/g, '');
      comp_str = /^\+?[0-9 () -]+[0-9]$/ ;
      if (!comp_str.test(tph)){
        valfield.className='text_in_invalid';
	    document[img_file].src = './images/info.png';
        document[img_file].alt = 'The phone number is incorrectly formed.  It has letters or non-numeric characters in it.';
        valfield.value='Invalid characters in phone number';
        return false;
      } else {
        valfield.className='text_in_valid';
        document[img_file].src='./images/star.png';
        document[img_file].alt='Required Field';
      }
      break;
    case "email":
      var str = valfield.value;
      var check1 = str.split("@");
      if (check1.length != 2){
        valfield.className='text_in_invalid';
        valfield.value = 'invalid e-mail address';
	    document[img_file].src = './images/info.png';
        document[img_file].alt = 'The e-mail address does not have the @ symbol in it.  The address is invalid.';
        valfield.alt = 'Missing @ symbol in address';
        return false;
      } else {
        valfield.className='text_in_valid';
        valfield.alt = 'Valid e-mail address';
        document[img_file].src='./images/star.png';
        document[img_file].alt='Required Field';
      }
      var check2 = check1[1].split(".");
      if (check2.length < 2){
        valfield.className='text_in_invalid';
        valfield.value = 'invalid e-mail address';
	    document[img_file].src = './images/info.png';
        document[img_file].alt = 'The domain portion of the e-mail address does not have a . in it (e.g. mydomain.something).  The address is invalid.';
        valfield.alt = 'Missing . in the domain name [someplace.somewhere]';
        return false;        
      } else {
        valfield.className='text_in_valid';
        document[img_file].src='./images/star.png';
        document[img_file].alt='Required Field';
        valfield.alt = 'Valid e-mail address';
      }
      break;
    case "text_only":
      var checkStr = valfield.value;
      
      if ((checkStr.length < 1) || valfield.value == '' || valfield.value == ' ' || valfield.value == 'invalid')
      {
        valfield.className='text_in_invalid';
	    document[img_file].src = './images/info.png';
        document[img_file].alt = 'The field is either blank or has spaces in it.  Please type a single, non-spaced word in for this field.';
        valfield.value = 'invalid';
        return false;
      } else {
        document[img_file].src='./images/star.png';
        document[img_file].alt='Required Field';
        valfield.className='text_in_valid';
      } 
      break;
    case "password":
      var checkStr = valfield.value;
      
      if ((checkStr.length < 1) || valfield.value == '' || valfield.value == ' ' || valfield.value == 'invalid')
      {
        valfield.className='text_in_invalid';
	    document[img_file].src = './images/info.png';
        document[img_file].alt = 'The field is either blank or has spaces in it.  Please type a single, non-spaced word in for this field.';
        valfield.value = '';
        return false;
      }
      if (checkStr.length < 8)
      {
        valfield.className='text_in_invalid';
        document[img_file].src = './images/info.png';
        document[img_file].alt = 'The password length is less than 8 characters.  Please choose another password';
        valfield.value = '';
        return false;
      }
      document[img_file].src='./images/star.png';
      document[img_file].alt='Required Field';
      valfield.className='text_in_valid'; 
      break;
    default:
      break;
  }
  return true;
}

function validateAll(){
  var elem;
  var err_count = 0;
  if (!validateField(document.forms.reg_form.email, 'email')) err_count += 1;
  if (!validateField(document.forms.reg_form.day_ph, 'phone')) err_count += 1;
  if (!validateField(document.forms.reg_form.lname, 'text_only')) err_count += 1;
  if (!validateField(document.forms.reg_form.fname, 'text_only')) err_count += 1;
  if (!validateField(document.forms.reg_form.username, 'text_only')) err_count += 1;
  if (!validateField(document.forms.reg_form.password, 'password')) err_count += 1;
  if (!validateField(document.forms.reg_form.vpass, 'password')) err_count += 1;
  
  if (err_count > 0) alert('There are required fields that need correction');
  return (err_count==0);
}

function validateChange(){
  var elem;
  var err_count = 0;
  if (!validateField(document.forms.chg_form.uname, 'text_only')) err_count += 1;
  if (!validateField(document.forms.chg_form.passwd, 'password')) err_count += 1;
  if (!validateField(document.forms.chg_form.vpasswd, 'password')) err_count += 1;
  if (document.forms.chg_form.passwd.value != document.forms.chg_form.vpasswd.value){
    err_count += 1;
    document.forms.chg_form.passwd.className='text_in_invalid';
    document.forms.chg_form.vpasswd.className='text_in_invalid';
    img_file = document.forms.chg_form.passwd.name + "_img";
	document[img_file].src = './images/info.png';
    document[img_file].alt = 'Passwords did not match.';
    document.forms.chg_form.passwd.value = '';
    img_file = document.forms.chg_form.vpasswd.name + "_img";
	document[img_file].src = './images/info.png';
    document[img_file].alt = 'Passwords did not match.';
    document.forms.chg_form.vpasswd.value = '';
    alert('The passwords entered did not match.  Please re-enter the passwords');
    return (err_count==0);
  }
    
  if (err_count > 0) alert('There are required fields that need correction');
  return (err_count==0);
  
}

function validateAllWB(){
  var elem;
  var err_count = 0;
  if (!validateField(document.forms.reg_form.ename, 'email')) err_count += 1;
  
  if (err_count > 0) alert('There are required fields that need correction');
  return (err_count==0);
}

function togglemenu(toggleitem) {
if(toggleitem.length < 1) { return; }
menu_name = "menu_"+toggleitem;
image_name = "img_"+toggleitem;

if(document.getElementById(menu_name).style.display == "none") {
  document.getElementById(menu_name).style.display = "list-item";
  document.getElementById(image_name).src = "./images/"+image_name+"_down.png";
  }
else {
  document.getElementById(menu_name).style.display = "none";
  document.getElementById(image_name).src = "./images/"+image_name+"_right.png";
  }
}

function emptyFunc(){
// this is used to allow a link to have a valid href so the cursor changes to a hand for selecting a link
}

function resetMenuValue(mn){
  it_nm = mn+"_sub";
  lk_nm = mn+"_lk";
  
  document.getElementById(it_nm).style.display = "none";
  document.getElementById(lk_nm).style.backgroundColor = "#000000";
}

function showsub(mn_item){
  if(mn_item.length < 1) { return; }
  item_name = mn_item+"_sub";
  
  // reset all menus to not visible
  
  document.getElementById("daily_sub").style.display = "none";
  document.getElementById("weekly_sub").style.display = "none";
  document.getElementById("add_feature_sub").style.display = "none";
  document.getElementById("links_sub").style.display = "none";
  document.getElementById("profile_sub").style.display = "none";
  resetMenuValue("tech");
  resetMenuValue("portfolio");
  resetMenuValue("sector");
  resetMenuValue("index");
  resetMenuValue("power");
  resetMenuValue("misc_st");
  resetMenuValue("city");
  
  if(document.getElementById(item_name).style.display == "none"){
    document.getElementById(item_name).style.display = "block";
  } else {
    document.getElementById(item_name).style.display = "none";
  }
}

function showsub_l1(mn_item){
  if(mn_item.length < 1) { return; }
  item_name = mn_item+"_sub";
  link_name = mn_item+"_lk";
  
  // reset all menus to not visible

  switch (mn_item){
    case "tech":
      resetMenuValue("portfolio");
      resetMenuValue("sector");
      resetMenuValue("index");
      resetMenuValue("power");
      resetMenuValue("misc_st");
      resetMenuValue("city");
      break;
    case "portfolio":
      resetMenuValue("tech");
      resetMenuValue("sector");
      resetMenuValue("index");
      resetMenuValue("power");
      resetMenuValue("misc_st");
      resetMenuValue("city");
      break;
    case "sector":
      resetMenuValue("tech");
      resetMenuValue("portfolio");
      resetMenuValue("index");
      resetMenuValue("power");
      resetMenuValue("misc_st");
      resetMenuValue("city");
      break;
    case "index":
      resetMenuValue("tech");
      resetMenuValue("portfolio");
      resetMenuValue("sector");
      resetMenuValue("power");
      resetMenuValue("misc_st");
      resetMenuValue("city");
      break;
    case "power":
      resetMenuValue("tech");
      resetMenuValue("portfolio");
      resetMenuValue("sector");
      resetMenuValue("index");
      resetMenuValue("misc_st");
      resetMenuValue("city");
      break;
    case "misc_st":
      resetMenuValue("tech");
      resetMenuValue("portfolio");
      resetMenuValue("sector");
      resetMenuValue("index");
      resetMenuValue("power");
      resetMenuValue("city");
      break;
    case "city":
      resetMenuValue("tech");
      resetMenuValue("portfolio");
      resetMenuValue("sector");
      resetMenuValue("index");
      resetMenuValue("power");
      resetMenuValue("misc_st");
      break;
  }
   
  if(document.getElementById(item_name).style.display == "none"){
    document.getElementById(item_name).style.display = "block";
    document.getElementById(link_name).style.backgroundColor = "#444444";
  } else {
    document.getElementById(item_name).style.display = "none";
    document.getElementById(link_name).style.backgroundColor = "#000000";
  }
}

function resizeChartFrame(){
  if (document.getElementById('chart_frame').style.zoom == "50%"){ //enlarge the display
    document.getElementById('chart_frame_hdr').src = "./images/chart_frame_hdr_shrink.png";
    document.getElementById('ma').style.width = "10%";
    document.getElementById('sector').style.width = "10%";
    document.getElementById('st_graph').style.width = "77%";
    document.getElementById('chart_frame').style.zoom = "100%";
  } else { //shrink the display
    document.getElementById('chart_frame').style.zoom = "50%";
    document.getElementById('chart_frame_hdr').src = "./images/chart_frame_hdr_grow.png";
    document.getElementById('ma').style.width = "33%";
    document.getElementById('sector').style.width = "32%";
    document.getElementById('st_graph').style.width = "32%";
    // reset the sector, market, and sector stock frames just in case they were changed
    if (document.getElementById('ss_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('ss_frame').style.zoom = "50%";
      document.getElementById('ss_frame_hdr').src = "./images/ss_frame_hdr_grow.png";
      document.getElementById('sect_frame').style.height = "44%";
      document.getElementById('ss_frame').style.height = "50%";
    }
    if (document.getElementById('mkt_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('mkt_frame').style.zoom = "50%";
      document.getElementById('mkt_frame_hdr').src = "./images/mkt_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
    }
    if (document.getElementById('sect_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('sect_frame').style.zoom = "50%";
      document.getElementById('sect_frame_hdr').src = "./images/sect_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
      document.getElementById('sect_frame').style.height = "44%";
      document.getElementById('ss_frame').style.height = "50%";
    }
  }
}

function resizeSSFrame(){
  if (document.getElementById('ss_frame').style.zoom == "50%"){ //enlarge the display
    document.getElementById('ss_frame_hdr').src = "./images/ss_frame_hdr_shrink.png";
    document.getElementById('ma').style.width = "10%";
    document.getElementById('sector').style.width = "77%";
    document.getElementById('st_graph').style.width = "10%";
    document.getElementById('ss_frame').style.zoom = "100%";
    document.getElementById('sect_frame').style.height = "12%";
    document.getElementById('sect_frame').style.zoom = "50%";
    document.getElementById('ss_frame').style.height = "82%";
    document.getElementById('sect_frame_hdr').src = "./images/sect_frame_hdr_grow.png";
  } else { //shrink the display
    document.getElementById('ss_frame').style.zoom = "50%";
    document.getElementById('ss_frame_hdr').src = "./images/ss_frame_hdr_grow.png";
    document.getElementById('ma').style.width = "33%";
    document.getElementById('sector').style.width = "32%";
    document.getElementById('st_graph').style.width = "32%";
    document.getElementById('ss_frame').style.height = "50%";
    document.getElementById('sect_frame').style.height = "44%";
    // reset the sector, market, and chart frames just in case they were changed
    if (document.getElementById('chart_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('chart_frame').style.zoom = "50%";
      document.getElementById('chart_frame_hdr').src = "./images/chart_frame_hdr_grow.png";
    }
    if (document.getElementById('mkt_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('mkt_frame').style.zoom = "50%";
      document.getElementById('mkt_frame_hdr').src = "./images/mkt_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
    }
    if (document.getElementById('sect_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('sect_frame').style.zoom = "50%";
      document.getElementById('sect_frame_hdr').src = "./images/sect_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
      document.getElementById('sect_frame').style.height = "44%";
      document.getElementById('mkt_frame').style.height = "50%";
    }    
  }
}

function resizeMktFrame(){
  if (document.getElementById('mkt_frame').style.zoom == "50%"){ //enlarge the display
    document.getElementById('mkt_frame_hdr').src = "./images/mkt_frame_hdr_shrink.png";
    document.getElementById('ma').style.width = "77%";
    document.getElementById('sector').style.width = "10%";
    document.getElementById('st_graph').style.width = "10%";
    document.getElementById('mkt_frame').style.zoom = "100%";
  } else { //shrink the display
    document.getElementById('mkt_frame').style.zoom = "50%";
    document.getElementById('mkt_frame_hdr').src = "./images/mkt_frame_hdr_grow.png";
    document.getElementById('ma').style.height = "400px";
    document.getElementById('ma').style.width = "33%";
    document.getElementById('sector').style.width = "32%";
    document.getElementById('st_graph').style.width = "32%";
    if (document.getElementById('chart_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('chart_frame').style.zoom = "50%";
      document.getElementById('chart_frame_hdr').src = "./images/chart_frame_hdr_grow.png";
    }
    if (document.getElementById('ss_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('ss_frame').style.zoom = "50%";
      document.getElementById('ss_frame_hdr').src = "./images/ss_frame_hdr_grow.png";
      document.getElementById('ss_frame').style.height = "50%";
      document.getElementById('sect_frame').style.height = "44%";
    }
    if (document.getElementById('sect_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('sect_frame').style.zoom = "50%";
      document.getElementById('sect_frame_hdr').src = "./images/sect_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
      document.getElementById('sect_frame').style.height = "44%";
      document.getElementById('ss_frame').style.height = "50%";
    }    
  }
}

function resizeSectFrame(){
  if (document.getElementById('sect_frame').style.zoom == "50%"){ //enlarge the display
    document.getElementById('sect_frame_hdr').src = "./images/sect_frame_hdr_shrink.png";
    document.getElementById('ma').style.width = "10%";
    document.getElementById('sector').style.width = "77%";
    document.getElementById('st_graph').style.width = "10%";
    document.getElementById('sect_frame').style.zoom = "100%";
    document.getElementById('ss_frame').style.height = "15%";
    document.getElementById('sect_frame').style.height = "79%";
    if (document.getElementById('ss_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('ss_frame').style.zoom = "50%";
      document.getElementById('ss_frame_hdr').src = "./images/ss_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
    }
  } else { //shrink the display
    document.getElementById('sect_frame').style.zoom = "50%";
    document.getElementById('sect_frame_hdr').src = "./images/sect_frame_hdr_grow.png";
    document.getElementById('ma').style.height = "400px";
    document.getElementById('sect_frame').style.height = "44%";
    document.getElementById('ss_frame').style.height = "50%";
    document.getElementById('ma').style.width = "33%";
    document.getElementById('sector').style.width = "32%";
    document.getElementById('st_graph').style.width = "32%";
    if (document.getElementById('chart_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('chart_frame').style.zoom = "50%";
      document.getElementById('chart_frame_hdr').src = "./images/chart_frame_hdr_grow.png";
    }
    if (document.getElementById('ss_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('ss_frame').style.zoom = "50%";
      document.getElementById('ss_frame_hdr').src = "./images/ss_frame_hdr_grow.png";
      document.getElementById('ss_frame').style.height = "50%";
      document.getElementById('sect_frame').style.height = "44%";
    }
    if (document.getElementById('mkt_frame').style.zoom == "100%"){ //means it is enlarged
      document.getElementById('mkt_frame').style.zoom = "50%";
      document.getElementById('mkt_frame_hdr').src = "./images/mkt_frame_hdr_grow.png";
      document.getElementById('ma').style.height = "400px";
    }
    
  }
}
function urlencode(str) {
str = escape(str);
str = str.replace('+', '%2B');
str = str.replace('%20', '+');
str = str.replace('*', '%2A');
str = str.replace('/', '%2F');
str = str.replace('@', '%40');
return str;
}

function urldecode(str) {
str = str.replace('+', ' ');
str = unescape(str);
return str;
}

function loadTicker(tick, sect)
{
  rank_url = "http://www.evaluvest.com/asp/stk_rank.php?sym="+tick;
  sect_url = "http://www.evaluvest.com/Sectors/Procs/sendSect.ASP?t="+urlencode(sect);
  ss_url = "http://www.evaluvest.com/ASP/sector_pr.asp?ind="+urlencode(sect);
  chart_url = "http://www.evaluvest.com/nd/chrtWrapper3.ASP?t="+tick;
  mkt_url = "http://www.evaluvest.com/OBOS_Charts/genOBOSSymb.ASP?o=s&s="+tick;
    
  document.getElementById('mkt_frame').src = mkt_url;
  document.getElementById('stk_rank_frame').src = rank_url;
  document.getElementById('sect_frame').src = sect_url;
  document.getElementById('chart_frame').src = chart_url;
  document.getElementById('ss_frame').src = ss_url;

}

function changeDisplay(disp_type)
{
	var requestHttp;
    var params;
    
    if (disp_type == "lookup"){
      sym = document.getElementById('stick').value;
      params = "dt=" + disp_type + "&sym=" + sym;
    } else {
	  params = "dt=" + disp_type;
    }
	
	var requestHttp;

        try
        { 
          requestHttp = new XMLHttpRequest();
        }
        catch (e)
        {
          try 
          {
            requestHttp = new ActiveXObject("Msxml2.XMLHTTP");
          }
          catch (e)
          {
            try
            {
              requestHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
              alert("Your browser does not support the AJAX scripting language!");
              return false;
            }
          }
        }
	requestHttp.open("GET","http://www.evaluvest.com/asp/primary_values.php?" + params, true);
	requestHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	requestHttp.setRequestHeader("Content-length",params.length);
	requestHttp.setRequestHeader("Connection","close");
	
	requestHttp.onreadystatechange = function()
	{
		if ((requestHttp.readyState==4)&& (requestHttp.status == 200))
		{
			rtn_value = requestHttp.responseText;
			processInfo(rtn_value, disp_type);
		}
	}
	
	requestHttp.send(null);	
}

function processInfo(val, dt)
{
  var bArr = new Array(); //bArr[0] is ticker, [1] is the sector, [2] is the market
	
  bArr = val.split(",");

  rank_url = "http://www.evaluvest.com/asp/stk_rank.php?sym="+bArr[0];
  sect_url = "http://www.evaluvest.com/Sectors/Procs/sendSect.ASP?t="+urlencode(bArr[1]);
  ss_url = "http://www.evaluvest.com/ASP/sector_pr.asp?ind="+urlencode(bArr[1]);
  chart_url = "http://www.evaluvest.com/nd/chrtWrapper3.ASP?t="+bArr[0];
  mkt_url = "http://www.evaluvest.com/OBOS_Charts/genOBOSSymb.ASP?o="+bArr[2]+"&s="+bArr[0];
  
  switch (dt) {
    case "2WkPRInc":
      stock_url = "http://www.evaluvest.com/asp/PRChange_2WK_Inc.ASP";
      break;
    case "2WkPRDec":
      stock_url = "http://www.evaluvest.com/asp/PRChange_2WK_Dec.ASP";
      break;
    case "Volume":
      stock_url = "http://www.evaluvest.com/asp/volume.asp";
      break;
    case "NewBuys":
      stock_url = "http://www.evaluvest.com/asp/NewBuys.ASP";
      break;
    case "NewSells":
      stock_url = "";
      break;
    case "PBreaks":
      stock_url = "http://www.evaluvest.com/asp/PWR_Breakout.asp";
      break;
    case "TEAM25":
      stock_url = "http://www.evaluvest.com/asp/eTEAM25.asp";
      break;
    case "lookup":
      stock_url = "http://www.evaluvest.com/asp/sym_detail.php?sym=" + bArr[0];
      break;
    case "Portfolio":
      stock_url = "http://www.evaluvest.com/site/port_info.php";
      break;
    case "Total":
      stock_url = "";
      break;
    default:  // 2 week power rank increase
      stock_url = "http://www.evaluvest.com/asp/PRChange_2WK_Inc.ASP";
  }

  document.getElementById('stk_frame').src = stock_url;
  document.getElementById('stk_rank_frame').src = rank_url;
  document.getElementById('mkt_frame').src = mkt_url;
  document.getElementById('sect_frame').src = sect_url;
  document.getElementById('chart_frame').src = chart_url;
  document.getElementById('ss_frame').src = ss_url;
}

//-->