﻿var ola = "http://www.oladdins.com";
var admin;
//var std = "http://www.software-solutions.co.nz";
//var ssl = "http://www.software-solutions.co.nz";
var std = "";
var ssl = "";
//var ssl = "http://localhost:8080";
//var std = "http://localhost:8080";
var dbl;
var menuclose = true;
var tourrank;
var tdno;
var hdELtop;
var hdODtop;
var hdCOtop;
var hdLOtop;
var normalbackground = "#3E85DE";
var normalborder = "#2A5FB2";
var headerbackground = "#3E85DE";
var headerborder = "#2A5FB2";

function setNavTableFontColors() {
	var mainDiv
	if (document.getElementById) {
		mainDiv = document.getElementById('navbar')
	}
	else mainDiv = eval("document.all.navbar");
	if (mainDiv) {
		var menus = mainDiv.getElementsByTagName('a');
		for (var i = 0; i < menus.length; i++) {
			var myobj = menus[i];

			if (myobj.id.substring(0, 2) == "td") {
				if (myobj.id.substring(2, 4) == "BG") myobj.style.color = "#008800";
				else if (myobj.id.substring(2, 4) == "BN") myobj.style.color = "#FF0000";
				else myobj.style.color = "#3A589B";
			} else if (myobj.id.substring(0, 2) == "hd") {
				if (myobj.id == "hdMyAladdins") myobj.style.color = "#15428B";
				else myobj.style.color = "#15428B";
			} else if (myobj.id == "heading") myobj.style.color = "#15428B";
		}
	}
}

function selectcell(cell) {
	if (document.getElementById) myobj = document.getElementById(cell)
	else myobj = eval("document.all." + cell);
	if (myobj) {
		if (myobj.id == "heading") {
			myobj.className = "menuselproduct";
			myobj.style.backgroundColor = headerbackground;
			myobj.style.borderColor = headerborder;
			myobj.style.borderStyle = "solid";
			myobj.style.color = "#FFFFFF";
		} else {
			myobj.className = "menuselnormal";
			myobj.style.backgroundColor = normalbackground;
			myobj.style.borderColor = normalborder;
			myobj.style.borderStyle = "solid";
			myobj.style.color = "#FFFFFF";
		}
	}
}

function createmenuobjects() {
	//Blog
	Uize.module({
		required: [
    'Uize.Widget.HoverFader',
    'Uize.Curve',
    'Uize.Widget.Page',
  ],
		builder: function () {
			var page = window.page = new Uize.Widget.Page;
			/*** create the hover fader instance ***/
			page.addChild('hoverFader', Uize.Widget.HoverFader, { nodes: { className: /\menutblblog\b/ },
				defaultStyle:
	        { color: '#008800', backgroundColor: '#D9E5F2', borderColor: '#D9E5F2' },
				hoverStyle:
	        { color: '#008800', backgroundColor: '#B9D3F0', borderColor: '#B9D3F0' },
				fadeIn: { duration: 250 },
				fadeOut: { duration: 550 }
			});
			page.wireUi();
		}
	});
	//BuyNow
	Uize.module({
		required: [
    'Uize.Widget.HoverFader',
    'Uize.Curve',
    'Uize.Widget.Page',
  ],
		builder: function () {
			var page = window.page = new Uize.Widget.Page;
			/*** create the hover fader instance ***/
			page.addChild('hoverFader', Uize.Widget.HoverFader, { nodes: { className: /\menutblbuynow\b/ },
				defaultStyle:
	        { color: '#FF0000', backgroundColor: '#D9E5F2', borderColor: '#D9E5F2' },
				hoverStyle:
	        { color: 'FF0000', backgroundColor: '#B9D3F0', borderColor: '#B9D3F0' },
				fadeIn: { duration: 250 },
				fadeOut: { duration: 550 }
			});
			page.wireUi();
		}
	});
	//product header
	Uize.module({
		required: [
    'Uize.Widget.HoverFader',
    'Uize.Curve',
    'Uize.Widget.Page',
  ],
		builder: function () {
			var page = window.page = new Uize.Widget.Page;
			/*** create the hover fader instance ***/
			page.addChild('hoverFader', Uize.Widget.HoverFader, { nodes: { className: /\menuproduct\b/ },
				defaultStyle:
	        { color: '#15428B', backgroundColor: '#D9E5F2', borderColor: '#D9E5F2' },
				hoverStyle:
	        { color: '#15428B', backgroundColor: '#B9D3F0', borderColor: '#B9D3F0' },
				fadeIn: { duration: 250 },
				fadeOut: { duration: 550 }
			});
			page.wireUi();
		}
	});
	//Selected Product
	Uize.module({
		required: [
    'Uize.Widget.HoverFader',
    'Uize.Curve',
    'Uize.Widget.Page',
  ],
		builder: function () {
			var page = window.page = new Uize.Widget.Page;
			/*** create the hover fader instance ***/
			page.addChild('hoverFader', Uize.Widget.HoverFader, { nodes: { className: /\menuselproduct\b/ },
				defaultStyle:
	        { color: 'F', backgroundColor: headerbackground, borderColor: headerborder },
				hoverStyle:
	        { color: 'F', backgroundColor: headerbackground, borderColor: headerborder },
				fadeIn: { duration: 250 },
				fadeOut: { duration: 550 }
			});
			page.wireUi();
		}
	});
	//Normal Menu
	Uize.module({
		required: [
    'Uize.Widget.HoverFader',
    'Uize.Curve',
    'Uize.Widget.Page',
  ],
		builder: function () {
			var page = window.page = new Uize.Widget.Page;
			/*** create the hover fader instance ***/
			page.addChild('hoverFader', Uize.Widget.HoverFader, { nodes: { className: /\menunormal\b/ },
				defaultStyle:
	        { color: '#15428B', backgroundColor: '#D9E5F2', borderColor: '#D9E5F2' },
				hoverStyle:
	        { color: '#15428B', backgroundColor: '#B9D3F0', borderColor: '#B9D3F0' },
				fadeIn: { duration: 150 },
				fadeOut: { duration: 550 }
			});
			page.wireUi();
		}
	});
	//Selected Normal Menu
	Uize.module({
		required: [
    'Uize.Widget.HoverFader',
    'Uize.Curve',
    'Uize.Widget.Page',
  ],
		builder: function () {
			var page = window.page = new Uize.Widget.Page;
			/*** create the hover fader instance ***/
			page.addChild('hoverFader', Uize.Widget.HoverFader, { nodes: { className: /\menuselnormal\b/ },
				defaultStyle:
	        { color: 'F', backgroundColor: normalbackground, borderColor: normalborder },
				hoverStyle:
	        { color: 'F', backgroundColor: normalbackground, borderColor: normalborder },
				fadeIn: { duration: 250 },
				fadeOut: { duration: 550 }
			});
			page.wireUi();
		}
	});
}

