/* --- menu items --- */
var MENU_ITEMS = [
	['Home', './index.html'],
	['Pumps', null,
			['Autoprime', './autoprime.html'],
			['Column Sump', './column.html'],
			['Dinbloc', './dinbloc.html'],
			['Dinflow', './dinflow.html'],
			['Fire Fighting', './firefighting.html'],
			['Linebloc', './linebloc.html'],
			['Minor, Super, Majorflow', './msmflow.html'],
			['Split Case, Dbl Suction', './SCDSuction.html'],
			['Terada/Serapura Trash', './teradaS.html'],
			['Terada "O" Series', './teradaO.html'],
			['Vortex Impeller', './vortex.html'],
	],
	['Services', null,
		['Design & Consultation', './consultation.html'],
		['Maintenace & Repair', './repair.html'],
		['Spare Parts', './spareparts.html'],
		['Testing', './testing.html'],
	],
	['Contact', null,
			['BH: 03 9551 5111', null],
			['FX: 03 9551 7217', null],
			['email: (click here)', 'mailto:esales@regentpumps.com.au?subject=I require information please&body=Dear Sirs,\12\13\13Please send by reply email product and pricing information for a pump that can _____[ Insert details ]_____.\12\13\13Please phone me to discuss - my number is __________. \12\13\13Other information about my special requirements are listed below....\12\13\13\13\13\13\13The number of pumps I require is ____\12\13\13Thank You,\12\13\13__________\12\13[My Name]'],
			['Full Contact Details', './contact.html'],
	],
];
/* ---	['Drain & Sewer Cleaning', null,
			['Renegade & Municipal', './renegademunicipal.html'],
			['Rogue & Restorer', './RogueRestorer.html'],
			['Rustler', './rustler.html'],
			['Accessories', null,
				['Nozzles', './Nozzles.html'],
				['Sewer Hoses', './SewerHoses.html'],
				['Rootcutters', './RootCutters.html'],
				['Warthog', './Warthog.html'],
			],
	], 
--- */

/* --- geometry and timing of the menu --- */
var MENU_POS1 = new Array();
	// item sizes for different levels of menu
	MENU_POS1['height'] = [18, 17, 17];
	MENU_POS1['width'] = [138, 138, 138];
	// menu block offset from the origin:
	//	for root level origin is upper left corner of the page
	//	for other levels origin is upper left corner of parent item
	MENU_POS1['block_top'] = [125, 19, 0];
	MENU_POS1['block_left'] = [86, 0, 138];
	// offsets between items of the same level
	MENU_POS1['top'] = [0, 17, 17];
	MENU_POS1['left'] = [140, 0, 0];
	// time in milliseconds before menu is hidden after cursor has gone out
	// of any items
	MENU_POS1['hide_delay'] = [800, 800, 800];
	
/* --- dynamic menu styles ---
note: you can add as many style properties as you wish but be not all browsers
are able to render them correctly. The only relatively safe properties are
'color' and 'background'.
*/
var MENU_STYLES1 = new Array();
	// default item state when it is visible but doesn't have mouse over
	MENU_STYLES1['onmouseout'] = [
		'color', ['#ffffff', '#ffffff', '#ffffff'], 
		'background', ['#00679f', '#0087cf', '#00a7ff'],
		'fontWeight', ['normal', 'normal', 'normal'],
		'textDecoration', ['none', 'none', 'none'],
	];
	// state when item has mouse over it
	MENU_STYLES1['onmouseover'] = [
		'color', ['#10dfff', '#303030', '#505050'], 
		'background', ['#007fbf', '#009fdf', '#00bfff'],
		'fontWeight', ['bold', 'bold', 'bold'],
		'textDecoration', ['none', 'none', 'none'],
	];
	// state when mouse button has been pressed on the item
	MENU_STYLES1['onmousedown'] = [
		'color', ['#33ffff', '#33ffff', '#33ffff'], 
		'background', ['#6699cc', '#6699cc', '#6699cc'],
		'fontWeight', ['normal', 'normal', 'normal'],
		'textDecoration', ['none', 'none', 'none'],
	];

// Title: tigra menu
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_menu/
// Version: 1.0
// Date: 01-09-2002 (mm-dd-yyyy)
// Author: Denis Gritcyuk <denis@softcomplex.com>
// Notes: Registration needed to use this script on your web site.
// 	Registration for this version (1.0) is free of charge.
//	See official site for details
// Got questions - visit forum http://www.softcomplex.com/products/tigra_menu/forum/

var menus = [];

