function waitPreloadPage()
{
	document.getElementById('prepage').style.display = 'none';
	document.getElementById('screen').style.display='';
}
function hidestatus(){
window.status='The Australian Rubus Growers Association'
return true
}
if (document.layers)
function menu_select(m1, m2)
{
	top.document.getElementById(m1).className = 'raised';
	top.document.getElementById(m2).className = 'depressed';
}
function breakout()
{
	if (window.top!=window.self) 
	{
		window.top.location="index.php"
	}
}
function login_validate_form()
{
	if(document.getElementById("username").value == "")
	{
		alert("'Login ID' required")
		document.getElementById("username").focus();
		return false;
	}
	if(document.getElementById("password").value == "")
	{
		alert("'Password' required")
		document.getElementById("password").focus();
		return false;
	}
}
function validate_password()
{
	if(document.getElementById("npassword").value == "")
	{
		alert("'New Password' required");
		document.getElementById("npassword").focus();
		return false;
	}
	if(document.getElementById("rpassword").value == "")
	{
		alert("'Re-New Password' required");
		document.getElementById("rpassword").focus();
		return false;
	}
	var dopass1 = document.getElementById("npassword").value;
	var dopass2 = document.getElementById("rpassword").value;	
	if(dopass1 != dopass2)
	{
		alert("Your 'Re-New Password' don't match");
		document.getElementById("rpassword").focus();
		return false;
	}
}
function change_password()
{
	alert("An email to the member shall be send now");
	document.getElementById("password_tbl").style.display='';
	if(document.getElementById("npassword").value)
	{
		var url = "password_manager.php?memberid=";
		var password_sent = url + document.getElementById("memberid").value + "&npassword=" + document.getElementById("npassword").value + "&email_sent=" + document.getElementById("email").value + "&name_sent=" + document.getElementById("name").value + "&user_sent=" + document.getElementById("username").value + "&sent_type=change";
		pageload(password_sent, 'password_tbl');
	}
}
function check_login(url)
{
	if(document.getElementById("username").value)
	{
		
		if(document.getElementById("password").value)
		{
			var login_id_pass=url + document.getElementById("username").value + "&password=" + document.getElementById("password").value;
			Loginload(login_id_pass, 'login_tbl');
		}
		else
		{
			login_validate_form();
		}
	}
	else
	{
		login_validate_form();
	}
}

