
var IE4 = (document.all) ? true : false;
var NS4 = (document.layers) ? true : false;
function findPosY(obj)

{
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
}
function findPosX(obj)
{
	// author:devraj
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
}

function docjslib_getVisibility(id) {
  if (NS4) {
  return eval("document." + id).visibility;
   // if (eval("document." + id).visibility == "show") return true
    //else return false;
  }
  else {
  // if (eval("document.all." + id).style.visibility == "visible") return true
  //  else return false;
  return eval("document.all." + id).style.visibility;
  }
}

function hidealldiv(totalCount)
{
	//document.getElementById("mainDiv").style.visibility = 'hidden';
	
	for(i=1;i<=totalCount;i++)
	{
		var div = "div"+i;
		if (NS4) {
    		eval("document." + div).visibility = 'hide';
  		}
		else
		{
			eval("document.all." + div).style.visibility = 'hidden';	
		}
	}
}

function docjslib_setVisibility(id) 
{
var flag=docjslib_getVisibility(id);
  if (NS4) {
    var str = (flag) ? 'show' : 'hide';
    eval("document." + id).visibility = str;
  }
  else {
    var str = (flag) ? 'visible' : 'hidden';
    eval("document.all." + id).style.visibility = str;
  }
}
//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which,totalCount){
clear_delayhide()
//document.getElementById("div"+which).style.backgroundColor="#000000";
//thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
{
getcontent(which,totalCount);
//menuobj.innerHTML=thecontent
}
else if (document.layers){
getcontent(which,totalCount);
//menuobj.document.write(thecontent)
//menuobj.document.close()
}
}


function getcontent(which,totalCount)
{
	//alert(which);
	var image=document.getElementById("imageId"+which);
	//alert(image);
	var imgx=findPosX(image);
	var imgY=findPosY(image);
	imgY=imgY-64;
	imgx=imgx-8;
	if(which==totalCount)
	{imgx=imgx-182;
		}
	//alert(imgx);
	var div=document.getElementById("div"+which);
	 div.style.position="absolute";
	 //alert(div.width);
	
	// set the left position here
	// which is the index of the image buttons
	//alert(which);
	//div.style.top=0;

	if(which<10)
	{	
		if(which==0)
		{
			div.style.left=imgx+10;
		}
		else if(which==6)
		{
			div.style.left=imgx+10;
		}
		
		else if(which==4)
		{
			div.style.left=imgx+10;
		}
		
		else if(which==7)
		{
			div.style.left=imgx+10;
		}
		else if(which==8)
		{
			div.style.left=imgx-30;
		}
		else 
		{
			div.style.left=imgx+8;
		}
	}
	else
	{
		div.style.left=imgx-250;
		//alert(imgx);
	}
	
	div.style.top=imgY+28;
	//alert(div.style.left);
	hidealldiv(totalCount);
	docjslib_setVisibility("div"+which);
}


function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}


function fThis(id,totalCount)
{
		for(i=1;i<=totalCount;i++)
	{
			document.getElementById("Span"+i).style.backgroundColor="#ffffff";	
			document.getElementById("Span"+i).style.padding="0px 0px 0px 0px;"
			document.getElementById(id).style.border="0PX solid #C9C9C9";
	}
	document.getElementById(id).style.backgroundColor="#F2F2F2";
	document.getElementById(id).style.padding="6px 0px 2px 0px;";
	//document.getElementById(id).style.border="0PX solid #C9C9C9";
}