// --- menu class ---
function menu (item_struct, pos, styles) {
	// browser check
	this.item_struct = item_struct;
	this.pos = pos;
	this.styles = styles;
	this.id = menus.length;
	this.items = [];
	this.children = [];
	
	this.add_item = menu_add_item;
	this.hide = menu_hide;
	
	this.onclick = menu_onclick;
	this.onmouseout = menu_onmouseout;
	this.onmouseover = menu_onmouseover;
	this.onmousedown = menu_onmousedown;
	
	var i;
	for (i = 0; i < this.item_struct.length; i++)
		new menu_item(i, this, this);
	for (i = 0; i < this.children.length; i++)
		this.children[i].visibility(true);
	menus[this.id] = this;
}
function menu_add_item (item) {
	var id = this.items.length;
	this.items[id] = item;
	return (id);
}
function menu_hide () {
	for (var i = 0; i < this.items.length; i++) {
		this.items[i].visibility(false);
		this.items[i].switch_style('onmouseout');
	}
}
function menu_onclick (id) {
	var item = this.items[id];
	return (item.fields[1] ? true : false);
}
function menu_onmouseout (id) {
	this.hide_timer = setTimeout('menus['+ this.id +'].hide();',
		this.pos['hide_delay'][this.active_item.depth]);
	if (this.active_item.id == id)
		this.active_item = null;
}
function menu_onmouseover (id) {
	this.active_item = this.items[id];
	clearTimeout(this.hide_timer);
	var curr_item, visib;
	for (var i = 0; i < this.items.length; i++) {
		curr_item = this.items[i];
		visib = (curr_item.arrpath.slice(0, curr_item.depth).join('_') ==
			this.active_item.arrpath.slice(0, curr_item.depth).join('_'));
		if (visib)
			curr_item.switch_style (
				curr_item == this.active_item ? 'onmouseover' : 'onmouseout');
		curr_item.visibility(visib);
	}
}
function menu_onmousedown (id) {
	this.items[id].switch_style('onmousedown');
}
// --- menu item Class ---
function menu_item (path, parent, container) {
	this.path = new String (path);
	this.parent = parent;
	this.container = container;
	this.arrpath = this.path.split('_');
	this.depth = this.arrpath.length - 1;
	// get pointer to item's data in the structure
	var struct_path = '', i;
	for (i = 0; i <= this.depth; i++)
		struct_path += '[' + (Number(this.arrpath[i]) + (i ? 2 : 0)) + ']';
	eval('this.fields = this.container.item_struct' + struct_path);
	if (!this.fields) return;
	
	// assign methods	
	this.get_x = mitem_get_x;
	this.get_y = mitem_get_y;
	// these methods may be different for different browsers (i.e. non DOM compatible)
	this.init = mitem_init;
	this.visibility = mitem_visibility;
	this.switch_style = mitem_switch_style;
	
	// register in the collections
	this.id = this.container.add_item(this);
	parent.children[parent.children.length] = this;
	
	// init recursively
	this.init();
	this.children = [];
	var child_count = this.fields.length - 2;
	for (i = 0; i < child_count; i++)
		new menu_item (this.path + '_' + i, this, this.container);
	this.switch_style('onmouseout');
}
function mitem_init() {
	document.write (
		'<a id="mi_' + this.container.id + '_'
			+ this.id +'" class="m' + this.container.id + 'l' + this.depth 
			+'o" href="' + this.fields[1] + '" style="position: absolute; top: '
			+ this.get_y() + 'px; left: '	+ this.get_x() + 'px; width: '
			+ this.container.pos['width'][this.depth] + 'px; height: '
			+ this.container.pos['height'][this.depth] + 'px; visibility: hidden;'
			+' background: black; color: white; z-index: ' + this.depth + ';" '
			+ 'onclick="return menus[' + this.container.id + '].onclick('
			+ this.id + ');" onmouseout="menus[' + this.container.id + '].onmouseout('
			+ this.id + ');" onmouseover="menus[' + this.container.id + '].onmouseover('
			+ this.id + ');" onmousedown="menus[' + this.container.id + '].onmousedown('
			+ this.id + ');"><div class="m'  + this.container.id + 'l' + this.depth + 'i">'
			+ this.fields[0] + "</div></a>\n"
		);
	this.element = document.getElementById('mi_' + this.container.id + '_' + this.id);
}
function mitem_visibility(make_visible) {
	if (make_visible != null) {
		if (this.visible == make_visible) return;
		this.visible = make_visible;
		if (make_visible)
			this.element.style.visibility = 'visible';
		else if (this.depth)
			this.element.style.visibility = 'hidden';
	}
	return (this.visible);
}
function mitem_get_x() {
	var value = 0;
	for (var i = 0; i <= this.depth; i++)
		value += this.container.pos['block_left'][i]
		+ this.arrpath[i] * this.container.pos['left'][i];
	return (value);
}
function mitem_get_y() {
	var value = 0;
	for (var i = 0; i <= this.depth; i++)
		value += this.container.pos['block_top'][i]
		+ this.arrpath[i] * this.container.pos['top'][i];
	return (value);
}
function mitem_switch_style(state) {
	if (this.state == state) return;
	this.state = state;
	var style = this.container.styles[state];
	for (var i = 0; i < style.length; i += 2)
		if (style[i] && style[i+1])
			eval('this.element.style.' + style[i] + "='" 
			+ style[i+1][this.depth] + "';");
}
// that's all folks