function writecell(myhref, mycap, myid, sublevel) {
	var mycen = "";
	var cls;
	if (myid.substring(2, 4) == "BG") cls = "menutblblog";
	else if (myid.substring(2, 4) == "BN") cls = "menutblbuynow";
	else if (myid.substring(0, 2) == "td" || myid.substring(0, 3) == "sub") cls = "menunormal";
	else if (myid.substring(0, 2) == "hd") cls = "menuproduct";
	else if (myid == "heading") cls = "menuselproduct";

	if (sublevel) {
		document.write('<a id="' + myid + '" href="' + myhref + '" onfocus="if(this.blur)this.blur()" style="margin-left:15px;padding-left:5px;" class="' + cls + '">' + mycap + '</a>');
	} else if (myid == "ignore") {
		document.write('<a id="ignore" href="' + myhref + '" onfocus="if(this.blur)this.blur()" style="margin-left:2px;padding-left:5px" class="' + cls + '">' + mycap + '</a>');
	} else {
		document.write('<a id="' + myid + '" href="' + myhref + '" onfocus="if(this.blur)this.blur()" style="margin-left:2px;padding-left:5px;" class="' + cls + '">' + mycap + '</a>');
	}
}

dbl = 0;

//menutbl
document.write('<table cellspacing="0px" cellpadding="0px" style="width:150px;border:0px green solid">');
document.write('<tr><td><div class="menutbl" id="navbar" style="position:relative;float:left;border:0px green solid">');

writecell(std + "/default.aspx", Home, "td1");

if (product == "") {
	writecell(std + "/aladdins_el/alelabout.aspx", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.aspx", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.aspx", "CategorieZ", "hdCO");
	writecell(std + "/aladdins_lo/alloabout.aspx", "LinkZ", "hdLO");
	hdELtop = 2;
	hdODtop = 3;
	hdCOtop = 4;
	hdLOtop = 5;
	subcount = 0;
	tdno = 5;
}

