/**********************************************************************************   
FoldoutMenu 
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Thomas Brattli
*
*   Script date: 09/04/2001 (keep this date to check versions) 
*********************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck()

/*** variables you can configure ***/

FoldNumber = 4					//How many toplinks do you have?
var stayFolded = false			//Stay open when you click a new toplink?
foldImg = 1						//Do you want images (if not set to 0 and remove the images from the body)?
mainOffsetY = 0					//Vertical space adjustment between the main items, in pixels.

//This is the default image.
//Remember to change the actual images in the page as well, but remember to keep the name of the image.
var unImg=new Image();
unImg.src='images/foldoutmenu_arrow.gif'

var exImg=new Image();					//Making an image variable...
exImg.src='images/foldoutmenu_arrow_open.gif'	//...this is the source of the image that it changes to when the menu expands.

// NOTE: if you change the position of divCont from absolute to relative, you can put the foldoutmenu in a table.
// HOWEVER it will no longer work in netscape 4. If you wish to support netscape 4, you have to use absolute positioning.

/*** There should be no need to change anything beyond this. ***/

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

if(navigator.userAgent.indexOf('Opera')>-1 && document.getElementById){ //Opera 5 resize fix.
	scrX= innerWidth; scrY= innerHeight;
	document.onmousemove= function(){
		if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){
			scrX = innerWidth;
			scrY = innerHeight;
			initFoldout();
		}
	};
}

//object constructor...
function makeMenu(obj,nest){
	nest= (!nest)?"":'document.'+nest+'.';
	this.el= bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj);	
   	this.css= bw.ns4?this.el:this.el.style;
	this.ref= bw.ns4?this.el.document:document;		
	this.x= (bw.ns4||bw.opera5)?this.css.left:this.el.offsetLeft;
	this.y= (bw.ns4||bw.opera5)?this.css.top:this.el.offsetTop;
	this.h= (bw.ie||bw.ns6)?this.el.offsetHeight:bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:0;
    this.vis= b_vis;
	this.hideIt= b_hideIt;
    this.showIt= b_showIt;
    this.moveIt= b_moveIt;
	return this
}
//object methods...
function b_showIt(){this.css.visibility='visible'}
function b_hideIt(){this.css.visibility='hidden'}
function b_vis(){if(this.css.visibility=='hidden' || this.css.visibility=='HIDDEN' || this.css.visibility=='hide') return true;}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px}

/************************************************************************************
This is the function that changes the sub menus to folded or unfolded state.
************************************************************************************/
function menu(num){
	if(bw.bw){
		if (!stayFolded){
			for (var i=0; i<oSub.length; i++){
				if (i!=num){
					oSub[i].hideIt()
					if (foldImg)oTop[i].ref["imgA"+i].src = unImg.src
				}
			}
			for(var i=1; i<oTop.length; i++){
				oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h)
			}
		}
		if (oSub[num].vis()){
			oSub[num].showIt()
			if (foldImg)oTop[num].ref["imgA"+num].src = exImg.src
		}else{
			oSub[num].hideIt()
			if(foldImg)oTop[num].ref["imgA"+num].src = unImg.src
		}
		for(var i=1; i<oTop.length; i++){ 
			if (!oSub[i-1].vis()) oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+oSub[i-1].h+mainOffsetY) 
			else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+mainOffsetY)
		}
	}
}

/*********************************************************************
The init function... there should be no need to change anything here.
*********************************************************************/
function initFoldout(){
	//Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
	bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
	if (bw.opera5) bw.ns6 = 0

	oTop = new Array()
	oSub = new Array()
	//Making the objects and hiding the subs...
	for (var i=0; i<FoldNumber; i++){
		oTop[i] = new makeMenu('divTop'+i,'divCont')
		oSub[i] = new makeMenu('divSub'+i,'divCont.document.divTop'+i)
		oSub[i].hideIt()
	}
	
	//Positioning the top objects...
	oTop[0].moveIt(0,0)
	for (var i=1; i<oTop.length; i++){
		oTop[i].moveIt(0, oTop[i-1].y+oTop[i-1].h+mainOffsetY)
	}
	
	//Making the containing menu object and showing it...
	oCont = new makeMenu('divCont')
	oCont.showIt()
}

// If the browser is ok, the script is started onload...
if(bw.bw) onload = initFoldout;

/*******************************************************************
 * soopa-rollovers.js
 * 7/28/2001
 * www.youngpup.net
 *
 * easiest rollovers on earth, baby!
 * see www.youngpup.net for documentation.
 *******************************************************************/


function soopaSetup() {
	var img, sh, sn, sd
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute) {

			sn = img.getAttribute("src");
			sh = img.getAttribute("hsrc");
			sd = img.getAttribute("dsrc");

			if (sn != "" && sn != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				if (sh != "" && sh != null) {
					img.h = new Image();
					img.h.src = sh;
					img.onmouseover = soopaSwapOn
					img.onmouseout  = soopaSwapOff
				}

				if (sd != "" && sd != null) {
					img.d = new Image();
					img.d.src = sd;
					img.onmousedown = soopaSwapDown
				}
			}
		}
	}
}

