//<script>

var menuArray = new Array();
var N4, N5, IE4, IE5;
	
function init(){
	drawMenu();
	if(typeof(secondInit) != "undefined") // pass over the init to another, if existing
		secondInit();
}

function setGlobals(){
	N4 = document.layers?true:false;
	N5 = (!document.all && document.getElementById)?true:false;
	IE4 = (document.all && !document.getElementById)?true:false;
	IE5 = (document.all && document.getElementById)?true:false;
	if (N4) {var origWidth = window.innerWidth;var origHeight = window.innerHeight;window.onresize = reDo;}
}
function reDo() {if (window.innerWidth != origWidth || window.innerHeight != origHeight) location.reload();}

function menuObj(lay,nr){
	if(N4){
		this.lay = document.layers[lay];
		this.lay.parentNr = nr;
		this.lay.write = writeLay;
		this.lay.hide = hideLay;
		this.lay.show = showLay;
	}else{
		if(IE4)
			this.lay = document.all[lay];
		else
			this.lay = document.getElementById(lay);
		this.lay.parentNr = nr;
		this.lay.write = writeLayIE;
		this.lay.hide = hideLayIE;
		this.lay.show = showLayIE;
	}
	this.lay.onmouseover = menuLayOver;
	this.lay.onmouseout = menuLayOut;
}
function menuLayOver(){if(!N4) selVis("hidden");clipMenu(this.parentNr);hideAll();this.show();}
function menuLayOut(){this.hide();hideMarker();if(!N4) selVis("visible");}

function writeLay(txt){this.document.write(txt);this.document.close();}
function writeLayIE(txt){this.innerHTML = txt + '<div></div>';}
function hideLay(){this.visibility = "hide";}
function showLay(){this.visibility = "show";}
function hideLayIE(){this.style.visibility = "hidden";}
function showLayIE(){this.style.visibility = "visible";}

function selVis(vis){
	/***** no forms under the dropdowns right now...
	for(var i=0;i<document.forms.length;i++)
		for(var n=0;n<document.forms[i].elements.length;n++)
			if(document.forms[i].elements[n].type.substring(0,6) == "select")
				document.forms[i].elements[n].style.visibility=vis;
	*/
}
function hideAll() {
	for(var i=0;i < menuArray.length;i++)
		menuArray[i].lay.hide();
}
function hideMenus(){hideAll();hideMarker();if(!N4) selVis("visible");}

function showMenu(nr){
	if(menuArray.length>0){ // menus created
		if(!N4) selVis("hidden");
		clipMenu(nr);
		hideAll();
		menuArray[nr].lay.show();
	}
}

