﻿function getRefToDiv(divID,oDoc) {
	if( document.getElementById ) {
		return document.getElementById(divID); 
	}
	
	if( document.all ) {
		return document.all[divID];
	}
	
	if( !oDoc ) {
		oDoc = document;
	}
	if( document.layers ) {
		if( oDoc.layers[divID] ) {
			return oDoc.layers[divID]; 
		} else {
			//repeatedly run through all child layers
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				//on success, return that layer, else return nothing
				y = getRefToDiv(divID,oDoc.layers[x].document); 
			}
			return y; 
		} 
	}
	return false;
}
function showDiv(divID_as_a_string) {
	//get a reference as above ...
	myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) {
		window.alert('Nothing works in this browser');
		return; //don't go any further
	}
	//now we have a reference to it
	if( myReference.style ) {
		//DOM & proprietary DOM
		myReference.style.visibility = 'visible';
	} else {
		//layers syntax
		myReference.visibility = 'show';
	}
	
	document.all['PageTools_EmailPage_RequiredFieldValidator1'].enabled = true
    document.all['PageTools_EmailPage_RequiredFieldValidator2'].enabled = true
    document.all['PageTools_EmailPage_RequiredFieldValidator3'].enabled = true
    document.all['PageTools_EmailPage_RequiredFieldValidator4'].enabled = true
}
function hideDiv(divID_as_a_string) {
	//get a reference as above ...
	myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) {
		window.alert('Nothing works in this browser');
		return; //don't go any further
	}
	//now we have a reference to it
	if( myReference.style ) {
		//DOM & proprietary DOM

		myReference.style.visibility = 'hidden';
	} else {
		//layers syntax
		myReference.visibility = 'hide';
	}

	document.all['PageTools_EmailPage_RequiredFieldValidator1'].enabled = false
    document.all['PageTools_EmailPage_RequiredFieldValidator2'].enabled = false
    document.all['PageTools_EmailPage_RequiredFieldValidator3'].enabled = false
    document.all['PageTools_EmailPage_RequiredFieldValidator4'].enabled = false
		
	//window.history.go(0); //refresh the page
	//window.onerror = window.defaultOnError;
}


//Suppressing Errors
function handleError (err, url, line)
{
    //alert("err = "+ err);
    if (err.indexOf('focus') != -1 || err.indexOf('Not implemented') != -1)
      return true; // error is handled
    else
      alert('Error - ' + err);
      return false; // let the browser handle the error
}
//window.onerror = handleError;

function showengravingpopup(mytext)

{

    newwindow2=window.open('','name','height=300,width=450,resizable=yes,left=400,top=400,screenX=400,screenY=400');
	var tmp = newwindow2.document;
	tmp.write('<html><head><title>Toastmasters International - Engraving Text Details</title>');
	//tmp.write('<link rel="stylesheet" href="/Toastmasters/styles/style.css">');
	tmp.write('</head><body><p style="font-size: 12px; color: #606a74; margin: 6px 0 12px 0; padding: 0;">');
	tmp.write(mytext);
	tmp.write('</p></body></html>');
	tmp.close();


//var p=window.createPopup()

//var pbody=p.document.body

//pbody.style.backgroundColor="white"

//pbody.style.position="absolute"

//pbody.style.height="100%"

//pbody.style.width="100%"

//pbody.style.padding="5px 5px 5px 5px"

//pbody.style.font="12px arial,serif"

//pbody.style.border="solid black 1px"

//pbody.innerHTML= mytext

//p.show(((document.body.clientWidth/2)-200),((document.body.clientHeight/2)-200),400,400,document.body)

}

function hidestatus()
{

var statusmsg=""
window.status=statusmsg
return true

}


<!--
//==========================================
//DO NOT EDIT CODE BELOW
//------------------------------------------
//Generic Window Opener

function open_win (what_link, the_x, the_y, toolbar, addressbar, directories, statusbar, menubar, scrollbar, resize, history, pos, wname){ 

	var the_url	 = what_link;
	the_x		-= 0;
	the_y		-= 0;
	var how_wide = screen.availWidth;
	var how_high = screen.availHeight;
	
	if(toolbar == "0"){var the_toolbar = "no";}else{var the_toolbar = "yes";}
	if(addressbar == "0"){var the_addressbar = "no";}else{var the_addressbar = "yes";}
	if(directories == "0"){var the_directories = "no";}else{var the_directories = "yes";}
	if(statusbar == "0"){var the_statusbar = "no";}else{var the_statusbar = "yes";}
	if(menubar == "0"){var the_menubar = "no";}else{var the_menubar = "yes";}
	if(scrollbar == "0"){var the_scrollbars = "no";}else{var the_scrollbars = "yes";}
	if(resize == "0"){var the_do_resize =  "no";}else{var the_do_resize = "yes";}
	if(history == "0"){var the_copy_history = "no";}else{var the_copy_history = "yes";}
	
	//----------------
	// Window Position
	
	// Top Left
	if(pos == 1){top_pos = 0;left_pos = 0;} //Middle
	
	// Top Middle
	if(pos == 2){top_pos = 0;left_pos = (how_wide/2) -  (the_x/2);}
	
	// Top Right
	if(pos == 3){top_pos = 0;left_pos = how_wide - the_x;}
	
	// Middle Left
	if(pos == 4){top_pos = (how_high/2) -  (the_y/2);left_pos = 0;}
	
	// Middle
	if(pos == 5){top_pos = (how_high/2) -  (the_y/2);left_pos = (how_wide/2) -  (the_x/2);}
	
	// Middle Right
	if(pos == 6){top_pos = (how_high/2) -  (the_y/2);left_pos = how_wide - the_x;}
	
	// Bottom Left
	if(pos == 7){top_pos = how_high - the_y;left_pos = 0;}
	
	// Bottom Middle
	if(pos == 8){top_pos = how_high - the_y;left_pos = (how_wide/2) -  (the_x/2);}
	
	// Bottom right
	if(pos == 9){top_pos = how_high - the_y;left_pos = how_wide - the_x;}

//debugger;
	
	//-------------
	// Open Window
	if (window.outerWidth ){
		var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
		wname=window.open(the_url, wname, option);
		wname.focus();
	} else {
	
		var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
		if (!wname.closed && wname.location){
			wname.location.href=the_url;
		} else {
			wname=window.open(the_url, wname, option);
			wname.resizeTo(the_x,the_y);
		}
		wname.focus();
	
	}
	
}


