// menu set up
var linkheight = 25;  //Now also must be set in css in linkcellu and linkcellz
var linkwidth = 112;  //Now also must be set in css in linkcellu and linkcellz
var sublinkwidth =200;
var mainHoffset = 25;
var subHoffset = 114;
var subVoffset = -50;
var offcolor0 = "#001f3b";
var oncolor0 = "#e7ac6a";
var textOffcolor0 = "#e7ac6a";
var textOncolor0 = "#001f3b";
var offcolor00 = "#001f3b";
var oncolor00 = "#e7ac6a";
var textOncolor00 = "#001f3b";
var textOffcolor00 = "#e7ac6a";
var offcolor000 = "#EEEEEE";
var oncolor000 = "#13273f";
var textOffcolor000 = "#13273f";
var textOncolor000 = "#EEEEEE";
var offsetY0 = 50;
var sep0 = 25;
var sep00 =0;
var bigNum = 500;
var menuY = 345;
var menuMin = linkwidth+2*mainHoffset;
  
function setTouch(objName,val,level) {
       var obj = document.getElementById( objName );
       if (obj != null) {
           var s = obj.style;
           if(level == '0') {s['borderColor'] = (val == 'on') ? oncolor0 : offcolor0;
		   					 //s['color'] = (val == 'on') ? textOncolor0 : textOffcolor0;		   
		   }
		   if(level == '00') {s['borderColor'] = (val == 'on') ? oncolor00 : offcolor00;
		   					  //s['color'] = 	(val == 'on') ? textOncolor00 : textOffcolor00;
		   }
		   if(level == '000') {s['backgroundColor'] = (val == 'on') ? oncolor000 : offcolor000;
		   					   s['color'] = 	(val == 'on') ? textOncolor000 : textOffcolor000;		   
		   }
              return;
			  }
}
						
function setTop(objName,val) {
       var obj = document.getElementById( objName );
       if (obj != null) {
           var s = obj.style;
           s['top'] = val;
              return;
			  }
}

function L0 (n,url,name) {
	document.write('<div id="'+n+'L0" class="linkcellz" style="left:0px; top:'+(n*sep0)+'px;">'+'&nbsp;'+name+'</div>');
	document.write('<div class="linkcellu" style="left:0px; top:'+(n*sep0)+'px;"><a href="'+url+'"><img src="components/single.gif" height="'+linkheight+'" width="'+linkwidth+'" hspace="0" vspace="0" border="0" onMouseOut="setTouch(\''+n+'L0\',\'off\',\'0\'); divVisibility(\''+n+'L00\',false);" onMouseOver="setTouch(\''+n+'L0\',\'on\',\'0\');divVisibility(\''+n+'L00\',true);"></a></div>');
}

function preL00 (n) {

	document.write('<div id="'+n+'L00" class="linkmenub" style="left:'+subHoffset+'px; top:'+(n*sep0+subVoffset)+'px; border-top-color:#e7ac6a; border-top-style:solid; border-top-width:1px;" onMouseOut="setTouch(\''+n+'L0\',\'off\',\'0\');divVisibility(\''+n+'L00\',false);" onMouseOver="setTouch(\''+n+'L0\',\'on\',\'0\');divVisibility(\''+n+'L00\',true);">');
}

function postL00 (n) {
	document.write('</div>');
}

function L00 (n,m,url,name) {
	document.write('<div id="'+n+'L00'+m+'" class="linkmenuz" style="left:-2px; top:'+(m*linkheight)+'px;">'+name+'</div>');
	document.write('<div class="linkmenuu" style="left:-2px; top:'+(m*linkheight)+'px;"><a href="'+url+'"><img src="components/single.gif" height="2'+linkheight+'" width="'+(sublinkwidth - 1)+'" hspace="0" vspace="0" border="0" onMouseOut="setTouch(\''+n+'L00'+m+'\',\'off\',\'00\');" onMouseOver="setTouch(\''+n+'L00'+m+'\',\'on\',\'00\');"></a></div>');
}