function check_fpassword(url1)
{
	if(document.getElementById("username").value == "")
	{
		alert("'Login ID' required")
		document.getElementById("username").focus();
		return false;
	}
	else if(document.getElementById("email").value == "")
	{
		alert("'Email ID' required")
		document.getElementById("email").focus();
		return false;
	}
	else
	{
		var login_id_email=url1 + document.getElementById("username").value + "&email=" + document.getElementById("email").value;
		pageload(login_id_email, 'pass_tbl');
	}
}
function validate_email()
		{
			
			if(document.getElementById("email").value == "")
			{
				//alert("valid 'Email' required");
				//document.getElementById("email").focus();
				return false;
			}
			else
			{
				var invalidaddress=new Array()
				var testresults
				var invalidcheck=0;
				var str=document.getElementById("email").value
				var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
				if (filter.test(str))
				{
				var tempstring=str.split("@")
				tempstring=tempstring[1].split(".")
				for (i=0;i<invalidaddress.length;i++)
					{
					if (tempstring[0]==invalidaddress[i])
						invalidcheck=1
					}
					if (invalidcheck!=1)
						testresults=true
					else{
						alert("valid 'Email' required");
						document.getElementById("email").focus();
						testresults=false
					}
				}
				else{
					alert("valid 'Email' required");
					document.getElementById("email").focus();
					testresults=false;
				}
			return (testresults)
			}
}
function change_method_post()
{
	document.getElementById("displayRecs_form").method = "post";
}
function change_method()
{
	document.getElementById("displayRecs_form").method = "";
}
function fpageno_check()
{
	var v1 = document.getElementById("pageno").value;
	var v2 = document.getElementById("pageno_check").value;
	if(v1 > v2)
	{
		alert("valid 'Number' required");
		document.getElementById("displayRecs_form").reset();
		return false;
	}
}
function login_hide()
{
	document.getElementById("login_tbl").style.display='none';
}
function login_show()
{
	document.getElementById("login_tbl").style.display='';
}
function hide_box(id)
{
	document.getElementById(id).style.display='none';
}
function show_box(id)
{
	document.getElementById(id).style.display='';
}
function resize_iframe()
{
	var height=window.innerWidth;//Firefox
	if (document.body.clientHeight)
	{
		height=document.body.clientHeight;//IE
	}
	if (document.body.clientWidth)
	{
		height=document.body.clientHeight;//IE
	}
	document.getElementById("frm").style.height=parseInt(height-
	document.getElementById("frm").offsetTop-198)+"px";
}
//window.onresize=resize_iframe;
//window.onload=resize_iframe;
function copy_add()
{
	if(document.form_members.org_checkbox.checked == true)
	{
		document.getElementById("org_address").value = document.getElementById("address").value;
		document.getElementById("org_city").value = document.getElementById("city").value;
		document.getElementById("org_zip").value = document.getElementById("zip").value;
		document.getElementById("org_state").value = document.getElementById("state").value;
		document.getElementById("org_country").value = document.getElementById("country").value;																								
	}
	else
	{
		document.getElementById("org_address").value = "";
		document.getElementById("org_city").value = "";
		document.getElementById("org_zip").value = "";
		document.getElementById("org_state").value = "";
		document.getElementById("org_country").value = "";
	}
}
function ver_nav(elementObj, idRegex) {
	var arraySpans = document.body.getElementsByTagName("a");
	
	for(var i = 0; i < arraySpans.length; i++)
	{
		if(arraySpans[i].id.match(idRegex))
			{
				arraySpans[i].className = 'raised';
			}
		
	}
	elementObj.className = 'depressed';
	//left_nav();
}
function left_nav(eObj)
{
	/*document.getElementById("ver_nav1").className = 'raised';
	document.getElementById("ver_nav2").className = 'raised';
	document.getElementById("ver_nav3").className = 'raised';
	document.getElementById("ver_nav4").className = 'raised';
	document.getElementById("ver_nav5").className = 'raised';
	document.getElementById("ver_nav6").className = 'raised';
	document.getElementById("ver_nav7").className = 'raised';
	document.getElementById("ver_nav8").className = 'raised';
	document.getElementById(eObj).className = 'depressed';
	return false;*/
}
function change_style(s1, s2)
{
	document.getElementById(s1).className = 'textinput_sld';
	document.getElementById(s2).className = 'textinput';
}
/*	
var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (theAction == "over" || theAction == "click") {
        theRow.style.cursor='pointer';
    } else {
        theRow.style.cursor='default';
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    }
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    }
    if (newColor) {
        var c = null;
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } 
        }
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } 

    return true;
}
function setCheckboxes( container_id, state ) {
    var checkboxes = document.getElementById(container_id).getElementsByTagName('input');

    for ( var i = 0; i < checkboxes.length; i++ ) {
        if ( checkboxes[i].type == 'checkbox' ) {
            checkboxes[i].checked = state;
        }
    }

    return true;
}
*/


//a
var pageloadtext="<img src='../images/loading.gif' style='padding:2px; vertical-align:middle' alt='.' /> Loading..."
var xmlHttp

function pageload(str, strid)
{ 
//alert(str);
	document.getElementById(strid).innerHTML=pageloadtext;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert("browser 'AJAX' support required");
	return;
	} 
	var url=str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function()
	{
		stateChangedC(strid);
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChangedC(strid) 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById(strid).innerHTML=xmlHttp.responseText 
	} 
}

function pageload1(str1, strid1)
{ 
//alert(str);
	document.getElementById(strid1).innerHTML=pageloadtext;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert("browser 'AJAX' support required");
	return;
	} 
	var url=str1;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function()
	{
		stateChanged1C(strid1);
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged1C(strid1) 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById(strid1).innerHTML=xmlHttp.responseText;
		pageload('includes/top_menu.php?id=1', 'top_menu');
	} 
}

function Loginload(str, strid)
{ 
	document.getElementById(strid).innerHTML=pageloadtext;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert("browser 'AJAX' support required");
	return;
	} 
	var url=str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function()
	{
		LoginChangedC(strid);
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function LoginChangedC(strid) 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById(strid).innerHTML=xmlHttp.responseText;
		pageload1('includes/left_menu.php?id=2', 'left_menu');
	} 
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}


