var ns6=document.getElementById&&!document.all;
var ie=document.all;
var menuclose=true;
var tourrank;
var tdno;
var	hdELtop;
var hdODtop;
var hdCOtop;
var hdLOtop;
var ola = "http://www.oladdins.com";
var std = "http://www.software-solutions.co.nz";
var ssl = "https://www.software-solutions.co.nz";
//var ssl = "https://localhost:4430";
//var std = "http://localhost:8080";
var dbl;


function OpenWindow(strURL, strTitle, intWidth, intHeight){
	var intWindowLeft
	var intWindowTop
	var msgWindow
	intWindowLeft = (screen.width - intWidth) / 2;
	intWindowTop = (screen.height - intHeight) / 3;
	msgWindow = window.open(strURL,strTitle,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + intWidth + ',height=' + intHeight + ',left=' + intWindowLeft + ',top=' + intWindowTop);
}

function changeto(e){
	source=ie? event.srcElement : e.target
	if (source.tagName=="TR"||source.tagName=="TABLE")
		return
	while(source.tagName!="TD"&&source.tagName!="HTML")
		source=ns6? source.parentNode : source.parentElement
	if (source.style.backgroundColor!="#A6B9E3"&&source.id!="ignore"&&source.id!="heading"){
		if (ns6) myobj = document.getElementById(source.id);
		else myobj = source;

		if (myobj){
			myobj.style.cursor='hand';
			if (myobj.id!="hint"){
			myobj.style.backgroundColor="#ADC5ED";
			myobj.style.borderColor="#000080";
			myobj.style.borderStyle="solid";}
		}
	}
//	if (source.id=="heading"||source.id=="ignore"){
//		source.style.cursor='pointer'}

	if (source.id.substring(0,3)=="sub") menuclose=false;
	if (source.id.substring(0,2)=="td"||source.id.substring(0,2)=="hd") clearmenus();
//	if (source.id=="hdEL") displaysubmenuad("subELAD", source.id);
//	if (source.id=="hdOD") displaysubmenuad("subODAD", source.id);
//	if (source.id=="hdTE") displaysubmenuad("subTEAD", source.id);
//	if (source.id=="hdCL") displaysubmenuad("subCLAD", source.id);
	if (source.id=="td7") displaysubmenu("subODDocWiz");
//	if (source.id=="td8") displaysubmenu("subCLTech");
}

function displaysubmenuad(menu, id){
	menuclose=false;
	var itop;
	if (ns6) myobj = document.getElementById(menu);
	else myobj = eval("document.all."+menu);
	if (id=="hdEL") itop=hdELtop;
	if (id=="hdOD") itop=hdODtop;
	if (id=="hdCO") itop=hdCOtop;
	if (id=="hdLO") itop=hdLOtop;
//	if (id=="hdTE") itop=hdTEtop;
//	if (id=="hdCL") itop=hdCLtop;
	itop = ((itop-1)*19)+70+(dbl*-6);
	if (myobj){
		myobj.style.top=itop;
		myobj.style.visibility="visible";}
	
}
function displaysubmenu(menu){
	menuclose=false;
	if (ns6){
		myobj = document.getElementById(menu);
		if (myobj) myobj.style.visibility="visible";
	} else {
		myobj = eval("document.all."+menu);
		if (myobj) myobj.style.visibility="visible";
	}
}

function delayclose(){
	if (menuclose) clearmenus();
}

function HideObj(s){
	if (ns6){
		myobj = document.getElementById(s);
		if (myobj) myobj.style.visibility="hidden";
	} else {
		myobj = eval("document.all."+s);
		if (myobj) myobj.style.visibility="hidden";
	}
}

function clearmenus(){
//	HideObj("subELAD");
//	HideObj("subODAD");
//	HideObj("subTEAD");
//	HideObj("subCLAD");
	HideObj("subODDocWiz");
	HideObj("subCLTech");
}

function contains_ns6(master, slave) { //check if slave is contained by master
	if (slave){
		while (slave.parentNode)
		if ((slave = slave.parentNode) == master)
			return true;
		return false;
	}
}

