/***********************************************
* AnyLink Drop Down Menu- Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menus
/* Dynamic Dropdowns...keep for future development
    <c:forEach items="${headerChildren}" var="currentMenuItem" varStatus="stats">
        var menu<c:out value="${currentMenuItem.key}" />=new Array()
<c:forEach items="${currentMenuItem.value}" var="item" varStatus="stats2">
    <c:if test="${item.navType != 'vb' && item.depth == 2}">
menu<c:out value="${currentMenuItem.key}" />[<c:out value="${stats2.index}" />]='<a href="<c:out value="${item.uri}" />" class="mainNavDropdown"><c:out value="${item.label}" /> </a>'
    </c:if>
</c:forEach>
    </c:forEach>
*/

// About Us
var menu3=new Array()
menu3[0]='<a href="aboutus_commisioner.php" class="mainNavDropdown" title="Profile of the VAT Commisioner">Commisioner</a>'
menu3[1]='<a href="aboutus_dcommisioner.php" class="mainNavDropdown" title="Profile of Deputy Commisioners">Deputy Commisioners</a>'
menu3[2]='<a href="aboutus_fcommisioner.php" class="mainNavDropdown" title="Profile of Former Commisioners">Former Commisioners</a>'
menu3[3]='<a href="aboutus_orgstructure.php" class="mainNavDropdown" title="Organizational Structure">Organizational Structure</a>'
menu3[4]='<a href="aboutus_mission.php" class="mainNavDropdown" title="Mission & Objectives">Mission & Objectives</a>'
menu3[5]='<a href="aboutus_functions.php" class="mainNavDropdown" title="Functions & Policies">Functions & Policies</a>'
menu3[6]='<a href="aboutus_vat.php" class="mainNavDropdown" title="Achievements">Achievements</a>'
menu3[7]='<a href="aboutus_departments.php" class="mainNavDropdown" title="Departments">Departments</a>'
menu3[8]='<a href="aboutus_reports.php" class="mainNavDropdown" title="Reports & Publications">Reports & Publications</a>'
menu3[9]='<a href="aboutus_careers.php" class="mainNavDropdown" title="Careers">Careers</a>'

var menu4=new Array()
menu4[0]='<a href="locatevat_headoffice.php" class="mainNavDropdown" title="Our Head Office">Our Head Office</a>'
menu4[1]='<a href="locatevat_gr.php" class="mainNavDropdown" title="Greater Accra Region Office">Greater Accra Region</a>'
menu4[2]='<a href="locatevat_ash.php" class="mainNavDropdown" title="Ashanti Region">Ashanti Region Office</a>'
menu4[3]='<a href="locatevat_ba.php" class="mainNavDropdown" title="Brong Ahafo Office">Brong Ahafo</a>'
menu4[4]='<a href="locatevat_cr.php" class="mainNavDropdown" title="Central Regon Office">Central Regon</a>'
menu4[5]='<a href="locatevat_er.php" class="mainNavDropdown" title="Eastern Region Office">Eastern Region</a>'
menu4[6]='<a href="locatevat_nr.php" class="mainNavDropdown" title="Northern Region Office">Northern Region</a>'
menu4[7]='<a href="locatevat_uer.php" class="mainNavDropdown" title="Upper East Office">Upper East Region</a>'
menu4[8]='<a href="locatevat_uwr.php" class="mainNavDropdown" title="Upper West Office">Upper West Region</a>'
menu4[9]='<a href="locatevat_vr.php" class="mainNavDropdown" title="Volta Region Office">Volta Region</a>'
menu4[10]='<a href="locatevat_wr.php" class="mainNavDropdown" title="Western Region">Western Region</a>'

var menu5=new Array()
menu5[0]='<a href="taxinfo_individuals.php" class="mainNavDropdown" title="Individuals">Individuals</a>'
menu5[1]='<a href="taxinfo_biz.php" class="mainNavDropdown" title="Businesses">Businesses</a>'
menu5[2]='<a href="taxinfo_pro.php" class="mainNavDropdown" title="Tax Professionals">Tax Professionals</a>'
menu5[3]='<a href="taxinfo_gov.php" class="mainNavDropdown" title="Government Institutions">Government Institutions</a>'
menu5[4]='<a href="taxinfo_ngo.php" class="mainNavDropdown" title="Non-Governmental Organization">Non-Governmental Organization</a>'