function drawMenu(){
	setGlobals();
	var menuTxt = [	
			[	["About&nbsp;Giantis","/builder/main/page/46.html"],
				["Process","/builder/main/page/49.html"],
				["Technology","/builder/main/page/63.html"],
				["Press","/builder/main/page/50.html"],
				["Contact&nbsp;Giantis","/builder/main/contact/contact.html"]],

			[	["GiantBlog","/builder/main/page/51.html"],
				["GiantCityWeb", "/builder/main/page/48.html"],
				["GiantConnect","/builder/main/page/52.html"],
				["GiantDocuments","/builder/main/page/53.html"],
				["GiantFiler","/builder/main/page/54.html"],
				["GiantInventory","/builder/main/page/55.html"],
				["GiantMail", "/builder/main/page/106.html"],
				["GiantMobile","/builder/main/page/56.html"],
				["GiantService","/builder/main/page/57.html"],
				["GiantSiteBuilder","/builder/main/page/58.html"],
 				["GiantShopping","/builder/main/page/107.html"]],

			[	["Industries","/builder/main/page/59.html"],
                                ["Architectural&nbsp;Audit","/builder/main/page/66.html"],
				["Software&nbsp;License&nbsp;Audit","/builder/main/page/60.html"],
				["Brand&nbsp;Building","/builder/main/page/61.html"],
				["Commercial&nbsp;Real&nbsp;Estate","/builder/main/page/62.html"]],

			[	["Learn&nbsp;More&nbsp;About&nbsp;Our&nbsp;Network", "/builder/main/page/68.html"],
				["Giantis&nbsp;Network", "http://www.giantis.net"]],

			[	["About&nbsp;Giantis&nbsp;Unlimited","/builder/main/page/47.html"],
				["Visit&nbsp;Giantis&nbsp;Unlimited","http://www.giantis.org"]]
			];
	for(var i=0;i<menuTxt.length;i++){
		menuArray[i] = new menuObj('topMenu'+i,i);
		var mTxt = "";
		for(var n=0;n<menuTxt[i].length;n++){
			if(document.getElementById)
				mTxt += '<tr><td height="15" bgcolor="#555555" onmouseover="lOver(this)" onmouseout="lOut(this)" ';
			else
				mTxt += '<tr><td height="15" bgcolor="#555555" ';
			if(!N4) 
				mTxt += 'style="cursor:hand"';
			mTxt += 'onclick="goLink(\''+ menuTxt[i][n][1] +'\');return false"><span class="navtext"><A href="'+menuTxt[i][n][1]+'">&nbsp;&nbsp;'+menuTxt[i][n][0]+'</A>&nbsp;&nbsp;</span></td></tr>';
		}
		menuArray[i].lay.write('<table bgcolor="#555555" cellspacing=0 border=0>'+mTxt+'</table>');
	}
}
function lOver(obj){
	if(!N4){ 
		obj.style.backgroundColor = "CC6600";
		if(obj.children)
			obj.children[0].children[0].style.color = "FFFFFF";
	}
}
function lOut(obj){
	if(!N4){
		obj.style.backgroundColor = "555555";
		if(obj.children)
			obj.children[0].children[0].style.color = "CBCBCB";
	}
}

var menuclipArea = [[0,103],[104,209],[210,330],[331,465],[466,600]];

function clipMenu(indx){
	if(indx < menuclipArea.length){
		if(N4)
			var mLay = document.layers['markLay'];
		else if(IE4)
			var mLay = document.all['markLay'];
		else
			var mLay = document.getElementById('markLay');
		mLay.setClip = N4?setClip:setClipIE;
		mLay.show = N4?showLay:showLayIE;
		mLay.setClip(menuclipArea[indx][0], 0, menuclipArea[indx][1], 20);
		mLay.show();
	}
}
function hideMarker(){
	if(N4)
		var mLay = document.layers['markLay'];
	else if(IE4)
		var mLay = document.all['markLay'];
	else
		var mLay = document.getElementById('markLay');
	mLay.hide = N4?hideLay:hideLayIE;
	mLay.hide();
}
function setClip(x, y, x2, y2){
	this.clip.left = x;
	this.clip.top = y;
	this.clip.right = x2;
	this.clip.bottom = y2;
}
function setClipIE(x, y, x2, y2){
	this.style.clip = "rect("+y+" "+x2+" "+y2+" "+x+")";
}
function openStoryWin(){
	window.open("/prototype/story/slide0.asp","storywin","width=400,height=149,top=230,left=162");
}
function goLink(linkStr){
	window.location = linkStr;
}
function resetForm(lay, formName){
	if(document.layers)
		document.layers[lay].document.forms[formName].reset();
	else if(document.getElementById)
		document.getElementById(formName).reset();
	else
		document.forms[formName].reset();
}

function init(){
drawMenu();
if(typeof(secondInit) != "undefined") // pass over the init to another, if existing
secondInit();
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//********** debug *************
/*
function showMouseLocation(){
	var x = event.clientX;
	var y = event.clientY;
	window.status = "DEBUG   x:"+x+"    y:"+y;
}
if(!N4){ 
	document.onmousemove = showMouseLocation; 
}
*/




