// ---- DISPLAY FLASH ----- //

	function displayFlash(path,w,h,img,link,id,bgcolor) {
		if(siteversion != "html"){
			document.write('<object width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="movie" value="'+path+'" /><param name="wmode" value="transparent" /><embed src="'+path+'" wmode="transparent" width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');
		}else{
			if(img != ""){
				if(link != ""){
					document.write('<a href="'+link+'"><img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" /></a>');
				}else{
					document.write('<img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" />');
				}
			}
		}
	}
	function displayFlashMini(path,w,h,img,link,id,bgcolor) {
		if(siteversion != "html"){
			document.write('<span class="speaker_pic_home"><object width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="movie" value="'+path+'" /><param name="wmode" value="transparent" /><param name="scale" value="exactfit" /><param name="valign" value="lt" /><embed scale="exactfit" align="top" src="'+path+'" wmode="transparent" width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object></span>');
		}else{
			if(img != ""){
				if(link != ""){
					document.write('<a href="'+link+'"><img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" class="speaker_pic_home" /></a>');
				}else{
					document.write('<img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" class="speaker_pic_home" />');
				}
			}
		}
	}
	
		function displayPostIt(path,w,h,img,link,id,bgcolor) {
		if(siteversion != "html"){
			document.write('<object width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,29,0" id=ShockwaveFlash1><param name="movie" value="'+path+'" /><param name="wmode" value="transparent" /><embed src="'+path+'" wmode="transparent" width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');
		}else{
			if(img != ""){
				if(link != ""){
					document.write('<a href="'+link+'"><img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" /></a>');
				}else{
					document.write('<img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" />');
				}
			}
		}
	}


	function displayFlashViewAll(path,w,h,img,link,id,bgcolor) {
		if(siteversion != "html"){
			document.write('<object width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="movie" value="'+path+'" /><param name="wmode" value="transparent" /><embed src="'+path+'" wmode="transparent" width='+w+' height='+h+' id="'+id+'" bgcolor="'+bgcolor+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');
		}else{
			if(img != ""){
				if(link != ""){
					document.write('<a href="'+link+'"><img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" /></a>');
				}else{
					document.write('<img src="' + img + '" width="'+w+'" height="'+h+'" id="'+id+'" />');
				}
			}
		}
	}	
	
/* ------------------------------------------------------------- 
   Send to a Friend  ------------------------------------------ */
   
   
   function openSend(path_query_url){	
		document.getElementById("popin").style.display = "block";
		positionneDiv("popin",740,470);   
   
		if(siteversion != "html"){
			document.getElementById("popin").innerHTML = '<object width="740" height="470" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="wmode" value="transparent" /><param name="movie" value="/4105/flash/send.swf?path_query_url='+path_query_url+'" /><embed src="/4105/flash/send.swf?path_query_url='+path_query_url+'" wmode="transparent" width="740" height="470" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
		}else{
			//document.getElementById("popin").innerHTML = '<a href="javascript:closePopin();"><img src="' + img + '" width="375" height="521" /></a>';
		}
   }
   
   function closeSend(){
		document.getElementById("popin").style.display = "none";
   }
   
   function openSent(){
		document.getElementById("popin").style.display = "block";
		positionneDiv("popin",740,470);		
   
		if(siteversion != "html"){
			document.getElementById("popin").innerHTML = '<object width="740" height="470" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="wmode" value="transparent" /><param name="movie" value="/4105/flash/sent.swf" /><embed src="/4105/flash/sent.swf" wmode="transparent" width="740" height="470" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
		}else{
			//document.getElementById("popin").innerHTML = '<a href="javascript:closePopin();"><img src="' + img + '" width="375" height="521" /></a>';
		}
   }
   
   


/* ------------------------------------------------------------- 
   Sign Up  ------------------------------------------ */
   
   
   function openSignup(page){
		document.getElementById("popin").style.display = "block";
		positionneDiv("popin",740,619);
		
		if(siteversion != "html"){
			document.getElementById("popin").innerHTML = '<object width="740" height="619" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="wmode" value="transparent" /><param name="movie" value="/4105/flash/signup.swf?page='+page+'" /><embed src="/4105/flash/signup.swf?page='+page+'" wmode="transparent" width="740" height="619" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
		}else{
			document.getElementById("b_signup").style.display = "none";
			myForm = "";
			myForm = myForm + "<form id='signup' method='get' action='javascript:validate_signup();'>";
			myForm = myForm + "	<fieldset>";
			myForm = myForm + "		<table cellspacing='0' cellpadding='0'>";
			myForm = myForm + "			<tr>";
			myForm = myForm + "				<td>";
			myForm = myForm + "				<label for='email' id='t_email'>Email Address</label>";
			myForm = myForm + "				<input type='text' id='email' name='email' value='' maxlength='50' tabindex='1' /><br />";

			myForm = myForm + "				<label for='firstname' id='t_firstname'>First Name</label>";
			myForm = myForm + "				<input type='text' id='firstname' name='firstname' value='' maxlength='50' tabindex='2' /><br />";

			myForm = myForm + "				<label for='lastname' id='t_lastname'>Last Name</label>";
			myForm = myForm + "				<input type='text' id='lastname' name='lastname' value='' maxlength='50' tabindex='3' /><br />";
			
			myForm = myForm + "				<label for='country' id='t_country'>Country</label>";
			myForm = myForm + "				<input type='text' id='country' name='country' value='' maxlength='50' tabindex='4' /><br />";
		
			myForm = myForm + "				<label for='province' id='t_province'>Province</label>";
			myForm = myForm + "				<input type='text' id='province' name='province' value='' maxlength='50' tabindex='5' /><br />";
			myForm = myForm + "				</td>";
		
			myForm = myForm + "				<input type='hidden' id='page' name='page' value='"+page+"' maxlength='50' />";
			
			myForm = myForm + "				<td style='padding-left:20px;padding-top: 13px;'>";
			myForm = myForm + "				<input type='checkbox' id='optin' name='optin' class='nobox' tabindex='6' style='display:inline;' /><label for='optin' id='t_optin' style='display:inline;'>I agree to receive future email communications from The Power Within.</label>";			myForm = myForm + "				<br /><br /><b>Preferred email format</b><br />";
			myForm = myForm + "				<input type='radio' id='html' name='emailformat' value='html' checked='checked' class='nobox' style='display:inline;' tabindex='7' />";
			myForm = myForm + "				<label for='html' style='display:inline;'>HTML</label>";
						
			myForm = myForm + "				<input type='radio' id='txt' name='emailformat' value='txt' class='nobox' style='display:inline;' tabindex='8' />";
			myForm = myForm + "					<label for='txt' style='display:inline;'>Plain Text</label>";
								
			myForm = myForm + "				<br /><br />";
			myForm = myForm + "				<input type='image' class='nobox' src='images/b_signup.gif' id='b_signup1' style='width:72px;height:22px;' alt='Sign-up' title='Sign-Up' />";
							
			myForm = myForm + "				<p id='validate_signup'>Please fill or correct all the fields in <span class='error'>red</span> before sending.</p>";
			myForm = myForm + "				</td>";
			myForm = myForm + "			</tr>";
			myForm = myForm + "		</table>";
			myForm = myForm + "	</fieldset>";
			myForm = myForm + "</form>";
			document.getElementById("signup_form").innerHTML = myForm;
		}
   }
   
   function openSentSignup(){
		document.getElementById("popin").style.display = "block";
		positionneDiv("popin",740,619);
   
		if(siteversion != "html"){
			document.getElementById("popin").innerHTML = '<object width="740" height="619" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="wmode" value="transparent" /><param name="movie" value="/4105/flash/signup_sent.swf" /><embed src="/4105/flash/signup_sent.swf" wmode="transparent" width="740" height="619" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
		}else{
			document.getElementById("signup_form").innerHTML = '<br />Thank You, You will recieve a confirmation email soon.';
		}
   }
   
   
   
   function validate_signup(){
			Goon = "0";
			var msg = "";
			if(document.getElementById("firstname").value == ""){ Goon = "1"; document.getElementById("t_firstname").className="error"; }else{ document.getElementById("t_firstname").className="text";}
			if(document.getElementById("lastname").value == ""){ Goon = "1"; document.getElementById("t_lastname").className="error"; }else{ document.getElementById("t_lastname").className="text";}
			if(document.getElementById("country").value == ""){ Goon = "1"; document.getElementById("t_country").className="error"; }else{ document.getElementById("t_country").className="text";}
			if(document.getElementById("province").value == ""){ Goon = "1"; document.getElementById("t_province").className="error"; }else{ document.getElementById("t_province").className="text";}
			
			if(document.getElementById("optin").checked == false){ Goon = "1"; document.getElementById("t_optin").className="error"; }else{ document.getElementById("t_optin").className="text";}
			if(!checkEmail(document.getElementById("email").value)){ Goon = "1"; document.getElementById("t_email").className="error";	}else{ document.getElementById("t_email").className="text";}
			
			if(Goon == "0")	{
				document.getElementById("signup").method= "post";
				document.getElementById("signup").action = "db_signup.asp";
				document.getElementById("signup").submit();	
			}else{	
				document.getElementById("validate_signup").style.display = "block";
				document.getElementById("validate_signup").style.visibility = "visible";
			}
   }

/* ------------------------------------------------------------- 
   Thank You  -------------------------------------------------- */
   
   
   function openThankYou(type,email){
		document.getElementById("popin").style.display = "block";
		positionneDiv("popin",740,450);  
		
		if(siteversion != "html"){
			if(type=="poll"){
				document.getElementById("popin").innerHTML = '<object width="740" height="450" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="wmode" value="transparent" /><param name="movie" value="/4105/flash/thankyou.swf?txt=We appreciate your response to the Power Within Poll.&amp;email='+email+'" /><embed src="/4105/flash/thankyou.swf?txt=We appreciate your response to the Power Within Power Poll.&amp;email='+email+'" wmode="transparent" width="740" height="450" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
			}else{
				document.getElementById("popin").innerHTML = '<object width="740" height="450" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=ShockwaveFlash1><param name="wmode" value="transparent" /><param name="movie" value="/4105/flash/thankyou.swf?txt=We appreciate your opinion on the Power Within eNewsletter.&amp;email='+email+'" /><embed src="/4105/flash/thankyou.swf?txt=We appreciate your opinion on the Power Within eNewsletter.&amp;email='+email+'" wmode="transparent" width="740" height="450" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
			}
		}else{
			//document.getElementById("popin").innerHTML = '<a href="javascript:closePopin();"><img src="' + img + '" width="375" height="521" /></a>';
		}
   }
   

/* ------------------------------------------------------------- 
   Contact Form  ------------------------------------------ */
   
   function validate_contact(){
			Goon = "0";
			var msg = "";
			if(document.getElementById("firstname").value == ""){ Goon = "1"; document.getElementById("t_firstname").className="error"; }else{ document.getElementById("t_firstname").className="text";}
			if(document.getElementById("lastname").value == ""){ Goon = "1"; document.getElementById("t_lastname").className="error"; }else{ document.getElementById("t_lastname").className="text";}
			if(!checkEmail(document.getElementById("email").value)){ Goon = "1"; document.getElementById("t_email").className="error";	}else{ document.getElementById("t_email").className="text";}
			
			if(Goon == "0")	{
				document.getElementById("contact_us").method= "post";
				document.getElementById("contact_us").action = "send_contact.asp";
				document.getElementById("contact_us").submit();	
			}else{	
				document.getElementById("validate_contact").style.display = "block";
				document.getElementById("validate_contact").style.visibility = "visible";
			}
   }



/* ------------------------------------------------------------- 
   Sponsor Form  ------------------------------------------ */


    function validate_sponsor(){
		Goon = "0";
		var msg = "";
		if(document.getElementById("firstname").value == ""){ Goon = "1"; document.getElementById("t_firstname").className="error"; }else{ document.getElementById("t_firstname").className="text";}
		if(document.getElementById("lastname").value == ""){ Goon = "1"; document.getElementById("t_lastname").className="error"; }else{ document.getElementById("t_lastname").className="text";}
		if(document.getElementById("country").value == "-"){ Goon = "1"; document.getElementById("t_country").className="error"; }else{ document.getElementById("t_country").className="text";}
		if(document.getElementById("email").value == ""){ Goon = "1"; document.getElementById("t_email").className="error"; }else{ document.getElementById("t_email").className="text";}
		if(!checkEmail(document.getElementById("email").value)){ Goon = "1"; document.getElementById("t_email").className="error"; }else{ document.getElementById("t_email").className="text";}
		
		if(document.getElementById("advertising").checked==true){document.getElementById("advertising2").value="Yes";}else{document.getElementById("advertising2").value="No";}
		if(document.getElementById("information").checked==true){document.getElementById("information2").value="Yes";}else{document.getElementById("information2").value="No";}
			
		if(Goon == "0")	{
			document.getElementById("become_sponsor").method= "post";
			document.getElementById("become_sponsor").action = "send_sponsor.asp";
			document.getElementById("become_sponsor").submit();	
		}else{	
			document.getElementById("validate_sponsor").style.display = "block";
			document.getElementById("validate_sponsor").style.visibility = "visible";
		}
	}


/* ------------------------------------------------------------- 
   Request Form  ------------------------------------------ */


    function validate_request(){
		Goon = "0";
		var msg = "";
		if(document.getElementById("requested_speaker").value == "-" && document.getElementById("other_speaker").value == "" ){ Goon = "1"; document.getElementById("t_requested").className="error"; }else{  Goon = "0"; document.getElementById("t_requested").className=""; }
		if(document.getElementById("firstname").value == ""){ Goon = "1"; document.getElementById("t_firstname").className="error"; }else{ document.getElementById("t_firstname").className="text";}
		if(document.getElementById("lastname").value == ""){ Goon = "1"; document.getElementById("t_lastname").className="error"; }else{ document.getElementById("t_lastname").className="text";}
		if(document.getElementById("country").value == "-"){ Goon = "1"; document.getElementById("t_country").className="error"; }else{ document.getElementById("t_country").className="text";}
		if(document.getElementById("email").value == ""){ Goon = "1"; document.getElementById("t_email").className="error"; }else{ document.getElementById("t_email").className="text";}
		if(!checkEmail(document.getElementById("email").value)){ Goon = "1"; document.getElementById("t_email").className="error"; }else{ document.getElementById("t_email").className="text";}
		
		if(document.getElementById("advertising").checked==true){document.getElementById("advertising2").value="Yes";}else{document.getElementById("advertising2").value="No";}
		if(document.getElementById("information").checked==true){document.getElementById("information2").value="Yes";}else{document.getElementById("information2").value="No";}
			
		if(Goon == "0")	{
			document.getElementById("become_sponsor").method= "post";
			document.getElementById("become_sponsor").action = "send_request.asp";
			document.getElementById("become_sponsor").submit();	
		}else{	
			document.getElementById("validate_sponsor").style.display = "block";
			document.getElementById("validate_sponsor").style.visibility = "visible";
		}
	}


/* ------------------------------------------------------------- 
   Correction  ------------------------------------------ */
   
   function correction(){
		//if(browserName!="MSIE"){
		//	document.getElementById("b_view_all_events").style.marginLeft="0px";
		//}
		if(browserName=="MSIE" && platformname=="MacPPC"){
			//document.getElementById("b_view_all_events").style.display= "none";
			document.getElementById("www-powerwithin-com").style.backgroundImage = "url(/4105/images/pattern_body_left.gif)";
			document.getElementById("www-powerwithin-com").style.backgroundPosition = "left";
			document.getElementById("www-powerwithin-com").style.backgroundRepeat = "repeat-y";
		}
		//if(browserName=="Safari"){
		//	document.getElementById("b_view_all_events").style.paddingLeft="756px";
		//}
	}
	
	
	   function closePostit(){
	   
		document.getElementById("post_it").style.display = "none";
   }
   
/* ------------------------------------------------------------- 
   Positionnement du Post-it  ------------------------------------------ */
      
   function positionnePost_it(divname,w,h){

	switch(browsername) {
		case "MSIE": ypos = document.body.scrollTop; break;
		case "NS": ypos = window.scrollY; break;
		default: ypos = document.body.scrollTop; break;
	}
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
	  //Non-IE
	  myWidth = window.innerWidth;
	  myHeight = window.innerHeight;
	} else if( document.documentElement &&
	    ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	  //IE 6+ in 'standards compliant mode'
	  myWidth = document.documentElement.clientWidth;
	  myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	  //IE 4 compatible
	  myWidth = document.body.clientWidth;
	  myHeight = document.body.clientHeight;
	}
	document.getElementById(divname).style.top = ypos + (myHeight/2) - (h/2)  + "px";
	document.getElementById(divname).style.left = (myWidth/2) - (w/2) + 60 + "px";
}

