function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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+=4) { test=args[i+2]; val=MM_findObj(args[i]); fld=args[i+3];
    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 += '- '+fld+' is required.\n'; }
  } if (errors) alert('Following errors must be corrected before the form can be submitted:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function togglePageMenu(intPid, bolClose) {
	var spanObj = MM_findObj("sub"+intPid);

	var ointPid = document.intPid;

	// --- hide current load subpage menu --- //
	if ( ointPid != null ) {
		if ( ointPid != intPid ) {
			togglePageMenu(ointPid, true);
		}
	}

	// --- toggle display for the menuitems --- //
	if ( spanObj != null ) {
		if ( (spanObj.style.display == "" || spanObj.style.display == "none") && !bolClose) {
			spanObj.style.display = "block";
		} else {
			spanObj.style.display = "none";
		}	
	}

	document.intPid = intPid;
}

function captureCr(e, btn)
{
	if (!e) e = (event)?event:window.event;
	var code = (e.which)?e.which:(e.charCode)?e.charCode:e.keyCode;
	if ( code == 13 )
	{
		e.returnValue = false;
		__doPostBack(btn,'');
	}
}

function checkAll(rootName, check) {
	var rootObj = document.getElementById(rootName);
	if ( typeof(rootObj)!='undefined' ) {
		var inputFields = rootObj.getElementsByTagName('input');
		if ( inputFields.length>0 ) {
			for(i=0;i<inputFields.length-1;i++)
				if ( inputFields[i].type=='checkbox' )
					inputFields[i].checked = check;
		}
	}
}

function checkIsNumeric(e) {
	if (!e) e = (event)?event:window.event;
	var code = (e.which)?e.which:(e.charCode)?e.charCode:e.keyCode;

	if ((code>31 && (code<48 || code>57))&&code!=46) {
		alert('Enter numerals only in this field.');
		return false;
	}
}

function openwin(URL) {
	window.open(URL,"windowname","toolbar=no,location=no,directories=no,status=no,menubar=no,width=300,height=360");
}

function viewPicture(url, wth, hgt) {

	if (gImageCapableBrowser) {
		features = "width="+wth+",height="+hgt+",menubar=yes,scrollbars=no, resizable=yes, toolbar=no";

		var viewWindow = window.open(url, "_blank", features);
		return false;
	}
	else {
		return true;
	}
}

function passVmedAddressList() {
	var password = "";
	password=prompt("Enter the Password", "");
	if (password == "Vi20gi08Med")
		location.href= "DynPage.aspx?id=16629";
	else
		location.href= "DynPage.aspx?id=16645";
}



function passVmedAddressList2(id) {
	var password = "";
	//password=prompt("Enter the Password", "");
	password = document.getElementById(id).value;
	if (password == "Vi20gi08Med")
		location.href= "DynPage.aspx?id=16629";
	else
		location.href= "DynPage.aspx?id=16645";
}



function displayDiv(id)
{
	if (document.getElementById(id).style.display=="none")
	{
		document.getElementById(id).style.display="inline";
	}
	else
	{
		document.getElementById(id).style.display="none";
	}
	
}


function passAnuuMeet2(section,id,page)
{
	var password = "";
	password = document.getElementById(id).value;
	if (password == "truQ3Suh")
	{
		location.href= "DynPage.aspx?id="+page+"#"+section;	
	}
	else
	{
	    location.href = "DynPage.aspx?id=16655";
	}
}


function passPressSpeakers(section,id,page)
{
	var password = "";
	password = document.getElementById(id).value;
	if (password == "084snDwrd7")
	{
		location.href= "DynPage.aspx?id="+page+"#"+section;	
	}
	else
	{
		location.href= "DynPage.aspx?id=16655";
	}
}





function passAnnuMeet(section, page) {
	var password = "";	
	password=prompt("Enter the Password", "");
	if (password == "7002Arg30")
		location.href= "DynPage.aspx?id="+page+"#"+section;
	else
		location.href= "DynPage.aspx?id=16655";
}


function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}

gImageCapableBrowser = canManipulateImages();