/*
******************************************************** 
 Restricted use is hereby granted (commercial and 
 personal OK) as long as you keep this copyright notice: 
 Created by uMenu 1.03 
 Found in: http://www.emu8086.com/download/ 
 Copyright 2002-2003, Mysoft, Inc. All rights reserved. 
*********************************************************
*/
/*
================================================================
   This script is registered to: www.emu8086.com
================================================================
*/
REGISTERED = true;
uMenuIDE_Ver = "1.00";

var cDefCap="#FFFF00", fDefCap="Arial", fDefCapS=10, cDefMenu="#400040", fDefMenu="Courier", fDefMenuS=10, PRJ_sTemplate="Temp.html";
document.write('\
<style type="text/css">\
.clCap {cursor:hand; text-decoration:none; color:'+cDefCap+'; font-family:"'+fDefCap+'"; font-size:'+fDefCapS+'pt;}\
.clMenu {text-decoration:none; color:'+cDefMenu+'; font-family:"'+fDefMenu+'"; font-size:'+fDefMenuS+'pt;}\
');
var numOfMenus=6,scrIN=20,scrOUT=10,IDE=0,iSelectedMenu=5,errs="",rn=140,old_pageYOffset=0,widthChk,heightChk;
var PR = new Array (numOfMenus);
var MTC = new Array ("<CENTER><FONT color=\"#FFFFFF\"><EM>Central Excise</EM></FONT></CENTER>\
\
\
\
\
\
","<FONT color=\"#FFFFFF\" ><CENTER ><EM>Service Tax</EM></FONT></CENTER>","<FONT  color=\"#FFFFFF\" ><CENTER><EM>Customs</EM></FONT></CENTER><BR>\
","<FONT  color=\"#FFFFFF\" ><CENTER><EM>E-Filing of ER1 Return</EM></FONT></CENTER>","<FONT  color=\"#FFFFFF\" ><CENTER><EM>E-Filing of ST3 Return</EM></FONT></CENTER>\
","<FONT  color=\"#FFFFFF\" ><CENTER><EM>Right to Information Act 2005</EM></FONT></CENTER>\
\
");
var MTCH = new Array (19,19,19,19,19,19);
var MTM = new Array ("<FONT  FACE=\"Arial\"  color=\"#FFFFFF\"><A HREF=\"http://www.cbec.gov.in/excise/cx-manual/manual/index1.htm\">Manual</A><BR></FONT>\
<FONT  FACE=\"Arial\"  color=\"#FFFFFF\"><A HREF=\"http://www.cbec.gov.in/excise/cx-act/cx-acts.htm\">Act</A></FONT><BR>\
<FONT  FACE=\"Arial\"  color=\"#FFFFFF\"><A HREF=\"http://www.cbec.gov.in/excise/cx-rules-main.htm\">Rules</A></FONT><BR>\
<FONT  FACE=\"Arial\" color=\"#FFFFFF\" ><A HREF=\"http://www.cbec.gov.in/excise/cx-act/cx-notfns-idx.htm\">Notifications</A></FONT><BR>\
<FONT  FACE=\"Arial\"  color=\"#FFFFFF\"><A HREF=\"http://www.cbec.gov.in/excise/cx-circ-mainbott.html\">Circulars</A></FONT><BR>\
<FONT  FACE=\"Arial\"  color=\"#FFFFFF\"><A HREF=\"http://www.cbec.gov.in/excise/cx-tariff0708/cxt0708-idx.htm\">Tarrif</A></FONT><BR>\
<FONT  FACE=\"Arial\"  color=\"#FFFFFF\"><A HREF=\"http://www.cbec.gov.in/excise/formidx.htm\">Forms</A></FONT>\
\
","<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://www.servicetax.gov.in\">Main Page</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://www.servicetax.gov.in/st-actmainpg.htm\">Act</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://www.servicetax.gov.in/st-rulemainpg.htm\">Rules</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://www.servicetax.gov.in/servtax_notfns_idx.htm\">Notifications</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://www.servicetax.gov.in/st-cirmainpg.htm\">Circulars</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://www.servicetax.gov.in/st-formmainpg.htm\">Forms</A>","<FONTFACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"customs.htm\">Information</A><BR>\
<FONT FACE=\"Arial\" COLOR=\"#FFFFFF\"><A HREF=\"http://cochincustoms.nic.in/\">Kochi Customs</A></FONT>\
","<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://exciseandservicetax.nic.in/sermon/app1.html\">Requistion Form</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://cer.nic.in/cer/ecer/efiling_assessee.pdf\">Manual</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://cer.nic.in/cer/ecer/faq_ecer.html\">FAQ</A><BR>\
<FONR FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://cer.nic.in/cer/index.html\">Filing of Excise Return</A>","<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://exciseandservicetax.nic.in/sermon/how2register.htm#ANNEXURE_A\">Requisition Form</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://sermon.nic.in/sermon/sr1.html\">Filing of ST3 Return</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://sermon.nic.in/sermon/stmanual.pdf\">Manual</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://sermon.nic.in/sermon/st3assesse.pdf\">FAQ</A><BR>\
\
","<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"http://righttoinformation.gov.in/rtiact.htm\">Right to Information Act</A><BR>\
<FONT FACE=\"Arial\" color=\"#FFFFFF\"><A HREF=\"CPIOs.htm\">CPIOs & Jurisdiction</A><BR>\
");
var MX = new Array (0,105,194,285,448,609);
var MY = new Array (95,95,95,95,95,95);
var MW = new Array (104,88,90,162,160,170);
var CO = new Array ("#FFFFFF","transparent","transparent","transparent","transparent","transparent");
var CC = new Array ("#800000","#800000","#800000","#800000","#800000","#800000");
var CM = new Array ("#808080","#808080","#808080","#808080","#808080","#808080");
var MA = new Array (0,0,0,0,0,0);
var FL = new Array (0,0,0,0,0,0);
var OO = new Array (0,0,0,0,0,0);