if (product == "EL") {
	writecell(std + "/aladdins_el/alelabout.aspx", "Envelopes & Labels", "heading");
	writecell(std + "/aladdins_el/alelabout.aspx", About, "td3", true);
	writecell(std + "/aladdins_el/alelfeatures.aspx", Features, "td4", true);
	writecell(std + "/aladdins_el/aleluserscomments.aspx", UserComments, "td5", true);
	writecell(std + "/aladdins_el/alelawards.aspx", ProductReviews, "td6", true);
	writecell(std + "/aladdins_el/alelscreenshot.aspx", ScreenShots, "td7", true);
	writecell(std + "/aladdins_el/alelfaq.aspx", FAQ, "td8", true);
	writecell(std + "/aladdins_od/alodabout.aspx", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.aspx", "CategorieZ", "hdCO");
	writecell(std + "/aladdins_lo/alloabout.aspx", "LinkZ", "hdLO");
	hdODtop = 10;
	hdCOtop = 11;
	hdLOtop = 12;
	dbl = 1;
	tdno = 12;
}
if (product == "OD") {
	writecell(std + "/aladdins_el/alelabout.aspx", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.aspx", "Office Documents", "heading");
	writecell(std + "/aladdins_od/alodabout.aspx", About, "td4", true);
	writecell(std + "/aladdins_od/alodfeatures.aspx", Features, "td5", true);
	writecell(std + "/aladdins_od/alodbcmfeatures.aspx", BCMFeatures, "td6", true);
	writecell(std + "/aladdins_od/alodbcmreports.aspx", BCMReporting, "td7", true);
	writecell(std + "/aladdins_co/alcoabout.aspx", "CategorieZ", "hdCO");
	writecell(std + "/aladdins_lo/alloabout.aspx", "LinkZ", "hdLO");
	hdELtop = 3;
	hdCOtop = 11;
	hdLOtop = 12;
	tdno = 12;
}

if (product == "CO") {
	writecell(std + "/aladdins_el/alelabout.aspx", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.aspx", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.aspx", "CategorieZ", "heading");
	writecell(std + "/aladdins_co/alcoabout.aspx", About, "td5", true);
	writecell(std + "/aladdins_co/alcoorganize.aspx", Organize, "td6", true);
	writecell(std + "/aladdins_co/alcodiscover.aspx", Discover, "td7", true);
	writecell(std + "/aladdins_co/alcoutilize.aspx", Utilize, "td8", true);
	writecell(std + "/aladdins_co/alcoautomate.aspx", Automate, "td9", true);
	writecell(std + "/aladdins_co/alcosync.aspx", Synchronize, "td10", true);
	writecell(std + "/aladdins_lo/alloabout.aspx", "LinkZ", "hdLO");
	hdELtop = 3;
	hdODtop = 4;
	hdLOtop = 11;
	tdno = 11;
}

if (product == "LO") {
	writecell(std + "/aladdins_el/alelabout.aspx", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.aspx", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.aspx", "CategorieZ", "hdCL");
	writecell(std + "/aladdins_lo/alloabout.aspx", "LinkZ", "heading");
	writecell(std + "/aladdins_lo/alloabout.aspx", About, "td6", true);
	hdELtop = 3;
	hdODtop = 4;
	hdCOtop = 5;
	tdno = 7;
}

if (rank < 200 && rank > 99) rank = rank - 100 + tdno;

writecell(std + "/aladblog", Articles, "tdBG" + tdno);
tdno++;
writecell(std + "/general/download.aspx", DownloadNow, "td" + tdno);
tdno++;
writecell(std + "/order/pricing.aspx", Pricing, "td" + tdno);
tdno++;
writecell(std + "/myaladdins/order.aspx", Purchase, "tdBN" + tdno);
tdno++;
writecell(std + "/general/referralcash.aspx", Affiliate, "td" + tdno);
tdno++;
writecell(std + "/general/support.aspx", Support, "td" + tdno);
tdno++;
writecell(std + "/forum", Forum, "td" + tdno);
tdno++;
writecell(std + "/general/contact.aspx", Contact, "td" + tdno);
tdno++;
//	writecell(std + "/about_us.asp", "About Us", "td"+tdno);
//	tdno++;
if (rank < 200) {
	writecell(ssl + "/myaladdins/customerwelcome.aspx", MyAladdins1, "hdMyAladdins");
	tdno = tdno + 1;
} else {
	rank = rank - 200 + tdno;
	writecell(ssl + "/myaladdins/customerwelcome.aspx", MyAladdins2, "heading");
	writecell(ssl + "/myaladdins/customerwelcome.aspx", Welcome, "td" + tdno, true);
	tdno++;
	writecell(ssl + "/myaladdins/customerinfosum.aspx", MyDetails, "td" + tdno, true);
	tdno++;
	writecell(ssl + "/myaladdins/subscription.aspx", Subscriptions, "td" + tdno, true);
	tdno++;
	writecell(ssl + "/myaladdins/orderhistory.aspx", OrderHistory, "td" + tdno, true);
	tdno++;
	writecell(ssl + "/myaladdins/referrals.aspx", ReferralSetup, "td" + tdno, true);
	tdno++;
	writecell(ssl + "/myaladdins/referralreports.aspx", ReferralReports, "td" + tdno, true);
	tdno++;
	writecell(ssl + "/myaladdins/requestkey.aspx", Key, "td" + tdno, true);
	tdno++;
	if (admin == 'yes') {
		writecell("", "", "ignore", false);
		writecell(ssl + "/utils/default.aspx", "Utilities", "td" + tdno, true);
		writecell(ssl + "/myaladdins/index.aspx", "Reports", "td" + tdno, true);
	}
}

//end of menu tbl
document.write('</div></td></tr></table>');



