// JavaScript Document

/***********************************************
* 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
***********************************************/
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=780,height=695,scrollbars=yes');
return false;
}

function mySurvey() {
window.open("validate/form.html", "myWindow", 
"status = 1, height = 720, width = 830, resizable = 1, scrollbars=yes" )
}

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="epi/Technologies.html" target="FRAME1"><font color=#808080>Technologies</fONT></a>'
menu1[1]='<a href="epi/Design.html" target="FRAME1"><font color=#808080>Design</fONT></a>'
menu1[2]='<a href="epi/development.html" target="FRAME1"><font color=#808080>Development</fONT></a>'
menu1[3]='<a href="epi/graphic.html" target="FRAME1"><font color=#808080>Web Graphics</fONT></a>'
menu1[4]='<a href="epi/hosting.html" target="FRAME1"><font color=#808080>Hosting</fONT></a>'
menu1[5]='<a href="epi/sem.html" target="FRAME1"><font color=#808080>Search Engine</fONT></a>'


//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="epi/portfolio.html#corp" target="FRAME1"><font color=#808080>Online Shopping</fONT></a>'
menu2[1]='<a href="epi/portfolio.html#nfp" target="FRAME1"><font color=#808080>Not for Profits</fONT></a>'
menu2[2]='<a href="epi/portfolio.html#health" target="FRAME1"><font color=#808080>Health & Fitness</fONT></a>'
menu2[3]='<a href="epi/portfolio.html#soc" target="FRAME1"><font color=#808080>Social</fONT></a>'
//menu2[3]='<a href="services.html#perform"><font color=#808080>Performance Tuning</fONT></a>'
//menu2[4]='<a href="services.html#project"><font color=#808080>Project Management</fONT></a>'

//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="email.html" target="FRAME1"><font color=#808080>Email Us</fONT></a>'
menu3[1]='<a href="maillist.html" target="FRAME1"><font color=#808080> Mailing List</fONT></a>'
menu3[2]='<a href="guestbook.html" target="FRAME1"><font color=#808080>Guest Book</fONT></a>'
//menu3[3]='<a href="methodology.html#contract"><font color=#808080>Revised Contract</fONT></a>'
//menu3[4]='<a href="methodology.html#agile"><font color=#808080>Agile Methodologies</fONT></a>'

//Contents for menu 3, and so on
var menu4=new Array()
menu4[0]='<a href="theirStory.html" target="FRAME1"><font color=#808080>Their Story</fONT></a>'
menu4[1]='<a href="ourstory.html" target="FRAME1"><font color=#808080>Our Story</fONT></a>'

var menu5=new Array()
menu5[0]='<a href="epi/technologies.html" target="FRAME1"><font color=#808080>Technologies</fONT></a>'
menu5[1]='<a href="epi/faq.html" target="FRAME1"><font color=#808080>FAQ</fONT></a>'
//menu5[1]='<a href="#" onClick="mySurvey()"><font color=#808080>Survey</fONT></a>'


		
var menuwidth='168px' //default menu width
var menubgcolor='#FFFFFF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" 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"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
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 (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")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

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"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function menu_goto( menuform )
{
    // see http://www.thesitewizard.com/archive/navigation.shtml
    // for an explanation of this script and how to use it on your
    // own site

    var baseurl = "http://epigroupinc.com/foundry" ;
    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
      location.href = baseurl + newurl ;
    }
}

function popup2(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=650,height=665,scrollbars=yes');
return false;
}

function win1() {
    window.open("win1.php","Window1","menubar=no,width=460,height=360,toolbar=no");
}