ie=document.all?1:0;
ns=document.layers?1:0;

if (ie)
{
	for (i=0; i<numOfMenus; i++)
	{
		if (OO[i]==0)
		document.write('\
		#owner'+i+' {background-color:'+CO[i]+'; TOP:'+MY[i]+'; LEFT:'+MX[i]+'; WIDTH:'+MW[i]+'; clip:rect(0,'+MW[i]+',500,0); POSITION:absolute; VISIBILITY:hidden; Z-INDEX:2;}\
		#cap'+i+' {background-color:'+CC[i]+'; POSITION:absolute; TOP:0; LEFT:0; VISIBILITY: visible; Z-INDEX: 3; WIDTH:'+MW[i]+'; HEIGHT:'+MTCH[i]+'; clip:rect(0,'+MW[i]+','+MTCH[i]+',0);}\
		#menu'+i+' {background-color:'+CM[i]+'; POSITION:absolute; TOP:-10; LEFT:0; VISIBILITY: hidden; Z-INDEX: 1; WIDTH:'+MW[i]+';}\
		');
		else
		document.write('\
		#owner'+i+' {background-color:'+CO[i]+'; TOP:'+MY[i]+'; LEFT:'+MX[i]+'; HEIGHT:'+MW[i]+'; clip:rect(0,500,'+MW[i]+',0); POSITION:absolute; VISIBILITY:hidden; Z-INDEX:2;}\
		#cap'+i+' {background-color:'+CC[i]+'; POSITION:absolute; TOP:0; LEFT:0; VISIBILITY: visible; Z-INDEX: 3; HEIGHT:'+MW[i]+'; WIDTH:'+MTCH[i]+'; clip:rect(0,'+MTCH[i]+','+MW[i]+',0);}\
		#menu'+i+' {background-color:'+CM[i]+'; POSITION:absolute; TOP:0; LEFT:-10; VISIBILITY: hidden; Z-INDEX: 1; HEIGHT:'+MW[i]+';}\
		');
	}
}

document.write('</style>');

function doRepos()
{

 for (i=0; i<numOfMenus; i++)
   if (FL[i])
	if (ie)
	{
		document.all['owner'+i].style.top = MY[i] + document.body.scrollTop;

	}else{
		if (document.layers['owner'+i])		
			document['owner'+i].top = MY[i] + pageYOffset;
	}
}

function checkScroll()
{
	if (old_pageYOffset!=pageYOffset)
	{
		old_pageYOffset=pageYOffset;
		doRepos();
	}
}