///a
//menu
	
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)
var horizontaloffset=1 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+(horizontaloffset*2) //no space to the right of page? Move menu over to the left
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


var invalidaddress=new Array()
//invalidaddress[0]="hotmail"
//invalidaddress[1]="rocketmail"
//invalidaddress[2]="yahoo"
//invalidaddress[3]="zdnetmail"

var testresults
function checkemail(){
var invalidcheck=0;
var str=document.form1.Email.value
var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str)){
var tempstring=str.split("@")
tempstring=tempstring[1].split(".")
for (i=0;i<invalidaddress.length;i++){
if (tempstring[0]==invalidaddress[i])
invalidcheck=1
}
if (invalidcheck!=1)
testresults=true
else{
alert("valid 'Email' required");
document.form1.Email.focus();
testresults=false
}
}
else{
alert("valid 'Email' required");
document.form1.Email.focus();
testresults=false;
}
return (testresults)
}

function checknumber(){
var x=document.form1.contact.value
var anum=/(^\d+$)|(^\d+\.\d+$)/
if (anum.test(x))
testresult=true
else
{
alert("Valid 'Number' required");
document.form1.contact.value = "";
testresult=false
}
return (testresult)
}

function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}

//
 function ver_row(elementObj, idRegex) {
		var arraySpans = document.body.getElementsByTagName("textarea");
		var arrayImg = document.body.getElementsByTagName("img");
		
		for(var i = 0; i < arraySpans.length; i++)
		{
		
			if(arraySpans[i].id.match(idRegex))
				{
				var arr1 = arraySpans[i].id.match(idRegex);
					var ii=0
					for (ii=0;ii<=i;ii++)
					{
						
					}
					arraySpans[i].value = ii;
				}
		}
		/*for(var i = 0; i < arrayImg.length; i++)
		{
			if(arrayImg[i].id.match(idRegexImg))
				{
					var arr2 = arraySpans[i].id.match(idRegex);
					var ii=0
					for (ii=0;ii<=i;ii++)
					{
						
					}
					arrayImg[i].scr = ii;
					alert(arrayImg[i].id)
					//alert(arrayImg[i].id)
					if(arrayImg[i].id == "1")
					{
						var upid = arrayImg[i].id;
						document.getElementById(upid).style.display = 'none';
						
					}
				}
		}*/
}


function moveR( el, x ) 
		
	{ 
   while ( el.parentNode && 'tr' != el.nodeName.toLowerCase() ){ 
     el = el.parentNode; 
   } 
   var t = el.parentNode; 
   var i = el.rowIndex + x; 


   if ( i < 0 ) i += t.rows.length; 
   if ( i == t.rows.length ) i = 0; 


   t.removeChild(el); 
   var nRow = t.insertRow( i ); 
   t.replaceChild(el, nRow); 
   ver_row(this, /ver_row/i);
   submitOrder();
//   alert(el.id)
   //	document.getElementById("save_icon").style.display = '';
//	document.getElementById("undo_icon").style.display = '';
} 

