/* TODO: use include statement 

*/
ItemWidth = 185; /* global to pass things, with some default initial value */
menuitem2width = 220;

barWidth=165;barHPos='left';barVPos=100; //position menubar
moveOnScroll=false;scrollSpeed=20;      // keep menu on screen??
mainWidth=55;
subWidth=85;
subPosn='left'; // dropdown position
/* end of user config area -- do not touch below this point */
/* checked with jsLint 2005 12 29 */
scrolled='document.body.scrollTop';
/* window.onresize=menuPosn; */
barTop=0;
shift=10; // mainWidth-subWidth;
subTab=0; // subtab calcs
if (subPosn=='center'){subTab=(shift-3)/2;}
if (subPosn=='right'){subTab=shift;}

function checkScrolled(){
   document.getElementById('zone').style.top=eval(scrolled)+barTop+'px';
   setTimeout('checkScrolled()',scrollSpeed);}

function show(elmnt){
   document.getElementById(elmnt).style.marginLeft=subTab+'px';
   document.getElementById(elmnt).style.visibility="visible";}

function hide(elmnt){
   document.getElementById(elmnt).style.visibility="hidden";}

function menuPosn(){
   shift=0;p=document.body.offsetWidth-barWidth-45;
   if (barHPos=='center') {shift=p/2;}
   if (barHPos=='right') {shift=p;}
   document.getElementById('zone').style.left=shift+'px';
   barTop=0;p=self.innerHeight;if(!p) {p=document.body.clientHeight;}
   if (barVPos=='middle') {barTop=p/2;}
   if (barVPos=='bottom') {barTop=p-25;}
   document.getElementById('zone').style.top=barTop+'px';}

function menuInit(){
   menuPosn();   //init positions menu 'zone', sets scrolling ptr
   x1=eval(scrolled);window.scrollBy(0,1);//test scrolled ptr
   x2=eval(scrolled);window.scrollBy(0,-1);//reset position
   if ((x2-x1)<1){scrolled='document.documentElement.scrollTop';}
   if(moveOnScroll){checkScrolled();}}

function topmenuitem(id, text, link, topwidth, width) {
	ItemWidth = width;
	document.write('<li class="cl1" style="width:');
	document.write(topwidth);
	document.write('px;" id="li1" onmouseover="show(\'');
	document.write(id);
	document.write('\')" onmouseout="hide(\'');
	document.write(id);
	document.write('\')">');
	document.write('<a class="cl1" href="');
	document.write(link);
	document.write('">');
	document.write(text);
	document.write('</a>');
	document.write('<ul class="cl2" id="');
	document.write(id);
	document.write('" onmouseover="show(\'');
	document.write(id);
	document.write('\')" onmouseout="hide(\'');
	document.write(id);
	document.write('\')">');
}

function menuitem(text, link, newwindow) {
	document.write('<li style="width:');
	document.write(ItemWidth);
	document.write('px;" class="cl2"><a class="cl2" href="');
/*
	document.write('<li class="cl2"><a class="cl2" href="');
*/
	document.write(link);
	// http://www.statsoft.co.uk/v7main.html
	document.write('"'); 
/* ----- NEW WINDOW ----- 
*/
	if (newwindow) {document.write(' TARGET="StatSoft HQ webpages"');}

	document.write('>');
	document.write(text);
	// Summary of Desktop Products
	document.write('</a></li>');
}

/* closes <ul> opened in topmenu */
function endmenu() {
   document.write('</ul></li>');
}

/* document.write('<script src="scripts/dropmenu.js" type="text/javascript"></script>'); */

