// JavaScript Document


// need a better browser detection method
//document.write("Browser CodeName: " + navigator.appCodeName);
//document.write("<br /><br />");
//document.write("Browser Name: " + navigator.appName);
//document.write("<br /><br />");
//document.write("Browser Version: " + navigator.appVersion);
//document.write("<br /><br />");
//document.write("Cookies Enabled: " + navigator.cookieEnabled);
//document.write("<br /><br />");
//document.write("Platform: " + navigator.platform);
//document.write("<br /><br />");
//document.write("User-agent header: " + navigator.userAgent);



// functions that load up the div area when the user rolls over the menu button
interval=300;
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
g=0;
h=0;
i=0;
j=0;
k=0;
pos1on="false";




function timerpos1(){
//var a=setTimeout("alert('5 seconds!')",5000);

if (pos1on="false")
{
az=setTimeout("newStyle_pos1('#lists li.one:hover div.pos1{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

pos1on="true";
}


}

function timerpos2(){

bz=setTimeout("newStyle_pos2('#lists li.two:hover div.pos2{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}


function timerpos3(){

cz=setTimeout("newStyle_pos3('#lists li.three:hover div.pos3{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos4(){

dz=setTimeout("newStyle_pos4('#lists li.four:hover div.pos4{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos5(){

ez=setTimeout("newStyle_pos5('#lists li.five:hover div.pos5{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos6(){

fz=setTimeout("newStyle_pos6('#lists li.six:hover div.pos6{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos7(){

gz=setTimeout("newStyle_pos7('#lists li.seven:hover div.pos7{display:block;width:938px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos8(){

hz=setTimeout("newStyle_pos8('#lists li.eight:hover div.pos8{display:block;width:938px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos9(){

iz=setTimeout("newStyle_pos9('#lists li.nine:hover div.pos9{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos10(){

jz=setTimeout("newStyle_pos10('#lists li.ten:hover div.pos10{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}
function timerpos11(){

kz=setTimeout("newStyle_pos11('#lists li.eleven:hover div.pos11{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}')",interval);

}


// functions for when user rolls over the actual div area

function pos1(){
//var a=setTimeout("alert('5 seconds!')",5000);

newStyle_pos1('#lists li.one:hover div.pos1{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

pos1on="true";

}
function pos2(){

newStyle_pos2('#lists li.two:hover div.pos2{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos3(){

newStyle_pos3('#lists li.three:hover div.pos3{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}

function pos4(){

newStyle_pos4('#lists li.four:hover div.pos4{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos5(){

newStyle_pos5('#lists li.five:hover div.pos5{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos6(){

newStyle_pos6('#lists li.six:hover div.pos6{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos7(){

newStyle_pos7('#lists li.seven:hover div.pos7{display:block;width:938px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos8(){

newStyle_pos8('#lists li.eight:hover div.pos8{display:block;width:938px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos9(){

newStyle_pos9('#lists li.nine:hover div.pos9{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos10(){

newStyle_pos10('#lists li.ten:hover div.pos10{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}
function pos11(){

newStyle_pos11('#lists li.eleven:hover div.pos11{display:block;width:763px;background:#FFF;position:absolute;padding-left:10px;padding-top:2px;top:38px;border-bottom:1px solid #234b64;border-left:1px solid #234b64;border-right:1px solid #234b64;padding-bottom:10px;}');

}









// functions that creates the div sytle.


function newStyle_pos1(str){

	
pa= document.getElementsByTagName('head')[0] ;
ela= document.createElement('style');


ela.type= 'text/css';
ela.media= 'screen';

if(ela.styleSheet) ela.styleSheet.cssText= str;// IE method
else ela.appendChild(document.createTextNode(str));// others
pa.appendChild(ela);
 
a= ela;


//return el;

}




function newStyle_pos2(str){

pb= document.getElementsByTagName('head')[0] ;
elb= document.createElement('style');


elb.type= 'text/css';
elb.media= 'screen';

if(elb.styleSheet) elb.styleSheet.cssText= str;// IE method
else elb.appendChild(document.createTextNode(str));// others
pb.appendChild(elb);
 
b= elb;

//return el;

}


function newStyle_pos3(str){

pc= document.getElementsByTagName('head')[0] ;
elc= document.createElement('style');


elc.type= 'text/css';
elc.media= 'screen';

if(elc.styleSheet) elc.styleSheet.cssText= str;// IE method
else elc.appendChild(document.createTextNode(str));// others
pc.appendChild(elc);
 
c= elc;

//return el;

}



function newStyle_pos4(str){

pd= document.getElementsByTagName('head')[0] ;
eld= document.createElement('style');


eld.type= 'text/css';
eld.media= 'screen';

if(eld.styleSheet) eld.styleSheet.cssText= str;// IE method
else eld.appendChild(document.createTextNode(str));// others
pd.appendChild(eld);
 
d= eld;

//return el;

}


function newStyle_pos5(str){

pe= document.getElementsByTagName('head')[0] ;
ele= document.createElement('style');


ele.type= 'text/css';
ele.media= 'screen';

if(ele.styleSheet) ele.styleSheet.cssText= str;// IE method
else ele.appendChild(document.createTextNode(str));// others
pe.appendChild(ele);
 
e= ele;

//return el;

}

function newStyle_pos6(str){

pf= document.getElementsByTagName('head')[0] ;
elf= document.createElement('style');


elf.type= 'text/css';
elf.media= 'screen';

if(elf.styleSheet) elf.styleSheet.cssText= str;// IE method
else elf.appendChild(document.createTextNode(str));// others
pf.appendChild(elf);
 
f= elf;

//return el;

}

function newStyle_pos7(str){

pg= document.getElementsByTagName('head')[0] ;
elg= document.createElement('style');


elg.type= 'text/css';
elg.media= 'screen';

if(elg.styleSheet) elg.styleSheet.cssText= str;// IE method
else elg.appendChild(document.createTextNode(str));// others
pg.appendChild(elg);
 
g= elg;

//return el;

}

function newStyle_pos8(str){

ph= document.getElementsByTagName('head')[0] ;
elh= document.createElement('style');


elh.type= 'text/css';
elh.media= 'screen';

if(elh.styleSheet) elh.styleSheet.cssText= str;// IE method
else elh.appendChild(document.createTextNode(str));// others
ph.appendChild(elh);
 
h= elh;

//return el;

}


function newStyle_pos9(str){

pi= document.getElementsByTagName('head')[0] ;
eli= document.createElement('style');


eli.type= 'text/css';
eli.media= 'screen';

if(eli.styleSheet) eli.styleSheet.cssText= str;// IE method
else eli.appendChild(document.createTextNode(str));// others
pi.appendChild(eli);
 
i= eli;

//return el;

}


function newStyle_pos10(str){

pj= document.getElementsByTagName('head')[0] ;
elj= document.createElement('style');


elj.type= 'text/css';
elj.media= 'screen';

if(elj.styleSheet) elj.styleSheet.cssText= str;// IE method
else elj.appendChild(document.createTextNode(str));// others
pj.appendChild(elj);
 
j= elj;

//return el;

}


function newStyle_pos11(str){

pk= document.getElementsByTagName('head')[0] ;
elk= document.createElement('style');


elk.type= 'text/css';
elk.media= 'screen';

if(elk.styleSheet) elk.styleSheet.cssText= str;// IE method
else elk.appendChild(document.createTextNode(str));// others
pk.appendChild(elk);
 
k= elk;

//return el;

}


// deletes the div style  so it disappears when the user rolls mouse away from menu area

function deletenode_a()
{
	
if (a!=0)
{
//if (tempY>95)	
//{
pa.removeChild(ela);

a=0;
pos1on="false";
//}
}

}

function deletenode_b()
{
	
if (b!=0)
{
pb.removeChild(elb);

b=0;

}

}


function deletenode_c()
{
	
if (c!=0)
{
pc.removeChild(elc);

c=0;

}

}

function deletenode_d()
{
	
if (d!=0)
{
pd.removeChild(eld);

d=0;

}

}


function deletenode_e()
{
	
if (e!=0)
{
pe.removeChild(ele);

e=0;

}

}


function deletenode_f()
{
	
if (f!=0)
{
pf.removeChild(elf);

f=0;

}

}


function deletenode_g()
{
	
if (g!=0)
{
pg.removeChild(elg);

g=0;

}

}


function deletenode_h()
{
	
if (h!=0)
{
ph.removeChild(elh);

h=0;

}

}

function deletenode_i()
{
	
if (i!=0)
{
pi.removeChild(eli);

i=0;

}

}


function deletenode_j()
{
	
if (j!=0)
{
pj.removeChild(elj);

j=0;

}

}


function deletenode_k()
{
	
if (k!=0)
{
pk.removeChild(elk);

k=0;

}

}



// other functions to look at
function removeElement(divNum) {
  var d = document.getElementById('myDiv');
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}

function addElement() {
  var ni = document.getElementById('myDiv');
  var numi = document.getElementById('theValue');
  var num = (document.getElementById('theValue').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
  newdiv.innerHTML = 'Element Number '+num+' has been added! <a href=\'#\' onclick=\'removeElement('+divIdName+')\'>Remove the div "'+divIdName+'"</a>';
  ni.appendChild(newdiv);
}





function externalLinks() {   
 if (!document.getElementsByTagName) return;   
 var anchors = document.getElementsByTagName("a");   
 for (var i=0; i<anchors.length; i++) {   
   var anchor = anchors[i];   
   if (anchor.getAttribute("href") &&   
       anchor.getAttribute("rel") == "external")   
     anchor.target = "_blank";   
 }   
}   
window.onload = externalLinks;



function buttons() {
    var inputs = document.getElementsByTagName("input");
    var i = 0;
    for (i = 0; i < inputs.length; i++) {
        if (inputs[i].getAttribute('type') == 'image') {
            var image = inputs[i];
            image.offImage = new Image();
            image.offImage.src = image.src;
            image.onImage = new Image();
            image.onImage.imageElement = image;
            if (navigator.userAgent.toLowerCase().indexOf('safari') != -1) {
                image.onmouseover = function() { this.src = this.onImage.src; };
                image.onfocus = function() { this.src = this.onImage.src; };
                image.onmouseout = function() { this.src = this.offImage.src; };
                image.onblur = function() { this.src = this.offImage.src; };
            } else {
                image.onImage.onload = function() {
                    this.imageElement.onmouseover = function() { this.src = this.onImage.src; };
                    this.imageElement.onfocus = function() { this.src = this.onImage.src; };
                    this.imageElement.onmouseout = function() { this.src = this.offImage.src; };
                    this.imageElement.onblur = function() { this.src = this.offImage.src; };
                };
            }
            image.onImage.src = image.src.replace(/-off\./, '-on.');
        }
    }
}