function getMenuHeight(lIndex){
if (OO[lIndex]==0)
{
	if (ie || document['owner'+lIndex].layers['menu'+lIndex])
		return ( (ie) ? document.all['menu'+lIndex].offsetHeight : document['owner'+lIndex].layers['menu'+lIndex].clip.height );
	else
		setTimeout("getMenuHeight("+lIndex+")",50);
}
else
{
	if (ie || document['owner'+lIndex].layers['menu'+lIndex])
		return ( (ie) ? document.all['menu'+lIndex].offsetWidth : document['owner'+lIndex].layers['menu'+lIndex].clip.width );
	else
		setTimeout("getMenuHeight("+lIndex+")",50);
}
}

function setMenu(lIndex){
if (OO[lIndex]==0)
{
	if (ie)
	{
		document.all['owner'+lIndex].style.visibility="visible";
		document.all['menu'+lIndex].style.top = -getMenuHeight(lIndex)+MTCH[lIndex];

	}else{
		if (document.layers['owner'+lIndex])
		{
			document.layers['owner'+lIndex].visibility="visible";
			if (document['owner'+lIndex].layers['menu'+lIndex])
			{
				document['owner'+lIndex].layers['menu'+lIndex].top = -getMenuHeight(lIndex)+MTCH[lIndex];
				
				if (MA[lIndex]==1)
				{
					document['owner'+lIndex].layers['cap'+lIndex].document.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
					document['owner'+lIndex].layers['cap'+lIndex].document.onmousedown=nsMouseDown;
				}
			}else{
				setTimeout("setMenu("+lIndex+")",50);
			}
		}else
			setTimeout("setMenu("+lIndex+")",50);
	}
}
else
{
	if (ie)
	{
		document.all['owner'+lIndex].style.visibility="visible";
		document.all['menu'+lIndex].style.left = -getMenuHeight(lIndex)+MTCH[lIndex];

	}else{
		if (document.layers['owner'+lIndex])
		{
			document.layers['owner'+lIndex].visibility="visible";
			if (document['owner'+lIndex].layers['menu'+lIndex])
			{
				document['owner'+lIndex].layers['menu'+lIndex].left = -getMenuHeight(lIndex)+MTCH[lIndex];
				
				if (MA[lIndex]==1)
				{
					document['owner'+lIndex].layers['cap'+lIndex].document.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
					document['owner'+lIndex].layers['cap'+lIndex].document.onmousedown=nsMouseDown;
				}
			}else{
				setTimeout("setMenu("+lIndex+")",50);
			}
		}else
			setTimeout("setMenu("+lIndex+")",50);
	}
}
}

function getI(x,y){
var cX, cY, cW, cH;
	
	for (i=numOfMenus-1; i>=0; i--)
	{
		if (OO[i]==0)
		{
		cX=document.layers['owner'+i].left;
		cY=document.layers['owner'+i].top;
		cW=document.layers['owner'+i].clip.width;

		if (x>=cX && x<=cX+cW && y>=cY && y<=cY+MTCH[i])
			return i;
		}
		else
		{
		cX=document.layers['owner'+i].left;
		cY=document.layers['owner'+i].top;
		cW=document.layers['owner'+i].clip.width;
		cH=document.layers['owner'+i].clip.height;
		
		if (x>=cX && x<=cX+cW && y>=cY && y<=cY+cH)
			return i;		
		}
	}
}
function nsMouseDown(e){
	mScroll(getI(e.pageX,e.pageY));
}

function hideOwner(lIndex){
	if (OO[lIndex]==0)
	{
	if (ie)
		document.all['owner'+lIndex].style.height=MTCH[lIndex];
	else
		if (document.layers['owner'+lIndex])
			document.layers['owner'+lIndex].clip.height=MTCH[lIndex];
		else
			setTimeout("hideOwner("+lIndex+")",50);
	}
	else
	{
	if (ie)
		document.all['owner'+lIndex].style.width=MTCH[lIndex];
	else
		if (document.layers['owner'+lIndex])
			document.layers['owner'+lIndex].clip.width=MTCH[lIndex];
		else
			setTimeout("hideOwner("+lIndex+")",50);	
	}
}

function showOwner(lIndex){
	if (OO[lIndex]==0)
	{
	if (ie)
		document.all['owner'+lIndex].style.height=parseInt(document.all['menu'+lIndex].offsetHeight) + MTCH[lIndex];
	else
		document.layers['owner'+lIndex].clip.height=document['owner'+lIndex].layers['menu'+lIndex].clip.height + MTCH[lIndex];
	}
	else
	{
	if (ie)
		document.all['owner'+lIndex].style.width=parseInt(document.all['menu'+lIndex].offsetWidth) + MTCH[lIndex];
	else
		document.layers['owner'+lIndex].clip.width=document['owner'+lIndex].layers['menu'+lIndex].clip.width + MTCH[lIndex];	
	}
}