/* document.write('<script src="scripts/ukmenu.js" type="text/javascript"></script>'); */
/* required functions menuitem, topmenuitem, endmenu" are in the file dropmenu.js */
function ukmenu()
{
   document.write('<div class="zone" id="zone" style="top: 60px; z-index=5;"><ul class="cl1" id="cl1">');

	topmenuitem("id1", "Home", "index.html", 83, 160);
	menuitem("Quote Request", "requestform.php?request=quote");
	menuitem("Contact StatSoft","location.html");
	menuitem("Published Reviews","http://www.statsoft.com/company/reviews/",true);
	menuitem("PDF Brochures", "brochures.php");
	menuitem("On-line Statistics Textbook","textbook/stathome.html",true);
	endmenu();

	topmenuitem("id2", "Desktop", "", 83, 180);
	menuitem("Core Analytic Modules","analytics.php");
	menuitem("Full Product Catalogue", "http://www.statsoft.com/products/statistica-product-catalog/", true);
	menuitem("Desktop Products Overview", "http://www.statsoft.com/products/desktop-solutions/");
	menuitem("Data Mining & Text Mining", "http://www.statsoft.com/products/statistica-data-miner/",true);
	menuitem("Quote Request", "requestform.php?request=quote");
	menuitem("Upgrade to Version 9", "requestform.php?request=upgrade");
	menuitem("What's New in Version 9", "Version_9_Features.pdf");
	menuitem("Academic Offers", "ukacademic.php");
	menuitem("Desktop Evaluation Request", "evaluation.php");
	endmenu();

	topmenuitem("id3", "Enterprise", "", 83, 185);
	menuitem("Enterprise Solutions","http://www.statsoft.com/products/enterprise-solutions/",true);
	menuitem("Data Mining Solutions", "http://www.statsoft.com/products/data-mining-solutions/",true);
	menuitem("Web-Based Solutions", "http://www.statsoft.com/products/web-based-solutions/",true);
	menuitem("Connectivity & Data Integration", "http://www.statsoft.com/products/connectivity-and-data-integration-solutions/",true);
	menuitem("Analytic Reporter", "http://www.statsoft.com/products/statistica-enterprise-report-generation/",true);
/*	menuitem("PROCEED", "http://proceed.statsoft.com/",true); */
	menuitem("PowerSolutions", "http://statsoftpower.com/", true);
	menuitem("Info & Quote Request", "requestform.php?request=entquote");
	endmenu();

	topmenuitem("id4", "Industries", "", 84, 190);
	menuitem("Industries/Solutions Overview","solutions.htm");
	menuitem("Automotive","Automotive.htm");
	menuitem("Banking","banking.htm");
	menuitem("Capital Equipment Manufacturing","Equipment_manufacturing.htm");
	menuitem("Chemical and Petrochemical","chemical.htm");
	menuitem("Consumer Products","consumer.htm");
	menuitem("Financial Risk Management","Financial_Risk_Management.htm");
	menuitem("Food Manufacturing","food.htm");
	menuitem("Healthcare","healthcare.htm");
	menuitem("Hedge Funds","Hedge_Fund_Applications.htm");
	menuitem("Insurance","insurance.htm");
	menuitem("Manufacturing","manufacturing.htm");
	menuitem("Marketing","marketing.htm");
	menuitem("Pharmaceuticals","pharmaceuticals.htm");
	menuitem("Power Industries","powersolutions.htm");
	menuitem("Public Administration","public_administration.htm");
	menuitem("Sarbanes-Oxley Compliance","Sarbanes_Oxley.htm");
	menuitem("Semiconductors","semiconductors.htm");
	menuitem("Six Sigma","sixsigma.htm");
	menuitem("Telecommunications","telecommunication.htm");
	menuitem("Other Applications","Application_areas.html");
	endmenu();

	topmenuitem("id5", "Services", "", 83, 135);
	menuitem("Consulting","consulting.php");
	menuitem("Training Courses","training.php");
	menuitem("Custom Development", "customapp.php");
	menuitem("Validation Services", "validation.php");
	endmenu();

	topmenuitem("id6", "Support", "", 83, 175);
	menuitem("Technical Support Request","requestform.php?request=support");
	menuitem("Training Courses","training.php");
	menuitem("Consulting &amp; Programming","consulting.php");
	menuitem("Free Software Updates","updates.php");
	menuitem("User/Product Registration","https://registration.statsoft.com/",true);
	menuitem("On-line Statistics Textbook","http://www.statsoft.co.uk/textbook/stathome.html");
	menuitem("Forum", "http://www.statsoft.com/support/forum/",true);
	endmenu();

	topmenuitem("id7", "Downloads", "", 83, 145);
	menuitem("STATISTICA Trial", "evaluation.php")
	menuitem("Maintenance Downloads","download_uk.html");
	menuitem("PDF Brochures", "brochures.php");
	menuitem("Video Tutorials", "http://www.statsoft.com/downloads/movies/interactivedemos.html",true);
	menuitem("White Papers", "http://www.statsoft.com/support/whitepapers/whitepapers.html",true);
	menuitem("SVB Macro Library", "http://www.statsoft.com/downloads/maintenance/svbprograms.html",true);
	endmenu();

	topmenuitem("id8", "References", "", 83, 165);
	menuitem("Published Reviews","reviews.html");
	menuitem("UK Customers","users.html");
	menuitem("Customer Successes","http://www.statsoft.com/company/success_stories/success_stories.html",true);
	menuitem("Benchmarks","http://www.statsoft.com/company/benchmk.html",true);
	menuitem("User Feedback","http://www.statsoft.com/company/customers/feedback.html",true);
	menuitem("Ease of Use","http://www.statsoft.com/company/customers/ease.html",true);
	endmenu();

	topmenuitem("id9", "Company", "index.html", 83, 150);
	menuitem("About StatSoft Ltd.","about_statsoftltd.php");
	menuitem("Where StatSoft Delivers","statsoft_delivers.php");
	menuitem("Contact & Location","location.html");
	menuitem("Events","events.php");
	menuitem("Job Opportunities","jobs.html");
	menuitem("StatSoft Inc.","http://www.statsoft.com/",true);
	menuitem("StatSoft Worldwide","http://www.statsoft.com/company/regions.html",true);
	endmenu();

/*
	topmenuitem("idx", "menutext", "menulink");
	menuitem("itemtext1","itemlink1");
	menuitem("itemtext2","itemlink2");
	...
	endmenu();
*/

	document.write('</ul></div>');
}
/* AND NOW DO IT ! OUTPUT THE MENU ! */
ukmenu();
/* document.write('<script src="scripts/writemenu.js" type="text/javascript"></script>'); */