function soopaSwapOn() {
	this.src = this.h.src;
}

function soopaSwapOff() {
	this.src  = this.n.src;
}

function soopaSwapDown() {
	this.src  = this.d.src;
	this.temp = typeof(document.onmouseup) != 'undefined' && typeof(document.onmouseup) != 'unknown' ? document.onmouseup : "";
	soopaSwapUp.img = this;
	document.onmouseup = soopaSwapUp;
}

function soopaSwapUp() {
	var ths = soopaSwapUp.img;
	ths.src = ths.n.src;
	if (ths.temp) document.onmouseup = ths.temp;
}

// Build Top & Left Navigation
function loadNavigation()
{

// Site Logo
document.write("<div id='logo'><img src='images/logo.gif' alt='247max.com' width='116' height='49' border='0'></div>");

// Top Navigation
document.write("<div id='topnav1'><a href='index.html'><img src='images/home.gif' hsrc='images/home_over.gif' alt='' width='33' height='15' border='0'></a></div>");
document.write("<div id='topnav2'><a href='list-of-clients.html'><img src='images/clients.gif' hsrc='images/clients_over.gif' alt='' width='37' height='15' border='0'></a></div>");
document.write("<div id='topnav3'><a href='about-us.html'><img src='images/aboutus.gif' hsrc='images/aboutus_over.gif' alt='' width='50' height='15' border='0'></a></div>");
document.write("<div id='topnav4'><a href='contact-us.html'><img src='images/contactus.gif' hsrc='images/contactus_over.gif' alt='' width='59' height='15' border='0'></a></div>");

// Left Navigation
document.write("<div id='divCont'>");

document.write("<div id='divTop0' class='clTop'><a href='#' onclick='menu(0); return false' onfocus='this.blur()'><img src='images/foldoutmenu_arrow.gif' name='imgA0' width='20' height='10' alt='' border='0'>Web Development</a><br>");
document.write("<div id='divSub0' class='clSub'>");
document.write("<a href='website-design.html'>Website Design</a><br>");
document.write("<a href='shopping-cart.html'>eCommerce Solutions</a><br>");
document.write("<a href='database-development.html'>Database Solutions</a><br>");
document.write("<a href='search-engine-optimization.html'>Search Engine Optimization</a><br>");
document.write("<a href='flash-programming.html'>Flash Programming</a><br>");
document.write("<a href='web-hosting.html'>Web Hosting</a><br>");
document.write("</div><br>");
document.write("</div>");

document.write("<div id='divTop1' class='clTop'><a href='#' onclick='menu(1); return false' onfocus='this.blur()'><img src='images/foldoutmenu_arrow.gif' name='imgA1' width='20' height='10' alt='' border='0'>Web Marketing</a><br>");
document.write("<div id='divSub1' class='clSub'>");
document.write("<a href='strategic-planning.html'>Strategic Planning</a><br>");
document.write("<a href='campaign-creatives.html'>Campaign Creatives</a><br>");
document.write("<a href='campaign-creatives.html'>eNewsletters</a><br>");
document.write("<a href='email-marketing.html'>eMail Marketing</a><br>");
document.write("<a href='search-engine-optimization.html'>Search Engine Optimization</a><br>");
document.write("<a href='other-consulting-services.html'>Other Consulting Services</a><br>");
document.write("<a href='market-research.html'>Market Research</a><br>");
document.write("</div><br>");
document.write("</div>");

document.write("<div id='divTop2' class='clTop'><a href='#' onclick='menu(2); return false' onfocus='this.blur()'><img src='images/foldoutmenu_arrow.gif' name='imgA2' width='20' height='10' alt='' border='0'>Tools</a><br>");
document.write("<div id='divSub2' class='clSub'>");
document.write("<a href='email-list-builder.html'>Email List Builder</a><br>");
document.write("<a href='exit-surveys.html'>Exit Surveys</a><br>");
document.write("<a href='exit-surveys.html'>Auto-Responders</a><br>");
document.write("<a href='shopping-cart.html'>Shopping Cart</a><br>");
document.write("<a href='email-marketing.html'>List Management</a><br>");
document.write("</div><br>");
document.write("</div>");

document.write("<div id='divTop3' class='clTop'><a href='#' onclick='menu(3); return false' onfocus='this.blur()'><img src='images/foldoutmenu_arrow.gif' name='imgA3' width='20' height='10' alt='' border='0'>Resources</a><br>");
document.write("<div id='divSub3' class='clSub'>");
document.write("<a href='list-of-clients.html'>List of Clients</a><br>");
document.write("</div><br>");
document.write("</div>");

document.write("</div>");

}

// Load Navigation
loadNavigation();

// Activate Top Navigation Rollovers
setTimeout("soopaSetup()", 500);