monthNames = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
dayNames = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");

function msin() {
    window.event.srcElement.style.color = "yellow";
}
function msinmain() {
    window.event.srcElement.style.color = "darkorange";
}
function msex() {
    window.event.srcElement.style.color = "blue";
}
function getLongDateString()
{	//method defined on class Date.
	//Returns a date string of the form: Day DD Month,YYYY
	//(e.g. Sunday 27 September, 1998)
	dayOfWeek = this.getDay();
	day = dayNames[dayOfWeek];
	dateOfMonth = this.getDate();
	monthNo = this.getMonth();
	month = monthNames[monthNo];
	year = this.getYear();
	if (year < 2000) year = year + 1900;
	dateStr = "Updated: "+day+" "+dateOfMonth+" "+month+", "+year+" ";
	localHours = this.getHours();
	localMinutes = this.getMinutes();
	localSeconds = this.getSeconds();
	if(localHours.toString().length == 1) {	dateStr += '0';}
	dateStr += localHours.toString() + ':';
	if(localMinutes.toString().length == 1) {dateStr += '0';}
	dateStr += localMinutes.toString() + ':';
	if(localSeconds.toString().length == 1) {dateStr += '0';}
	dateStr += localSeconds.toString();
	return dateStr;
}

empart1='Dear Sirs,\12\13\13Please send by reply email/phone me/fax to me product and pricing information for '
empart2=' these specifications...\12\13\13Head (metres)\:\12\13Flow Rate (Litres/Sec)\:\12\13Fluid\:\12\13Preferred power (Petrol/diesel/electric)\:\12\13Operating Environment\:\12\13Pump Application\:\12\13Special requirements\:\12\13\13\13\13\13\13\13\13My contact details...\12\13\13Name\:\12\13Company\:\12\13Phone\:\12\13Fax\:\12\13\13\13Thank You,\12\13\13__________\12\13'
empart3='\12\13\13My contact details...\12\13\13Name\:\12\13Company\:\12\13Phone\:\12\13Fax\:\12\13\13\13Thank You,\12\13\13__________\12\13'
embody1=empart1+'a pump that has'+empart2
embody2=empart1+'an Autoprime pump that has'+empart2
embody3=empart1+'a Column pump that has'+empart2
embody4=empart1+'a dinbloc pump that has'+empart2
embody5=empart1+'a linebloc pump that has'+empart2
embody6=empart1+'a dinflow pump that has'+empart2
embody7=empart1+'a Split Case pump that has'+empart2
embody8=empart1+'Minor and Superflow pumps that have'+empart2
embody9=empart1+'a Minorflow In-Line pump that has'+empart2
embody10=empart1+'a Majorflow pump that has'+empart2
embody11=empart1+'a Terada O pump that has'+empart2
embody12=empart1+'a Terada CO pump that has'+empart2
embody13=empart1+'a Terada/Serapura Trash pump that has'+empart2
embody14=empart1+'a Vortex Impeller pump that has'+empart2
embody15=empart1+'a product that has'+empart2
//embody16='Dear Sirs,\12\13\13Please send by reply email/fax to me the list of surplus items being disposed.\12\13\13\13My contact details...\12\13\13Name\:\12\13Company\:\12\13Phone\:\12\13Fax\:\12\13\13\13Thank You,\12\13\13__________\12\13'
embody16=empart1+'a fire fighting pump that has'+empart2
//embody17=empart1+'the Renegade/Municipal units.'+empart3
//embody18=empart1+'the Rogue/Restorer units.'+empart3
//embody19=empart1+'the Rustler units.'+empart3
//embody20=empart1+'the range of nozzles you supply.'+empart3
//embody21=empart1+'the range of sewer hoses you supply.'+empart3
//embody22=empart1+'the range of root cutters you supply.'+empart3
//embody23=empart1+'the WARTHOG range of products.'+empart3
//em("esales","Packaged Fire Protection Systems","17","Regent Pumps by email")
function em(emn,subj,bodynbr,linktext)	{
	if (subj == '' || subj == null) {subj = "Information request";}
	if (bodynbr == '' || bodynbr == null) {bodynbr = "1";}
	if (linktext == '' || linktext == null) {linktext = "Click here to create an email that you can edit before sending.";}
	if (bodynbr == "1") {embody = embody1;}
	if (bodynbr == "2") {embody = embody2;}
	if (bodynbr == "3") {embody = embody3;}
	if (bodynbr == "4") {embody = embody4;}
	if (bodynbr == "5") {embody = embody5;}
	if (bodynbr == "6") {embody = embody6;}
	if (bodynbr == "7") {embody = embody7;}
	if (bodynbr == "8") {embody = embody8;}
	if (bodynbr == "9") {embody = embody9;}
	if (bodynbr == "10") {embody = embody10;}
	if (bodynbr == "11") {embody = embody11;}
	if (bodynbr == "12") {embody = embody12;}
	if (bodynbr == "13") {embody = embody13;}
	if (bodynbr == "14") {embody = embody14;}
	if (bodynbr == "15") {embody = embody15;}
	if (bodynbr == "16") {embody = embody16;}
//	if (bodynbr == "17") {embody = embody17;}
//	if (bodynbr == "18") {embody = embody18;}
//	if (bodynbr == "19") {embody = embody19;}
//	if (bodynbr == "20") {embody = embody20;}
//	if (bodynbr == "21") {embody = embody21;}
//	if (bodynbr == "22") {embody = embody22;}
//	if (bodynbr == "23") {embody = embody23;}
	emstr="<a href='mailto:"+emn+"@regentpumps.com.au?subject="+subj+"&body="+embody+"'>"+linktext+"</a>";
	return emstr;
}
function emi(emn,subj,bodynbr,linkimg,imgwidth,imgheight,imgalt)	{
	if (subj == '' || subj == null) {subj = "Information request";}
	if (bodynbr == '' || bodynbr == null) {bodynbr = "1";}
	if (imgwidth == '' || imgwidth == null) {imgwidth = "700";}
	if (imgheight == '' || imgheight == null) {imgheight = "*";}
	if (imgalt == '' || imgalt == null) {imgalt = "Click here to create an email that you can edit before sending.";}
	if (bodynbr == "1") {embody = embody1;}
	if (bodynbr == "2") {embody = embody2;}
	if (bodynbr == "3") {embody = embody3;}
	if (bodynbr == "4") {embody = embody4;}
	if (bodynbr == "5") {embody = embody5;}
	if (bodynbr == "6") {embody = embody6;}
	if (bodynbr == "7") {embody = embody7;}
	if (bodynbr == "8") {embody = embody8;}
	if (bodynbr == "9") {embody = embody9;}
	if (bodynbr == "10") {embody = embody10;}
	if (bodynbr == "11") {embody = embody11;}
	if (bodynbr == "12") {embody = embody12;}
	if (bodynbr == "13") {embody = embody13;}
	if (bodynbr == "14") {embody = embody14;}
	if (bodynbr == "15") {embody = embody15;}
	if (bodynbr == "16") {embody = embody16;}
//	if (bodynbr == "17") {embody = embody17;}
//	if (bodynbr == "18") {embody = embody18;}
//	if (bodynbr == "19") {embody = embody19;}
//	if (bodynbr == "20") {embody = embody20;}
//	if (bodynbr == "21") {embody = embody21;}
//	if (bodynbr == "22") {embody = embody22;}
//	if (bodynbr == "23") {embody = embody23;}
	emstr="<a href='mailto:"+emn+"@regentpumps.com.au?subject="+subj+"&body="+embody+"'><img src='"+linkimg+"' width='"+imgwidth+"' height='"+imgheight+"' border=0 align='left' alt='"+imgalt+"'></a>";
	return emstr;
}
//function emrl(emn,subj,bodynbr,linktext)	{
//	emstr="<a href='mailto:"+emn+"@roblaine.com?subject="+subj+"&body="+embody17+"'>"+linktext+"</a>";
//	return emstr;
//}

//register the  method in the class Date
Date.prototype.getLongDateString=getLongDateString;

function DocDate()
{ //return the document modification date (excl.time)
//as a string
	DateTimeStr = document.lastModified;
	secOffset = Date.parse(DateTimeStr);
	if (secOffset == 0 || secOffset == null) //Opera3.2
		dateStr = "Updated: Unknown";
	else
	{
		aDate = new Date();
		aDate.setTime(secOffset);
		//use method defined above
		datestr = aDate.getLongDateString();
	}
	return dateStr;
}

netscape = (navigator.appName == "Netscape");
n4 = netscape && (parseInt(navigator.appVersion) >= 4);
explorer = (navigator.appName == "Microsoft Internet Explorer");
ie4 = explorer && (parseInt(navigator.appVersion) >= 4);

function shake(n) {
	if (n4 || ie4) {
		for (i = 20; i > 16; i--) {
			for (j = n; j > 0; j--) {
				self.moveBy(0,i);
				self.moveBy(i,0);
				self.moveBy(0,-i);
				self.moveBy(-i,0);
         }
      }
   }
}