var tabdropdown={
	disappeardelay: 200, //set delay in miliseconds before menu disappears onmouseout
	disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
	enableiframeshim: 1, //1 or 0, for true or false

	//No need to edit beyond here////////////////////////
	dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, previousmenuitem:null,
	currentpageurl: window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, ""), //get current page url (minus hostname, ie: http://www.dynamicdrive.com/)

	getposOffset:function(what, offsettype){
		var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
		var parentEl=what.offsetParent;
			while (parentEl!=null){
				totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
				parentEl=parentEl.offsetParent;
			}
		return totaloffset;
	},

	showhide:function(obj, e, obj2){ //obj refers to drop down menu, obj2 refers to tab menu item mouse is currently over
		if (this.ie || this.firefox)
			this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
		if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
			if (obj2.parentNode.className.indexOf("default")==-1) //if tab isn't a default selected one
				obj2.parentNode.className="selected"
			obj.visibility="visible"
			}
		else if (e.type=="click")
			obj.visibility="hidden"
	},

	iecompattest:function(){
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	},

	clearbrowseredge:function(obj, whichedge){
		var edgeoffset=0
		if (whichedge=="rightedge"){
			var windowedge=this.ie && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15
			this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
		if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
			edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
		}
		else{
			var topedge=this.ie && !window.opera? this.standardbody.scrollTop : window.pageYOffset
			var windowedge=this.ie && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18
			this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
			if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
				edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
				if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
					edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
			}
			this.dropmenuobj.firstlink.style.borderTopWidth=(edgeoffset==0)? 0 : "1px" //Add 1px top border to menu if dropping up
		}
		return edgeoffset
	},

	dropit:function(obj, e, dropmenuID){
		if (this.dropmenuobj!=null){ //hide previous menu
			this.dropmenuobj.style.visibility="hidden" //hide menu
			if (this.previousmenuitem!=null && this.previousmenuitem!=obj){
				if (this.previousmenuitem.parentNode.className.indexOf("default")==-1) //If the tab isn't a default selected one
					this.previousmenuitem.parentNode.className=""
			}
		}
		this.clearhidemenu()
		if (this.ie||this.firefox){
			obj.onmouseout=function(){tabdropdown.delayhidemenu(obj)}
			obj.onclick=function(){return !tabdropdown.disablemenuclick} //disable main menu item link onclick?
			this.dropmenuobj=document.getElementById(dropmenuID)
			this.dropmenuobj.onmouseover=function(){tabdropdown.clearhidemenu()}
			this.dropmenuobj.onmouseout=function(e){tabdropdown.dynamichide(e, obj)}
			this.dropmenuobj.onclick=function(){tabdropdown.delayhidemenu(obj)}
			this.showhide(this.dropmenuobj.style, e, obj)
			this.dropmenuobj.x=this.getposOffset(obj, "left")
			this.dropmenuobj.y=this.getposOffset(obj, "top")
			this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
			this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
			this.previousmenuitem=obj //remember main menu item mouse moved out from (and into current menu item)
			this.positionshim() //call iframe shim function
		}
	},

	contains_firefox:function(a, b) {
		while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
		return false;
	},

	dynamichide:function(e, obj2){ //obj2 refers to tab menu item mouse is currently over
		var evtobj=window.event? window.event : e
		if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
			this.delayhidemenu(obj2)
		else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
			this.delayhidemenu(obj2)
	},

	delayhidemenu:function(obj2){
		this.delayhide=setTimeout(function(){tabdropdown.dropmenuobj.style.visibility='hidden'; if (obj2.parentNode.className.indexOf('default')==-1) obj2.parentNode.className=''},this.disappeardelay) //hide menu
	},

	clearhidemenu:function(){
		if (this.delayhide!="undefined")
			clearTimeout(this.delayhide)
	},


	positionshim:function(){ //display iframe shim function
		if (this.enableiframeshim && typeof this.shimobject!="undefined"){
			if (this.dropmenuobj.style.visibility=="visible"){
				this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
				this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
				this.shimobject.style.left=this.dropmenuobj.style.left
				this.shimobject.style.top=this.dropmenuobj.style.top
			}
		this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
		}
	},

	hideshim:function(){
		if (this.enableiframeshim && typeof this.shimobject!="undefined")
			this.shimobject.style.display='none'
	},

isSelected:function(menuurl){
	var menuurl=menuurl.replace("http://"+menuurl.hostname, "").replace(/^\//, "")
	return (tabdropdown.currentpageurl==menuurl)
},

	init:function(menuid, dselected){
		this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
		var menuitems=document.getElementById(menuid).getElementsByTagName("a")
		for (var i=0; i<menuitems.length; i++){
			if (menuitems[i].getAttribute("rel")){
				var relvalue=menuitems[i].getAttribute("rel")
				document.getElementById(relvalue).firstlink=document.getElementById(relvalue).getElementsByTagName("a")[0]
				menuitems[i].onmouseover=function(e){
					var event=typeof e!="undefined"? e : window.event
					tabdropdown.dropit(this, event, this.getAttribute("rel"))
				}
			}
			if (dselected=="auto" && typeof setalready=="undefined" && this.isSelected(menuitems[i].href)){
				menuitems[i].parentNode.className+=" selected default"
				var setalready=true
			}
			else if (parseInt(dselected)==i)
				menuitems[i].parentNode.className+=" selected default"
		}
	}
}
function setPointer(theRow, thePointerColor)
{
	var theRowid = theRow.id;
	if(theRowid != "")
		document.getElementById(theRowid).style.backgroundColor = thePointerColor;
}