

function test_choose1() {

if (is_selected( document.tableForm['remove[]'])) {
   if (this.value=='move_delete' || this.value=='move_delete_spam' || this.value=='delete_forever') {
          if (confirm('Are you sure? ('+this.value+')')) { document.tableForm.submit();
                                                         } else {
                                                                        return false;
                                                                }
                                                             } else if (this.value!='') {
                                                                        document.tableForm.submit();
                                                             }
                                                           } else {
															 this.selectedIndex=0;
                                                             alert ('Please tick at least one checkbox');
                                                             return false;
         };
}

function test_choose2() {

if (is_selected( document.tableForm['remove[]'])) {
                                                             if (this.value=='move_delete' || this.value=='move_delete_spam' || this.value=='delete_forever') {
                                                                if (confirm('Are you sure? ('+this.value+')')) {
                                                                        document.tableForm.submit();
                                                                } else {
                                                                        return false;
                                                                }
                                                             } else if (this.value!='') {
                                                                        document.tableForm.submit();
                                                             }
                                                           } else {
															 this.selectedIndex=0;
                                                             alert ('Please tick at least one checkbox');
                                                             return false;
                                                           };
}

function test_choose3() {

if (is_selected( document.tableForm['remove[]'])) {
                                                                if (confirm('Are you sure?')) {
                                                                        document.tableForm.submit();
                                                                } else {
                                                                        return false;
                                                                }
                                                           } else {
															 this.selectedIndex=0;
                                                             alert ('Please tick at least one checkbox');
                                                             return false;
                                                           };
}

function maxChars_only( ta, target) {
var max_char = 256;
//var max_line = 2;

  var number_char = ta.value.length;
//  var number_line = ta.value.split(/\r\n|\r|\n/).length;
  var exit_stan = true;

  exit_stan = ( number_char < max_char) ? exit_stan : false;
//  exit_stan = ( number_line <= max_line) ? exit_stan : false;
  if (!exit_stan) ta.value = ta.value.substr( 0, number_char-4);

  if (document.getElementById) {
		document.getElementById( target).innerHTML = "Chars: "+number_char+"<br><font color='#bb0000'>Max: "+max_char+"</font>";
  } else {
		document.all[ target].innerHTML = "Chars: "+number_char+"<br><font color='#bb0000'>Max: "+max_char+"/font>";
  }
  return true;
}


function maxChars( ta, target) {
var max_char = 256;
var max_line = 2;

  var number_char = ta.value.length;
  var number_line = ta.value.split(/\r\n|\r|\n/).length;
  var exit_stan = true;

  exit_stan = ( number_char < max_char) ? exit_stan : false;
  exit_stan = ( number_line <= max_line) ? exit_stan : false;
  if (!exit_stan) ta.value = ta.value.substr( 0, number_char-4);

  if (document.getElementById) {
		document.getElementById( target).innerHTML = "Chars: "+number_char+"<br><font color='#bb0000'>Max: "+max_char+"</font><br>Lines: "+number_line+"<br><font color='#bb0000'>Max: "+max_line+"</font>";
  } else {
		document.all[ target].innerHTML = "Chars: "+number_char+"<br><font color='#bb0000'>Max: "+max_char+"/font><br>Lines: "+number_line+"<br><font color='#bb0000'>Max: "+max_line+"</font>";
  }
  return true;
}


function ShowSmall ( do_show, nazwa) {
  if (document.getElementById) {
	if (document.getElementById(do_show) != null) document.getElementById(do_show).style.display=nazwa;
  } else {
    if (document.all[do_show] != null) document.all[do_show].style.display=nazwa;
  };
}

        var ie  = document.all;
        var dom = document.getElementById;
        var ns4 = document.layers;
		
		// hides <select> and <applet> objects (for IE only)
        function hideElement( elmID, overDiv ) {
                if(ie) {
                        for(i = 0; i < document.all.tags( elmID ).length; i++) {
                                obj = document.all.tags( elmID )[i];
                                if(!obj || !obj.offsetParent) continue;

								// Find the element's offsetTop and offsetLeft relative to the BODY tag.
                                objLeft   = obj.offsetLeft;
                                objTop    = obj.offsetTop;
                                objParent = obj.offsetParent;

                                while(objParent.tagName.toUpperCase() != 'BODY') {
                                        objLeft  += objParent.offsetLeft;
                                        objTop   += objParent.offsetTop;
                                        objParent = objParent.offsetParent;
                                }

                                objHeight = obj.offsetHeight;
                                objWidth  = obj.offsetWidth;
								
								//alert( overDiv.offsetWidth+' '+overDiv.offsetHeight);

                                if((overDiv.offsetLeft + overDiv.offsetWidth) <= objLeft);
                                else if((overDiv.offsetTop + overDiv.offsetHeight + 300) <= objTop);
                                // CHANGE by Charlie Roche for nested TDs
                                else if(overDiv.offsetTop >= (objTop + objHeight + obj.height));
                                // END CHANGE
                                else if(overDiv.offsetLeft >= (objLeft + objWidth));
                                else {
                                        obj.style.visibility = 'hidden';
                                }
                        }
                }
        }

        // unhides <select> and <applet> objects (for IE only)

        function showElement(elmID) {
                if(ie) {
                        for(i = 0; i < document.all.tags( elmID ).length; i++) {
                                obj = document.all.tags(elmID)[i];
                                if(!obj || !obj.offsetParent) continue;
                                obj.style.visibility = '';
                        }
                }
        }



startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
                    hideElement('SELECT', document.getElementById("nav"));
                    hideElement('APPLET', document.getElementById("nav"));
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
                	showElement('SELECT');
                	showElement('APPLET');
				}
			}
		}
	}
	if (typeof(imgsrc) != 'undefined') init('');
}
window.onload=startList;


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



//  - this was directly written to each td, so why not a function ;)
//  setCheckboxColumn(\'id_rows_to_delete' . $row_no . ''\');
function setCheckboxColumn(theCheckbox){
    if (document.getElementById(theCheckbox)) {
        document.getElementById(theCheckbox).checked = (document.getElementById(theCheckbox).checked ? false : true);
        if (document.getElementById(theCheckbox + 'r')) {
            document.getElementById(theCheckbox + 'r').checked = document.getElementById(theCheckbox).checked;
        }
    } else {
        if (document.getElementById(theCheckbox + 'r')) {
            document.getElementById(theCheckbox + 'r').checked = (document.getElementById(theCheckbox +'r').checked ? false : true);
            if (document.getElementById(theCheckbox)) {
                document.getElementById(theCheckbox).checked = document.getElementById(theCheckbox + 'r').checked;
            }
        }
    }
}

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;

/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   integer  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    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);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
//            newColor              = theMarkColor;
//            marked_row[theRowNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    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;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.3 Current color is the marker one
    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;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

  function is_selected( obj) {
		var is_selected=false;
		if (obj.length>0) {
            for (i = 0; i < obj.length; i++) {
                     if (obj[i].checked) {
						 is_selected = true;
					 };
            }
        } else {
                     if (obj.checked) {
						 is_selected = true;
					 };
        }
		return is_selected;
  }

  function selectAll(checkState, obj) {
        if (obj.length>0) {
            for (i = 0; i < obj.length; i++) {
                     obj[i].checked = checkState;
            }
        } else {
                     obj.checked = checkState;
        }
  }

  function selectRead(checkState, obj, objread) {
        if (obj.length>0) {
            for (i = 0; i < obj.length; i++) {
                     if (objread[i].value==checkState)
                        obj[i].checked = true;
                     else
                        obj[i].checked = false;
            }
        } else {
                     if (objread.value==checkState)
                        obj.checked = true;
                     else
                        obj.checked = false;

        }
  }

  function invert( obj) {
        if (obj.length>0) {
            for (i = 0; i < obj.length; i++) {
                     obj[i].checked = !obj[i].checked;
            }
        } else {
                     obj.checked = !obj.checked;
        }
  }

function numonly() {
 if((window.event.keyCode<48 || window.event.keyCode>57) && window.event.keyCode != 45 && window.event.keyCode != 46)
  window.event.returnValue=0;
}

function verif(keyp){
 if (navigator.appName=="Netscape") {
  if ((keyp<48||keyp>57)&&(keyp!=45)&&(keyp!=46)&&(keyp!=8)&&(keyp!=9)&&(keyp!=13)) {
       return false;
  }
 } else {
  keyp=window.event.keyCode;
  if ((keyp<48||keyp>57)&&(keyp!=45)&&(keyp!=46)&&(keyp!=8)&&(keyp!=9)&&(keyp!=13)) {
       return false;
  }
 }
}


function test_fileds() {

//if (document.search2.s_name.value!="" && document.search2.s_name.value.length<3) { 
//	alert('Real Name - at least three characters required.'); 
//	return false; 
//} else 
if (document.search2.s_company.value!="" && document.search2.s_company.value.length<3) {
	alert('Company - at least three characters required.'); 
	return false; 
} else if (document.search2.s_home.value!="" && document.search2.s_home.value.length<3) {
	alert('City - at least three characters required.'); 
	return false; 
};

if (document.search2.s_name.value == "" && document.search2.s_company.value == "" && document.search2.s_home.value=="" && document.search2.s_state.value=="" && document.search2.s_category.value=="") {
	alert('Empty fields.'); 
	return false; 
};

return true;

}

