function IsB() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns    = ((agent.indexOf('mozilla')   !=   -1) && 
                 ((agent.indexOf('spoofer')   ==   -1) && 
                  (agent.indexOf('compatible') ==  -1)));
    this.ns4   = (this.ns && (this.major      ==    4));
    this.ns6   = (this.ns && (this.major      >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      < 4	));
    this.ie4   = (this.ie && (this.major      ==    4) && 
                 (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) && 
                 (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55  = (this.ie && (this.major      ==    4) && 
                 (agent.indexOf("msie 5.5")   !=   -1));
    this.ie6   = (this.ie && (agent.indexOf("msie 6.0")!=-1) );
}
var is = new IsB();

var layerRef;
var styleSwitch;

function whatis(){

	if (is.ie5|| is.ie55|| is.ie6|| is.ns6){
		return 'new';
	} else if(is.ie4){
	
		return 'ieold';
	} else if(is.ns4) {

		return 'nsold';
	}
}

function init(){
	if (whatis() == 'new') {
		layerRef="document.getElementById";
		styleSwitch=".style";
	}else if(whatis() == 'ieold'){
		layerRef="document.all";
	    styleSwitch=".style";
	}else{
		layerRef="document.layers";
	    styleSwitch="";
	}

	
 
	homemenupoint = new Image(120,19); 
	homemenupoint.src = "graphics/homemenu2.gif" ;
	homemenunopoint = new Image(120,19);
	homemenunopoint.src = "graphics/homemenu.gif";

	newsmenupoint = new Image(120,19); 
	newsmenupoint.src = "graphics/newsmenu2.gif" ;
	newsmenunopoint = new Image(120,19);
	newsmenunopoint.src = "graphics/newsmenu.gif";

	servicesmenupoint = new Image(120,19); 
	servicesmenupoint.src = "graphics/servicesmenu2.gif" ;
	servicesmenunopoint = new Image(120,19);
	servicesmenunopoint.src = "graphics/servicesmenu.gif";

	productsmenupoint = new Image(120,19); 
	productsmenupoint.src = "graphics/productsmenu2.gif" ;
	productsmenunopoint = new Image(120,19);
	productsmenunopoint.src = "graphics/productsmenu.gif";

	aboutmenupoint = new Image(120,19); 
	aboutmenupoint.src = "graphics/aboutmenu2.gif" ;
	aboutmenunopoint = new Image(120,19);
	aboutmenunopoint.src = "graphics/aboutmenu.gif";
}

function notNN(){
	if (is.ie5|| is.ie55|| is.ie6|| is.ie4){
		return true;
	}else{
		return false;
	}
}

function openmenu(name,id){
	if (whatis()=='ieold' || whatis()=='nsold'){
	  eval(layerRef+'["'+name+'open"]'+styleSwitch+'.visibility="visible"');
	}else{
	  eval(layerRef+'("'+name+'open")'+styleSwitch+'.visibility="visible"');		
	}
	  if(id)select(id);
}

function closemenu(menuname){

  if(notNN() && !(window.event.toElement && window.event.toElement.className != "menu"))return
  if(notNN() && !(window.event.toElement && window.event.toElement.className != "submenu"))return
  
  if (whatis()=='ieold' || whatis()=='nsold'){
	  if (eval(layerRef + '["homemopen"]') != null) 
		  eval(layerRef+'["homemopen"]'+styleSwitch+'.visibility="hidden"');   
	  if (eval(layerRef + '["homeopen"]') != null) 
		  eval(layerRef+'["homeopen"]'+styleSwitch+'.visibility="hidden"');   
	}else{
	  if (eval(layerRef + '("homemopen")') != null) 
		  eval(layerRef+'("homemopen")'+styleSwitch+'.visibility="hidden"');   
	  if (eval(layerRef + '("homeopen")') != null) 
		  eval(layerRef+'("homeopen")'+styleSwitch+'.visibility="hidden"');   
	}

}

function point(tbname) {
	
	eval('document.' + tbname + '.src=' + tbname + 'point' + '.src');
}

function nopoint(tbname) {
	eval(tbname + '.src=' + tbname + 'nopoint' + '.src');
}

function select(tbname){
	if (whatis() == 'ieold')	{
	  eval(tbname + styleSwitch + '.backgroundColor="#7BA632"'); 	
 	}else if(whatis() == 'new'){
	  eval(layerRef + '("' + tbname + '")' + styleSwitch + '.backgroundColor="#7BA632"'); 			
	}else if(whatis('nsold')){
	  eval('document.ids["' + tbname + '"].backgroundColor="#7BA632"'); 	
	}
}
function unselect(tbname){
	if (whatis() == 'ieold')	{
	  eval(tbname + styleSwitch + '.backgroundColor="#E3E3D5"'); 	
 	}else if(whatis() == 'new'){
	   eval(layerRef + '("' + tbname + '")' + styleSwitch + '.backgroundColor="#E3E3D5"'); 			
	}else if(whatis('nsold')){
	  eval('document.ids["' + tbname + '"].backgroundColor="#E3E3D5"'); 	
	}
  
}

function popThanks(email){
	
	eval('window.open("sendNewsletter.php?email=' + email + '" ,"newsletter","toolbar=yes,width=300,height=270,resizable=yes")');
}
