d=document;
l=d.layers;
op=navigator.userAgent.indexOf('Opera')!=-1;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){l?e.visibility='show':e.style.visibility='visible';}
function hE(e){l?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h;}
function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}else if(e.innerHTML)e.innerHTML=h;}

function gX(e){return x=l?e.left:op?e.style.pixelLeft:e.style.left;}
function gY(e){return y=l?e.top:op?e.style.pixelTop:e.style.top;}
function gW(e){return w=l?e.clip.width:op?e.style.pixelWidth:e.style.width;}
function gH(e){return h=l?e.clip.height:op?e.style.pixelHeight:e.style.height;}


ie = document.all;
ns4 = document.layers;
ns6 = document.getElementById && !ie;


timer=null;
isConfLoaded = false;
bgColorOut  = '#c9d1f6';
txtColorOut = '#000000';
bgColorOver = '#392f78';
txtColorOver= '#ffffff';
border = 1;
siteRoot="http://www.softsolveit.com/";

function getCss( layer ){
	obj = gE(layer); 
	if(ns4) return obj;
	else return obj.style;
}

function showLayer( layer, nest ){  
	obj = gE(layer);
	if(!isConfLoaded || !obj ) return;
	
	for(var i=1; i<=totalMenus; i++){
		var l = eval("menu"+i+".name"); 
		hE( gE(l) );		
	}
	
	clearTimeout(obj.timer);
	sE( obj );
}


function hideLayer( layer ){
	obj = gE(layer);
	if(!isConfLoaded || !obj ) return;
	
	clearTimeout(obj.timer);
	obj.timer=setTimeout( "hE( gE(\""+layer+"\"))", 400 );
}

function over( menuLayer, subItemLayer ){
	showLayer(menuLayer);
	
	if(ns4){
		//lr = eval("document."+menuLayer+".document."+menuLayer+subItemLayer+".document."+subItemLayer);
		//lr.bgColor = bgColorOver;
		//lr.color = txtColorOver;
	}else{
		css = getCss( subItemLayer );
		if(ns6){ css.cursor     = "pointer"; }
		css.cursor     = "hand";
		css.background = bgColorOver;
		css.color      = txtColorOver;		
	}
}

function out( menuLayer, subItemLayer ){
	hideLayer(menuLayer);
	
	css = getCss( subItemLayer ); 
	css.background = bgColorOut;
	css.color      = txtColorOut;	
}

function loadURL(url, target){ 
	w = (target && target != 'undefined')? target : window; 
	w.location.href = siteRoot+url;
}

//***************
function kItem(	n, pN, l, url, tr, w, h, mov, mot, ocl){	
	this.name = n;
	this.parentName = pN;
	this.label = l;
	this.url =url;
	this.target =tr;
	this.width =(w)?w:100; 
	this.height =(h)?h:20;
	this.onMouseOver =mov;
	this.onMoueOut =mot;
	this.onClick =ocl;
}

function kMenu(n, pN, x, y){
	this.name=n;
	this.parentName=pN;
	this.ic = new Array();//item Collection
	//this.timer;
	this.delay = 1000;
	this.x=x; this.y=y;
	this.offsetX; this.offsetY;
	
	this.addItem=addItem;
	this.construct=construct;
}

function addItem(n, pN, l, url, tr, w, h, mov, mot, ocl){
	obj = new kItem(n, pN, l, url, tr, w, h, mov, mot, ocl);
	this.ic[ this.ic.length ] = obj;
}

function construct(){
  m = this;  
  str = "";
  if(!ns4){     
        //create menu layer
      	w = m.ic[0].width;
			
      	str += "<div id='"+m.name+"' class='mnMin'>"
      	str += "<table  width='"+w+"' border=0 cellspacing=1 cellpadding=2 >";
      	for(var j=0; j<m.ic.length; j++){
      		im = m.ic[j]; h = m.ic[0].height;
      		str += "<tr><td style='padding: ' id='"+im.name+"' height='"+h+"' class='mnOut'  onMouseOver=\"over('"+im.parentName+"', '"+im.name+"');\" onMouseOut=\"out('"+im.parentName+"', '"+im.name+"');\" onClick=\"loadURL('"+im.url+"', '"+im.target+"')\">"+im.label+"</td></tr>";
      	}
      	str += "</table></div>";
      	
      	
  }else{ // code for ns4
      	str += "<layer name='"+m.name+"' visibility='hide' bgColor='#000000'> \n"
      	str += "<table  width='150' border=0 cellspacing=1 cellpadding=2> \n";
      	for(var j=0; j<m.ic.length; j++){
      		im = m.ic[j]; h = m.ic[0].height;
      		str += "<tr><td  class='mnOut'><ilayer name='"+m.name+im.name+"'><layer name='"+im.name+"' height='"+h+"' class='mnOut'  onMouseOver=\"over('"+im.parentName+"', '"+im.name+"');\" onMouseOut=\"out('"+im.parentName+"', '"+im.name+"');\"><a href='#' onClick=\"loadURL('"+im.url+"', '"+im.target+"')\">"+im.label+"</a></layer></ilayer></td></tr> \n";
      		//str += "<tr><td class='mnOut'><a href='#' onClick=\"loadURL('"+im.url+"', '"+im.target+"')\">"+im.label+"</a></td></tr>"
      	}
      	str += "</table></layer>";  
  }
  
  document.write(str); 
      
  //set menu position
  obj = gE(m.name); 
  if(m.x != "undefined"){ sX(obj, m.x); sY(obj, m.y); }; 
  if(m.offsetX){ 
  	p=gE(m.parentName); 
   	px = parseInt(gX(p)); py = parseInt(gY(p)); 
   	pw = parseInt(gW(p)); ph = parseInt(gH(p)); 
   	sX(obj, px+pw);       sY(obj, py+ph);
  }   

}

//other funcs
function go(url, w, h, props){
	p = "width="+w+", height="+h;
	if(props){ p = p + ", " + props; } 
	w=window.open(url, '', p);
	if(w.focus) w.focus();
	void(0);
}




	