function mmLoadMenus() {
  if (window.mm_menu_0120120302_0) return;
  window.mm_menu_0120120302_0 = new Menu("root",140,16,"Verdana, Arial, Helvetica, sans-serif",10,"#1d69a1","#1d69a1","#d9e6ef","#ffffff","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0120120302_0.addMenuItem("High&nbsp;Speed&nbsp;Networking","location='highspeednetworking.php'");
  mm_menu_0120120302_0.addMenuItem("Power&nbsp;Lunch","location='powerlunch.php'");
  mm_menu_0120120302_0.addMenuItem("Shakers&nbsp;&amp;&nbsp;Stirrers","location='shakersandstirrers.php'");
  mm_menu_0120120302_0.addMenuItem("Business&nbsp;Mixer","location='businessmixer.php'");
   mm_menu_0120120302_0.fontWeight="bold";
   mm_menu_0120120302_0.hideOnMouseOut=true;
   mm_menu_0120120302_0.menuBorder=1;
   mm_menu_0120120302_0.menuLiteBgColor='#ffffff';
   mm_menu_0120120302_0.menuBorderBgColor='#9b9c9d';
   mm_menu_0120120302_0.bgColor='#bcbdbe';
    window.mm_menu_0120053448_0_1 = new Menu("Tour&nbsp;Our&nbsp;Site",171,16,"Verdana, Arial, Helvetica, sans-serif",10,"#1d69a1","#1d69a1","#d9e6ef","#ffffff","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
    mm_menu_0120053448_0_1.addMenuItem("View&nbsp;Sample&nbsp;Member&nbsp;Profile","location='viewsamplememberprofile.php'");
    mm_menu_0120053448_0_1.addMenuItem("View&nbsp;Sample&nbsp;Search&nbsp;Engine","location='viewsamplesearchengine.php'");
    mm_menu_0120053448_0_1.addMenuItem("View&nbsp;Email&nbsp;To&nbsp;Member","location='viewemailtomember.php'");
    mm_menu_0120053448_0_1.addMenuItem("View&nbsp;Sample&nbsp;Event&nbsp;List","location='viewsampleeventlist.php'");
     mm_menu_0120053448_0_1.fontWeight="bold";
     mm_menu_0120053448_0_1.hideOnMouseOut=true;
     mm_menu_0120053448_0_1.menuBorder=1;
     mm_menu_0120053448_0_1.menuLiteBgColor='#ffffff';
     mm_menu_0120053448_0_1.menuBorderBgColor='#9b9c9d';
     mm_menu_0120053448_0_1.bgColor='#bcbdbe';
  window.mm_menu_0120053448_0 = new Menu("root",144,16,"Verdana, Arial, Helvetica, sans-serif",10,"#1d69a1","#1d69a1","#d9e6ef","#ffffff","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0120053448_0.addMenuItem("Benefits&nbsp;of&nbsp;Membership","location='benefitsofmembers.php'");
  mm_menu_0120053448_0.addMenuItem("Free&nbsp;Membership&nbsp;Offer","location='freemembershipoffer.php'");
  mm_menu_0120053448_0.addMenuItem("Membership&nbsp;Rates","location='membershiprates.php'");
  mm_menu_0120053448_0.addMenuItem("What&nbsp;We're&nbsp;Not","location='whatwerenot.php'");
  mm_menu_0120053448_0.addMenuItem(mm_menu_0120053448_0_1);
   mm_menu_0120053448_0.fontWeight="bold";
   mm_menu_0120053448_0.hideOnMouseOut=true;
   mm_menu_0120053448_0.childMenuIcon="arrows.gif";
   mm_menu_0120053448_0.menuBorder=1;
   mm_menu_0120053448_0.menuLiteBgColor='#ffffff';
   mm_menu_0120053448_0.menuBorderBgColor='#9b9c9d';
   mm_menu_0120053448_0.bgColor='#bcbdbe';

  mm_menu_0120053448_0.writeMenus();
} // mmLoadMenus()

function popup(src) {
win = window.open(src,"","top=20,left=20,height=300,width=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes") }
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}

function highlite(t,state) {
    if (state==0) {
        t.removeClassName('over');
    }
    else {
        t.addClassName('over');
    }
}

sfHover = function() {
  $$('#nav>li').each(function(el){

    Event.observe(el, 'mouseover', function() {
      el.addClassName('over');
      el.addClassName('slctd'); 
    });
    Event.observe(el, 'mouseout', function() {
            el.removeClassName('over');
            el.removeClassName('slctd');
    });
  });
}

if (window.addEventListener) //DOM method for binding an event
window.addEventListener("load", sfHover, false)
else if (window.attachEvent) //IE exclusive method for binding an event
window.attachEvent("onload", sfHover)
else if (document.getElementById) //support older modern browsers
window.onload=sfHover;


    