function menu () {
var n = 0;
var m = 0;

document.write('<div id="linkcontainer" style="position:absolute; left:'+mainHoffset+'px; top:'+menuY+'px;">'); 

document.write('<div class="linkcelltz" style=" left:1px; top:-8px; width:112px;"><img src="components/SD.png" height="25" width="110" hspace="0" vspace="0" border="0" onMouseOut="divVisibility(\'0L0\',false);" onMouseOver="divVisibility(\'0L0\',true);"></div>');
document.write('<div id="0L0" class="linkcelltu" style=" left:1px; top:-8px; width:112px; visibility:hidden;"><a href="sitemap.php"><img src="components/SDon.png" height="25" width="110" hspace="0" vspace="0" border="0" onMouseOut="divVisibility(\'0L0\',false);" onMouseOver="divVisibility(\'0L0\',true);"></a></div>');

L0(1,'#','Sidereal Profile');
preL00 (1);
L00 (1,0,'who.php','Who We Are');
L00 (1,1,'contact.php','Contacting Us');
L00 (1,2,'web_design_faq.php','FAQ');
L00 (1,3,'javascript:name_it(\'pron.html\',600,120)','The Word \'Sidereal\'');
postL00 (1);

L0(2,'#','Doing Business');
preL00 (2);
L00(2,0,'execsum.php','Executive Summary');
L00(2,1,'consult.php','Free Estimate');
L00(2,2,'rates.php','Estimates and Costs');
L00(2,3,'contact.php','Contacting Us');
L00(2,4,'termpay.php','Terms and Payments');
L00(2,5,'process.php','Our Proccess');
L00(2,6,'client_page.php','Your Project Manager');
/* L00(2,7,'estimate.php','On-line Estimate Form'); */
postL00 (2);

L0(3,'#','What We Can Do');
preL00 (3);
L00(3,0,'capabilities.php','Coding Capabilities');
L00(3,1,'joomla.php','Joomla Expertise');
L00(3,2,'sharepoint.php','Sharepoint Expertise');
L00(3,3,'what.php','What We Do');
L00(3,4,'need.php','What You Need To Start');
L00(3,5,'designland.php','Your Design');
L00(3,6,'fitland.php','Your Unique Idea');
L00(3,7,'service.php','Services Offered');
L00(3,8,'maint.php','Maintenance and Marketing');
L00(3,9,'dynamic.php','Content Management');
L00(3,10,'streaming.php','Streaming Media');
postL00 (3);	

L0(4,'#','Our Work');
preL00 (4);
L00(4,0,'testim.php','Client\'s Evaluations');
L00(4,1,'capabilities.php','Custom Solutions');
L00(4,2,'examplecode.php','Examples of Custom Solutions');
L00(4,3,'examples.php','Examples of Design');
L00(4,4,'joomla.php','Joomla Solutions');
L00(4,5,'sharepoint.php','Sharepoint Solutions');
/*L00(4,5,'yetmoreclients.php','Yet More Example Sites');
L00(4,6,'moreclients.php','Still More Example Sites'); */
postL00 (4);

L0(5,'#','Communication');
preL00 (5);
L00(5,0,'client_page.php','Your Project Manager');
L00(5,1,'newsletter.php','Channels');
L00(5,2,'archive.php','Newsletter Archive');
L00(5,3,'podcast.php','Podcasts');
L00(5,4,'privacy.php','Privacy Policy');
postL00 (5);

L0(6,'#','Resources');
preL00 (6);
L00(6,0,'stuff.php','Links to Resources');
L00(6,1,'whois.php','Domain Name Check');
L00(6,2,'archive.php','Our Archives');
L00(6,3,'message.php','Message');
L00(6,4,'website_glossary.php','Website Glossary');
postL00 (6);

L0(7,'http://siderealdesigns.com/consult.php','Free Estimate');
L0(8,'client_page.php','Client\'s Page');
L0(9,'index.php','Home');

document.write('</div>'); //linkContainer

// Figure out if sliding menu needs to start high to fit in short window.
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//  window.alert( 'Width = ' + myWidth );
//  window.alert( 'Height = ' + myHeight );

var minheight;
// minheight = document.body.offsetHeight;
minheight = myHeight;
//alert (minheight);
//alert (menuY);
 if (minheight < 460) menuY = menuY - (460 - minheight);

								   target=newtarget=menuY;
								   setTop("linkcontainer", target+"px");
							   checkScrolled();
} // end menu set up

// scroll position checker
var newtarget = menuY;
var target = menuY;
var minY = 100;
function checkScrolled(){
		if( document.documentElement && document.documentElement.scrollTop) { pageY=document.documentElement.scrollTop; }
        else { pageY=document.body.scrollTop; }
		if ( pageY < (menuY - minY)) { newtarget = menuY;}
		if ( pageY > (menuY - minY)) { newtarget = minY + pageY; }
		target = target + (newtarget/10 - target/10);
		setTop("linkcontainer", target+"px");
		//alert (pageY+' '+menuY+' '+minY+' '+target);  setTimeout('checkScrolled()',4000);
        setTimeout('checkScrolled()',10);
}
// end scroll position checker


// pop-up code
function name_it(urlname,w,h) {
	window.open(urlname,'pingwinname',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+w+",height="+h);
}
//end pop-up code


//Required form feild checker
function Require(obForm)
    {
    var fields = document.getElementsByTagName("input");
    for (var n=0; n<fields.length; n++)
	   {
	   //alert (fields[n].className);
          if ((fields[n].className=='required')&&(!fields[n].value)) {
       	   alert("A value for \""+fields[n].getAttribute("name")+"\" is required.");
           return false
	     }
      }
      return true; 
    }
//End Required form feild checker