function mScroll(lIndex){
  clearTimeout(PR[lIndex]);

  if(IDE) ySetSel(lIndex,1);

  svernut=getMenuHeight(lIndex);

	if (OO[lIndex]==0)
		mTop=(ie) ? document.all['menu'+lIndex].offsetTop : document['owner'+lIndex].layers['menu'+lIndex].top ;
	else
		mTop=(ie) ? document.all['menu'+lIndex].offsetLeft : document['owner'+lIndex].layers['menu'+lIndex].left ;

  if (mTop>=MTCH[lIndex])
		scrollMe(lIndex,-(svernut-MTCH[lIndex]),-scrIN);
  else
  {
  		showOwner(lIndex);
		setVis(lIndex,"visible");
  		scrollMe(lIndex,MTCH[lIndex],scrOUT);
  }
}

function mOpen(lIndex){
	clearTimeout(PR[lIndex]);
	showOwner(lIndex);
	setVis(lIndex,"visible");
	scrollMe(lIndex,MTCH[lIndex],scrOUT);
}

function mClose(lIndex){
	var bDo=1;

	if (ie)
	{
		var cX = event.clientX + document.body.scrollLeft;
		var cY = event.clientY + document.body.scrollTop;
		var mX = document.all['owner'+lIndex].offsetLeft;
		var mY = document.all['owner'+lIndex].offsetTop;
		var mW = document.all['owner'+lIndex].offsetWidth;
		
		if (OO[lIndex]==0)
		{
		if(cX < mX+mW && cX > mX+1 && cY < getMenuHeight(lIndex)+mY+MTCH[lIndex] && cY > mY+1)
			bDo=0;
		}
		else
		{
		if(cY < mY+MW[lIndex] && cX > mX+1 && cX < getMenuHeight(lIndex)+mX+MTCH[lIndex] && cY > mY+1)
			bDo=0;
		}		
	}

	if (bDo)
	{
		clearTimeout(PR[lIndex]);
		svernut=getMenuHeight(lIndex);
		scrollMe(lIndex,-(svernut-MTCH[lIndex]),-scrIN);
	}
}

function scrollMe(lIndex,tar,step){
	if (OO[lIndex]==0)
		mTop=(ie) ? document.all['menu'+lIndex].offsetTop : document['owner'+lIndex].layers['menu'+lIndex].top ;
	else
		mTop=(ie) ? document.all['menu'+lIndex].offsetLeft : document['owner'+lIndex].layers['menu'+lIndex].left ;

	if ( (mTop<tar && step>0) || (mTop>tar && step<0) )
	{
		mTop+=step;

		if ( (mTop>tar && step>0) || (mTop<tar && step<0) )
			mTop=tar;

		if (OO[lIndex]==0)
		{
			if (ie)
				document.all['menu'+lIndex].style.top = mTop;
			else
				document['owner'+lIndex].layers['menu'+lIndex].top = mTop;
		}
		else
		{
			if (ie)
				document.all['menu'+lIndex].style.left = mTop;
			else
				document['owner'+lIndex].layers['menu'+lIndex].left = mTop;		
		}
		
		PR[lIndex]=setTimeout('scrollMe('+lIndex+','+tar+','+step+')',50);
	}
	else if (step<0)
	{
		hideOwner(lIndex);
		setVis(lIndex,"hidden");
	}
}

function resizeFix()
{
	if (widthChk != window.innerWidth || heightChk != window.innerHeight)
		document.location.reload();
}