function changeback(e){
	if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore"||source.id=="heading")||source.tagName=="TR"||source.tagName=="TABLE")
		return
	else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
		return
	if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source){
		if (ns6) myobj = document.getElementById(source.id)
		else myobj = source;
		if (myobj){
			if(myobj.id!="hint"){
			myobj.style.backgroundColor="#CEDEFA";//f1f1f1";
			myobj.style.borderColor="#CEDEFA";//f1f1f1";
			myobj.style.borderStyle="solid";}
		}
	}

	if (myobj){
		if (myobj.id=="tdNext"||myobj.id=="tdBack"){
			source.style.borderColor="#DCE6F7";
			source.style.backgroundColor="#DCE6F7";
		}
		if ("td"+rank==myobj.id) selectcell(myobj.id);
		if ("hd"+rank==myobj.id) selectcell(myobj.id);
//	if (rank>15) selectcell("td15");
		if (myobj.id.substring(0,3)=="sub"||myobj.id=="hint"){
			menuclose=true;
			setTimeout("delayclose()", 500);
		}
	}
}

function selectcell(cell){
	if (ns6) myobj = document.getElementById(cell)
	else myobj = eval("document.all."+cell);
	if (myobj){
		myobj.style.backgroundColor="#FEFCE3";
		myobj.style.borderColor="#ADC5ED";
		myobj.style.borderStyle="solid";
		myobj.style.filter="progid:DXImageTransform.Microsoft.Gradient(startColorStr=#FEFCE3, endColorStr=#FDDB94, gradientType=0)";
	}
}

function offcell(cell){
	if (ns6) myobj = getElementById(cell)
	else myobj = eval("document.all."+cell);
	if (myobj){
		myobj.style.backgroundColor="#CEDEFA";
		myobj.style.borderColor="#CEDEFA";
		myobj.style.borderStyle="solid";
	}
}

function writecell(myhref, mycap, myid, sublevel){
	var mycen = "";
	var cls;
	if (myid.substring(0,2)=="td"||myid.substring(0,3)=="sub") cls="menutbltd";
	else if (myid.substring(0,2)=="hd") cls="menutbltdh";
	else if (myid=="hint") cls="menuhint";
	
	if (myid=="heading") document.write('<tr><td id="ignore" width="0"></td><td class="menuheading" colspan="2" id="heading" >'+mycap+'</td><td id="ignore" width="4"></td></tr>');
	else if (myid=="ignore") document.write('<tr height="8"><td id="ignore" bordercolor=#CEDEFA><p style="font-size:2">&nbsp;</p></td></tr>');
	else {
		if (sublevel){
			if (ie||op5) document.write('<tr><td id="ignore" width="0"></td><td id="ignore" width="15"></td><a href="'+myhref+'"><td class="menutbltdsub" '+mycen+' id="'+myid+'" bordercolor="#CEDEFA">'+mycap+'</td></a><td id="ignore" width="4"></td></tr>');
			else if (ns6) document.write('<tr><td id="ignore" width="0"></td><td id="ignore" width="15"></td><td class="menutbltdsub" '+mycen+' id="'+myid+'" bordercolor="#CEDEFA"><a href="'+myhref+'">'+mycap+'</a></td><td id="ignore" width="4"></td></tr>');
			else document.write('<tr height="10"><td id="ignore" width="0"></td><td id="ignore" width="15"></td><td class="menutbltdsub" '+mycen+' id="'+myid+'" bordercolor="#CEDEFA"><a class="small" href="'+myhref+'">'+mycap+'</a></td><td id="ignore" width="4"></td></tr>');}
		else {
			if (ie||op5) document.write('<tr><a href="'+myhref+'"><td id="ignore" width="0"></td><td colspan="2" class="'+cls+'" '+mycen+' id="'+myid+'" bordercolor="#CEDEFA">'+mycap+'</td></a><td id="ignore" width="4"></td></tr>');
			else if (ns6) document.write('<tr><td id="ignore" width="0"></td><td colspan="2" class="'+cls+'" '+mycen+' id="'+myid+'" bordercolor="#CEDEFA"><a href="'+myhref+'">'+mycap+'</a></td><td id="ignore" width="4"></td></tr>');
			else document.write('<tr><td id="ignore" width="0"></td><td colspan="2" class="'+cls+'" '+mycen+' id="'+myid+'" bordercolor="#CEDEFA"><a class="small" href="'+myhref+'">'+mycap+'</a></td><td id="ignore" width="4"></td></tr>');
		}	
	}
}

dbl=0;