var menu6=new Array()
menu6[0]='<a href="aboutvat_vat.php" class="mainNavDropdown" title="What is VAT">What is VAT</a>'
menu6[1]='<a href="aboutvat_nhil.php" class="mainNavDropdown" title="What is NHIL">What is NHIL</a>'
menu6[2]='<a href="aboutvat_cst.php" class="mainNavDropdown" title="Communication Service Tax">Communications Service Tax</a>'
menu6[3]='<a href="aboutvat_imports.php" class="mainNavDropdown" title="VAT on Imports">VAT on Inports</a>'
menu6[4]='<a href="aboutvat_exports.php" class="mainNavDropdown" title="VAT on Exports">VAT on Exports</a>'
menu6[5]='<a href="aboutvat_freezones.php" class="mainNavDropdown" title="Free Zones">Free Zones</a>'
menu6[6]='<a href="aboutvat_exemptions.php" class="mainNavDropdown" title="VAT Exemptions">VAT Exemptions</a>'
menu6[7]='<a href="aboutvat_pexemptions.php" class="mainNavDropdown" title="Partial Exemptions">Partial Exemptions</a>'
menu6[8]='<a href="aboutvat_retailvat.php" class="mainNavDropdown" title="VAT Retail Scheme">VAT Retail Scheme</a>'
menu6[9]='<a href="aboutvat_inputtax.php" class="mainNavDropdown" title="Input Tax">Input Tax</a>'
menu6[10]='<a href="aboutvat_outputtax.php" class="mainNavDropdown" title="Output Tax">Output Tax</a>'
menu6[11]='<a href="aboutvat_flatrate.php" class="mainNavDropdown" title="VAT Flat Rate Scheme">VAT Flat Rate Scheme</a>'


var menu7=new Array()
menu7[0]='<a href="efile.php" class="mainNavDropdown" title="File Your VAT Returns Online">eFile</a>'
menu7[1]='<a href="support.php" class="mainNavDropdown" title="Support">Support</a>'
menu7[2]='<a href="sendfeedback.php" class="mainNavDropdown" title="Send us Your Feedback">Send Feedback</a>'
menu7[3]='<a href="viewfeedback.php" class="mainNavDropdown" title="View Your Feddback Response">View Feddback Response</a>'
menu7[4]='<a href="newslettersubscriptionaccountlogphp.php" class="mainNavDropdown" title="View Your Newsletter Subscription">My Newsletter Account</a>'
menu7[5]='<a href="vatChat.php" class="mainNavDropdown" title="VAT Instant Messenger">VAT Instant Messenger</a>'

var menu9=new Array()
menu9[0]='<a href="taxfraud.php" class="mainNavDropdown" title="What is Tax Fraud">Tax Fraud</a>'
menu9[1]='<a href="reportfraud.php" class="mainNavDropdown" title="Report Tax Fraud">Report Fraud</a>'

var menu2=new Array()
menu2[0]='<a href="faq.php" class="mainNavDropdown" title="Frequently Asked Questions">FAQ</a>'
menu2[1]='<a href="downloads.php" class="mainNavDropdown" title="Downloads">Downloads</a>'
menu2[2]='<a href="newsevents.php" class="mainNavDropdown" title="News & Events">News & Events</a>'
menu2[3]='<a href="usefullinks.php" class="mainNavDropdown" title="Useful Links">Useful Links</a>'

var menuwidth='180' //default menu width 
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

var xOffset = -18; // number of pixels to offset menu right or left
var yOffset = 8; // number of pixels to offset menu up or down

/////No further editting needed
var ie4=document.all
var ie5_5=typeof dropmenuiframe=='undefined'? 0 : 1
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="z-index:100;visibility:hidden;width:'+menuwidth+';" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top='-500px'
    dropmenuobj.widthobj=dropmenuobj.style
    //dropmenuobj.widthobj.width=menuwidth
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
        obj.visibility=visible;
        unhideIframe();
    } else if (e.type=="click") {
        setTimeout("hideIframe();",0);
        obj.visibility=hidden
    }
}


function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
    if (ie4||ns6)
        dropmenuobj.innerHTML=what.join("")
    }

function dropdownmenu(obj, e, menucontents, menuwidth){
if (menucontents.length > 0) {
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left") + xOffset;
dropmenuobj.y=getposOffset(obj, "top") + yOffset;
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
unhideIframe()
}

return clickreturnvalue()
}
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
hideIframe()
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes") {
document.onclick=delayhidemenu
}

// Hide IFrame
function hideIframe() {
if (ie5_5){
var theIframe = document.getElementById("dropmenuiframe")
theIframe.style.display = "none";
}
}

// Unhide IFrame
function unhideIframe() {
if (ie5_5){
var theIframe = document.getElementById("dropmenuiframe")
var theDiv = document.getElementById("dropmenudiv");
theIframe.style.width = theDiv.offsetWidth+'px';
theIframe.style.height = theDiv.offsetHeight+'px';
theIframe.style.top = theDiv.offsetTop+'px';
theIframe.style.left = theDiv.offsetLeft+'px';
theIframe.style.display = "block";
}
}