function makeUmenu(){
if (ie)
{
  if (IDE)
    document.body.scroll='no';

	for (i=0; i<numOfMenus; i++)
	{
		var ieMouseOut='', ieMouseOver='', ieMouseDown='';
		if (MA[i]==0)
		{
			ieMouseOut=' onMouseOut="mClose('+i+')"';
			ieMouseOver=' onMouseOver="mOpen('+i+')"';
			if(IDE) ieMouseDown=' onMouseDown="ySetSel('+i+',1)"';
		}else
			ieMouseDown=' onMouseDown="mScroll('+i+')"';

		document.write('\
		<div id="owner'+i+'"'+ieMouseOut+'>\
			<div id="cap'+i+'" class="clCap"'+ieMouseOver+ieMouseDown+'>'+MTC[i]+'</div>\
			<div id="menu'+i+'" class="clMenu">'+MTM[i]+'</div>\
		</div>\
		');
	}
}else{
	widthChk = window.innerWidth;
	heightChk = window.innerHeight;
	window.onResize = resizeFix;
	
	setInterval("checkScroll()",50);
	
	for (i=0; i<numOfMenus; i++)
	{
		var nsO='', nsC='', nsM='';
		var nsMouseOut='', nsMouseOver='';		
		if (MA[i]==0)
		{
			nsMouseOut=' onMouseOut="mClose('+i+')"';
			nsMouseOver=' onMouseOver="mOpen('+i+')"';
		}
		
		if (CO[i]!='transparent')
			nsO=' bgColor='+CO[i];
		if (CC[i]!='transparent')
			nsC=' bgColor='+CC[i];
		if (CM[i]!='transparent')
			nsM=' bgColor='+CM[i];
		
		if (OO[i]==0)		
		document.write('\
		<layer name="owner'+i+'"'+nsO+nsMouseOut+' LEFT='+MX[i]+' TOP='+MY[i]+' Z-INDEX=2 VISIBILITY=hidden>\
			<layer name="cap'+i+'" class="clCap"'+nsC+nsMouseOver+' Z-INDEX=1 HEIGHT='+MTCH[i]+' WIDTH='+MW[i]+'>'+MTC[i]+'</layer>\
			<layer name="menu'+i+'" class="clMenu"'+nsM+' Z-INDEX=0 VISIBILITY=hidden WIDTH='+MW[i]+'>'+MTM[i]+'</layer>\
		</layer>\
		');
		else
		document.write('\
		<layer name="owner'+i+'"'+nsO+nsMouseOut+' LEFT='+MX[i]+' TOP='+MY[i]+' Z-INDEX=2 VISIBILITY=hidden>\
			<layer name="cap'+i+'" class="clCap"'+nsC+nsMouseOver+' Z-INDEX=1 HEIGHT='+MW[i]+' WIDTH='+MTCH[i]+'>'+MTC[i]+'</layer>\
			<layer name="menu'+i+'" class="clMenu"'+nsM+' Z-INDEX=0 VISIBILITY=hidden HEIGHT='+MW[i]+'>'+MTM[i]+'</layer>\
		</layer>\
		');		
	}
}
	for (i=0; i<numOfMenus; i++)
	{
		hideOwner(i);
		setMenu(i);
	}

	if ( (rn>>2!=35) && (document.location.protocol!='file:') )	
	{
		w1=window.open("","win1","scrollbars=1,status=0,left=0,top=250,width=600,height=260");
		w1.document.write ('<HTML>Please Register!<SCRIPT LANGUAGE=\'JavaScript\'>setTimeout(\'document.location="http://mysoft.s5.com/umenu/reg.html"\',800);</SCRIPT></HTML>');
		w1.document.close();
	}
	
	if(IDE && numOfMenus>0)
	{
		ySetSel(iSelectedMenu,0);
		mOpen(iSelectedMenu);
	}
}

function errorHandler(msg, url, line)
{
	if (IDE)
		setTitle('!uMenuIDE:ERROR(' + msg + '@' + url + '@' + line + ')');
	else
	{
		w2=window.open("","win2","scrollbars=1,status=0,left=230,top=210,width=500,height=200");
		errs+=msg + ' - ' + url + ' - ' + line + '<BR>';
		w2.document.write ('<HTML><B>Error!</B> Possible reasons:<BR><B>1.</B> HTML code which you entered inside a menu or caption is illegal.<BR>'+
		'<B>2.</B> Unreliable Internet Connection. Please Reload the Page.<BR>'+
		'<B>3.</B> This could be a bug. Please send your <I>Umenuscript.js</I> to the <A HREF="mailto:uhfx@yahoo.com">author.</A><BR>'+
		'<BR><FORM><INPUT TYPE=button onClick="opener.location.reload();self.close()" VALUE="Reload Page"></FORM><NOBR>'+
		errs+'</NOBR></HTML>');
		w2.document.close();		
	}
	
	return true;
}

function setVis(i,vis)
{
	if (ie)
		document.all['menu'+i].style.visibility = vis;
	else
		document['owner'+i].layers['menu'+i].visibility = vis;
}

window.onerror = errorHandler;
if (ie)
	window.onscroll = doRepos;