if (ie||op5||ns6){
	document.write('<table align="center" border="0" width="992" bordercolor="#6F8ED2" cellpadding="0" cellspacing="0">');
	document.write('<tr><td width="150" valign="top">');
	document.write('<div style="background:#CEDEFA"><table id="navbar" class="menutbl" cellpadding="2" cellspacing="0" onMouseover="changeto(event)" onMouseout="changeback(event)" width="150"');
}else{
	document.write('<table align="center" border="0" width="992" bordercolor="#6F8ED2" cellpadding="0" cellspacing="0">');
	document.write('<tr><td align="center" width="150" valign="top">');
	document.write('<div style="background:#CEDEFA"><table id="navbar" border="0" width="150" cellpadding="2" cellspacing="0"');
}

	writecell("", "", "ignore", false);
	writecell(std + "/index.htm", "Home", "td1");

if (product==""){
	writecell(std + "/aladdins_el/alelabout.asp", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.asp", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.asp", "CategorieZ", "hdCO");
	writecell(std + "/aladdins_lo/alloabout.asp", "LinkZ", "hdLO");
	hdELtop=2;
	hdODtop=3;
	hdCOtop=4;
	hdLOtop=5;
	subcount=0;
	tdno=5;
}

if (product=="EL"){
	writecell("", "Envelopes & Labels", "heading");
	writecell(std + "/aladdins_el/alelabout.asp", "About", "td3",true);
	writecell(std + "/aladdins_el/alelfeatures.asp", "Features", "td4",true);
	writecell(std + "/aladdins_el/aleluserscomments.htm", "User Comments", "td5",true);
	writecell(std + "/aladdins_el/alelawards.htm", "Product Reviews", "td6",true);
	writecell(std + "/aladdins_el/alelscreenshot.htm", "Screen Shots", "td7",true);
	writecell(std + "/aladdins_el/alelfaq.htm", "FAQ", "td8",true);
	writecell(std + "/aladdins_od/alodabout.asp", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.asp", "CategorieZ", "hdCO");
	writecell(std + "/aladdins_lo/alloabout.asp", "LinkZ", "hdLO");
	hdODtop=10;
	hdCOtop=11;
	hdLOtop=12;
	dbl=1;
	tdno=12;
}
if (product=="OD"){
	writecell(std + "/aladdins_el/alelabout.asp", "Envelopes & Labels", "hdEL");
	writecell("", "Office Documents", "heading");
	writecell(std + "/aladdins_od/alodabout.asp", "About", "td4", true);
	writecell(std + "/aladdins_od/alodfeatures.asp", "Features", "td5", true);
	writecell(std + "/aladdins_od/alodbcmfeatures.asp", "BCM Features", "td6", true);
	writecell(std + "/aladdins_od/alodbcmreports.asp", "BCM Reporting", "td7", true);
	writecell(std + "/aladdins_co/alcoabout.asp", "CategorieZ", "hdCO");
	writecell(std + "/aladdins_lo/alloabout.asp", "LinkZ", "hdLO");
	hdELtop=3;
	hdCOtop=11;
	hdLOtop=12;
	tdno=12;
}

if (product=="CO"){
	writecell(std + "/aladdins_el/alelabout.asp", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.asp", "Office Documents", "hdOD");
	writecell("", "CategorieZ", "heading");
	writecell(std + "/aladdins_co/alcoabout.asp", "About", "td5", true);
	writecell(std + "/aladdins_co/alcoorganize.asp", "Organize", "td6", true);
	writecell(std + "/aladdins_co/alcodiscover.asp", "Discover", "td7", true);
	writecell(std + "/aladdins_co/alcoutilize.asp", "Utilize", "td8", true);
	writecell(std + "/aladdins_co/alcoautomate.asp", "Automate", "td9", true);
	writecell(std + "/aladdins_co/alcosync.asp", "Synchronize", "td10", true);
	writecell(std + "/aladdins_co/alcocustomize.asp", "Customize", "td11", true);
	writecell(std + "/aladdins_lo/alloabout.asp", "LinkZ", "hdLO");
	hdELtop=3;
	hdODtop=4;
	hdLOtop=12;
	tdno=12;
}

if (product=="LO"){
	writecell(std + "/aladdins_el/alelabout.asp", "Envelopes & Labels", "hdEL");
	writecell(std + "/aladdins_od/alodabout.asp", "Office Documents", "hdOD");
	writecell(std + "/aladdins_co/alcoabout.asp", "CategorieZ", "hdCL");
	writecell("", "LinkZ", "heading");
	writecell(std + "/aladdins_lo/alloabout.asp", "About", "td6", true);
	hdELtop=3;
	hdODtop=4;
	hdCOtop=5;
	tdno=7;
}

if (rank<200&&rank>99) rank=rank-100+tdno;

	writecell(std + "/publicfolders.asp", "Public Folders", "td"+tdno);
	tdno++;
	writecell(std + "/asp/download.asp", "Download Now", "td"+tdno);
	tdno++;
	writecell(std + "/asp/pricing.asp", "Pricing and Discounts", "td"+tdno);
	tdno++;
	writecell(std + "/asp/order.asp", "Purchase Now", "td"+tdno);
	tdno++;
	writecell(std + "/support.asp", "Support", "td"+tdno);
	tdno++;
	writecell(std + "/forum", "Aladdins Forum", "td"+tdno);
	tdno++;
	writecell(std + "/contact.asp", "Contact Us", "td"+tdno);
	tdno++;
//	writecell(std + "/about_us.asp", "About Us", "td"+tdno);
//	tdno++;
	if (rank<200){
		writecell(ssl + "/asp/customerwelcome.asp", "My Aladdins", "hd"+tdno);
		tdno=tdno+1;
	}

if (rank>199) {
	rank=rank-200+tdno;
	writecell("", "My Aladdins", "heading");
	writecell(ssl + "/asp/customerwelcome.asp", "Welcome", "td"+tdno, true);
	tdno++;
	writecell(ssl + "/asp/customerinfosum.asp", "My Details", "td"+tdno, true);
	tdno++;
	writecell(ssl + "/asp/subscription.asp", "Subscriptions", "td"+tdno, true);
	tdno++;
	writecell(ssl + "/asp/orderhistory.asp", "Order History", "td"+tdno, true);
	tdno++;
	writecell(ssl + "/asp/referrals.asp", "Referral Setup and Links", "td"+tdno, true);
	tdno++;
	writecell(ssl + "/asp/referralreports.asp", "Referral Reports", "td"+tdno, true);
	tdno++;
	writecell(ssl + "/asp/requestkey.asp", "Send My Registration Keys", "td"+tdno, true);
	tdno++;
	if (admin=='yes'){
		writecell("", "", "ignore", false);
		writecell(ssl + "/reports/index.asp", "Reports", "td"+tdno, true);
	}
}

writecell("", "", "ignore", false);


document.write('</table></div>');


if (ie||op5||ns6){
	document.write('<div style="background:#FFFFFF"><table id="bottable" cellpadding="0" cellspacing="0" width="150">');
}else{
	document.write('<div style="background:#FFFFFF"><table border="0" width="150" cellpadding="0" cellspacing="0">');
}


document.write('<tr><td align="center"><p style="color:green"><b>Find us @</b></p></td></tr>');
document.write('<tr><td align="center"><a href="http://office.microsoft.com/marketplace"><img src="/images/officemarket.gif" border=0 alt="Microsoft Office Marketplace logo" align="middle"></a><br><br></td></tr>');

if (product=="OD"){
	document.write('<tr><td align="center"><p style="color:green"><b>Awards</b></p></td></tr>');
	document.write('<tr><td align="center"><a href="http://www.soft82.com/download/windows/aladdins-office-documents/"><img src="/images/soft82_award_50x81.gif" border=0 alt="Free download software" align="middle"></a><br><br></td></tr>');
	document.write('<tr><td align="center"><a href="http://www.brothersoft.com/aladdins-office-documents-193163.html"><img src="http://author.brothersoft.com/softimg/star_101.gif" alt="brothersoft.com" border="0"/></a></td></tr>');
	document.write('<tr><td align="center"><a href="http://www.filetransit.com/view.php?id=79984"><img src="/images/filetransit_rate5.gif" alt="File Transit 5 Star Award" border="0"/></a></td></tr>');
}

if (product=="EL"){
	document.write('<tr><td align="center"><p style="color:green"><b>Awards</b></p></td></tr>');
	document.write('<tr><td align="center"><a href="http://www.soft82.com/download/windows/aladdins-envelopes-labels/"><img src="/images/soft82_award_50x81.gif" border="0" alt="Free download software"></a><br><br></td></tr>');
	document.write('<tr><td align="center"><a href="http://www.wugnet.com/shareware/spow.asp?ID=387"><img src="http://www.wugnet.com/shareware/images/spow.gif" alt="WUGNET Shareware Hall of Fame" border="0"/></a></td></tr>');
	document.write('<tr><td align="center"><a href="http://www.filetransit.com/view.php?id=79985"><img src="/images/filetransit_rate5.gif" alt="File Transit 5 Star Award" border="0"/></a></td></tr>');
}


document.write('</table></div>');

document.write('</td>');
document.write('<td class="blueleftright" valign="top" >');

selectcell("td"+rank);
