
			var content_shield = null;
			var modal_dialog = null;
			function getPageSize()
			{
				var xScroll, yScroll;
				if (window.innerHeight && window.scrollMaxY) 
				{	
					xScroll = document.body.scrollWidth;yScroll = window.innerHeight + window.scrollMaxY;
				} 
				else if (document.body.scrollHeight > document.body.offsetHeight)
				{ // all but Explorer 
					MacxScroll = document.body.scrollWidth;yScroll = document.body.scrollHeight;
				} 
				else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
					xScroll = document.body.offsetWidth;yScroll = document.body.offsetHeight;
				}
				var windowWidth, windowHeight;
				if (self.innerHeight) 
				{ // all except Explorer
					windowWidth = self.innerWidth;windowHeight = self.innerHeight;
				} 
				else if (document.documentElement && document.documentElement.clientHeight) 
				{ // Explorer 6 Strict Mode
					windowWidth = document.documentElement.clientWidth;windowHeight = document.documentElement.clientHeight;
				} 
				else if (document.body) 
				{ // other Explorers
					windowWidth = document.body.clientWidth;windowHeight = document.body.clientHeight;
				}
			// for small pages with total height less then height of the viewport
				if(yScroll < windowHeight)
				{
					pageHeight = windowHeight;
				} 
				else 
				{
					pageHeight = yScroll;
				}
			// for small pages with total width less then width of the viewport
				if(xScroll < windowWidth)
				{
					pageWidth = windowWidth;
				} 
				else 
				{
					pageWidth = xScroll;
				}
				arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
				return arrayPageSize;
			}

			function ValidateNo(NumStr, String)
			{    
				for(var Idx=0; Idx<NumStr.length; Idx++)    
				{
					var Char = NumStr.charAt(Idx);
					var Match = false;        
					for(var Idx1=0; Idx1<String.length; Idx1++)        
					{            
						if(Char == String.charAt (Idx1))                
						Match = true;        
					}        
					if (!Match)            
						return false;    
				}    
				return true;
			} 

			function GetXmlHttpObject(handler)
				{   var objXMLHttp=null
					 if (window.XMLHttpRequest)
					 {
						objXMLHttp=new XMLHttpRequest();
					 }
					 else if (window.ActiveXObject)
					 {
						objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
					}
					 return objXMLHttp;
				}
			function mail_posting(first_name,last_name,email,phone1,phone2,phone3,selCellPhoneCarrierID,zipcode,selUserAge,gender)
			{
				
				xmlHttp=GetXmlHttpObject();
				if (xmlHttp == null)
				{
					alert ("Browser does not support HTTP Request");
					return;
				}
				var url="send_mail.php"
				var urls="first_name="+first_name
				urls=urls+"&last_name="+last_name
				urls=urls+"&email="+email
				urls=urls+"&phone1="+phone1
				urls=urls+"&phone2="+phone2	
				urls=urls+"&phone3="+phone3	
				urls=urls+"&selCellPhoneCarrierID="+selCellPhoneCarrierID	
				urls=urls+"&zipcode="+zipcode	
				urls=urls+"&selUserAge="+selUserAge	
				urls=urls+"&gender="+gender	
									
				urls=urls+"&sid="+Math.random();
				xmlHttp.onreadystatechange=stateChanged_test; 
				xmlHttp.open("POST",url,true) ;
				xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", urls.length);
				xmlHttp.setRequestHeader("Connection", "close");
			
				xmlHttp.send(urls);
			}
			function stateChanged_test()
			{
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				{
					//alert(xmlHttp.responseText);
				
					document.getElementById("show_success").innerHTML=xmlHttp.responseText;
					document.getElementById("first_name").value='';
					document.getElementById("last_name").value='';
					document.getElementById("email").value='';
					document.getElementById("phone1").value='';
					document.getElementById("phone2").value='';
					document.getElementById("phone3").value='';
					document.getElementById("selCellPhoneCarrierID").value='';
					document.getElementById("zipcode").value='';
					document.getElementById("selUserAge").value='';
					document.getElementById("gender").value='';	
									
				}
				else
				{           //alert(xmlHttp.status);
				}
			}
			function sendmail(th)
			{
				if(validmail(th)==true)
				{
					
					mail_posting(th.first_name.value,th.last_name.value,th.email.value,th.phone1.value,th.phone2.value,th.phone3.value,th.selCellPhoneCarrierID.value,th.zipcode.value,th.selUserAge.value,th.gender.value);
				}
			}
			function validmail(th)
			{
					if(th.first_name.value<=0)
					{
						alert("Enter First Name!");
						th.first_name.focus();
						return false;
					}
					if(th.last_name.value<=0)
					{
						alert("Enter Last Name!");
						th.last_name.focus();
						return false;
					}
					if(th.email.value<=0)
					{
						alert("Enter Email!");
						th.email.focus();
						return false;
					}
					else
					{
						var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
						if (filter.test(th.email.value))
						{
							
						}
						else 
						{
							alert('Invalid Email address'); 
							th.email.focus();
							return false;
						}
					}
					/*if(th.cemail.value<=0)
					{
						alert("Enter Email!");
						th.cemail.focus();
						return false;
					}
					else
					{
						var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
						if (filter.test(th.cemail.value))
						{
							
						}
						else 
						{
							alert('Invalid Email address'); 
							th.cemail.focus();
							return false;
						}
					}*/
					/*if(th.cemail.value!=th.email.value)
					{
						alert("Confirm Email Does Not Match!");
						th.cemail.focus();
						return false;									
					}*/
					if(th.phone1.value!='')
					{
						var z = ValidateNo(th.phone1.value,"1234567890+-/") ;
						if(z == false)
						{
							alert("Please enter valid phone no!");
							th.phone1.value = "" ;
							th.phone1.focus();
							return false ;
						}
					}	
					if(th.phone2.value!='')
					{
						var z = ValidateNo(th.phone2.value,"1234567890+-/") ;
						if(z == false)
						{
							alert("Please enter valid phone no!");
							th.phone2.value = "" ;
							th.phone2.focus();
							return false ;
						}
					}	
					if(th.phone3.value!='')
					{
						var z = ValidateNo(th.phone3.value,"1234567890+-/") ;
						if(z == false)
						{
							alert("Please enter valid phone no!");
							th.phone3.value = "" ;
							th.phone3.focus();
							return false ;
						}
					}		
					if(th.zipcode.value<=0)
					{
						alert("Enter zipcode");
						th.zipcode.focus();
						return false;
					}
					else
					{	
						var y = ValidateNo(th.zipcode.value,"1234567890+-/") ;
						if(y == false)
						{
							alert("Please enter valid zipcode!");
							th.zipcode.value = "" ;
							th.zipcode.focus();
							
							return false ;
						}
					}	
					if(th.selUserAge.value<=0)
					{
						alert("Enter Age");
						th.selUserAge.focus();
						return false;
					}
					if(th.gender.value<=0)
					{
						alert("Select Gender");
						th.gender.focus();
						return false;
					}	
					
					return true;	
			}
			
			function launch_file_upload_internal_dialog1() 
			{
				//In this example, just display some form elements. This could easily be replaced with a call to an iframe
				//var dialog_html = "<label for='file_input'>Specify a file to upload:</label><input type='file' id='file_input'/><input type='button' value='submit' onclick='hide_modal_dialog()'/>";
				//dialog_html += "<input type='button' value='close' onclick='hide_modal_dialog()' style='margin-left:30px;'/>";
				
				
				dialog_html ="<form name='frm' onsubmit='return validmail(this);' action=''  method='post'>"; 
				dialog_html += "<table width='500' border='0' cellpadding='0' cellspacing='0'>";
				dialog_html += "<tr>";
				dialog_html += "<td valign='top' class='bg_mail'><table width='100%'   height='350' border='0' cellspacing='0' cellpadding='0'>";
				dialog_html += "<tr>";
				dialog_html += "<td width='500' height='50' align='right' background='images/mail_signup.jpg'><table width='50%' border='0' cellspacing='0' cellpadding='0'>";
				dialog_html += "<tr>";
				dialog_html += "<td width='94%' align='right'><a href='#' onclick='hide_modal_dialog()'><img src='images/close_button.jpg' width='20' height='17' border='0'></a></td>";
				dialog_html += "<td width='6%' align='right'>&nbsp;</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='right'>&nbsp;</td>";
				dialog_html += "<td align='right'>&nbsp;</td>";
				dialog_html += "</tr>";
				dialog_html += "</table></td>";
			  	dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='center'>";
				////////////////
				dialog_html +="<span class='successful_msg'><div id='show_success'>";
				dialog_html += "<table width='93%' border='0' cellspacing='0' cellpadding='0'>";
				dialog_html += "<tr>";
				dialog_html += "<td colspan='3'>&nbsp;</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td colspan='3'><span class='mail_text1'>Sign up for email or text alerts to find out the minute tickets go on sale.<br>";
				dialog_html += "We'll keep you updated with party details and announcements as we release them.</span>.</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td colspan='3'>&nbsp;</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td width='41%' height='18' align='right'><span class='mail_whitetxt'>First Name : </span><span class='normal_white'>*</span></td>";
				dialog_html += "<td width='2%'>&nbsp;</td>";
				dialog_html += "<td width='57%' height='23' align='left'><input name='first_name' id='first_name' type='text' class='textfield05' size='25'></td>";
			  	dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='right'><span class='mail_whitetxt'>Last  Name : </span><span class='normal_white'>*</span></td>";
				dialog_html += "<td>&nbsp;</td>";
				dialog_html += "<td height='23' align='left'><input name='last_name' id='last_name' type='text' class='textfield05' size='25'></td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='right'><span class='mail_whitetxt'>Email Address : </span><span class='normal_white'>*</span></td>";
				dialog_html += "<td>&nbsp;</td>";
				dialog_html += "<td height='23' align='left'><input name='email' id='email' type='text' class='textfield05' size='25'></td>";
				dialog_html += "</tr>";
				/*dialog_html += "<tr>";
				dialog_html += "<td align='right'><span class='mail_whitetxt'>Confirm Email Address : </span><span class='normal_white'>*</span></td>";
				dialog_html += "<td>&nbsp;</td>";
				dialog_html += "<td height='23' align='left'><input name='cemail' id='cemail' type='text' class='textfield05' size='25'></td>";
				dialog_html += "</tr>";*/
								dialog_html += "<tr>";
				dialog_html += "<td height='18' align='right' class='mail_whitetxt'>Zip Code  : <span class='normal_white'>*</span></td>";
				dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
				dialog_html += "<td height='23' class='mail_whitetxt'><input name='zipcode' id='zipcode' type='text' class='textfield05' size='25'></td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td height='18' align='right' class='mail_whitetxt'>Age  : <span class='normal_white'>*</span></td>";
				dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
				dialog_html += "<td height='23' class='mail_whitetxt'><select name='selUserAge' id='selUserAge' size=1 class='textfield05'>";
				dialog_html += "<option value='' selected='selected'>Select Age</option>";
				dialog_html += "<option value=21>21</option>";
				dialog_html += "<option value=22>22</option>";
							  dialog_html += "<option value=23>23</option>";
							  dialog_html += "<option value=24>24</option>";
							  dialog_html += "<option value=25>25</option>";
							  dialog_html += "<option value=26>26</option>";
							  dialog_html += "<option value=27>27</option>";
							  dialog_html += "<option value=28>28</option>";
							  dialog_html += "<option value=29>29</option>";
							  dialog_html += "<option value=30>30</option>";
							  dialog_html += "<option value=31>31</option>";
							  dialog_html += "<option value=32>32</option>";
							  dialog_html += "<option value=33>33</option>";
							  dialog_html += "<option value=34>34</option>";
							  dialog_html += "<option value=35>35</option>";
							  dialog_html += "<option value=36>36</option>";
							  dialog_html += "<option value=37>37</option>";
							  dialog_html += "<option value=38>38</option>";
							  dialog_html += "<option value=39>39</option>";
							  dialog_html += "<option value=40>40</option>";
							  dialog_html += "<option value=41>41</option>";
							  dialog_html += "<option value=42>42</option>";
							  dialog_html += "<option value=43>43</option>";
							  dialog_html += "<option value=44>44</option>";
							  dialog_html += "<option value=45>45</option>";
							  dialog_html += "<option value=46>46</option>";
							  dialog_html += "<option value=47>47</option>";
							  dialog_html += "<option value=48>48</option>";
							  dialog_html += "<option value=49>49</option>";
							  dialog_html += "<option value=50>50</option>";
							  dialog_html += "<option value=51>51</option>";
							  dialog_html += "<option value=52>52</option>";
							  dialog_html += "<option value=53>53</option>";
							  dialog_html += "<option value=54>54</option>";
							  dialog_html += "<option value=55>55</option>";
							  dialog_html += "<option value=56>56</option>";
							  dialog_html += "<option value=57>57</option>";
							  dialog_html += "<option value=58>58</option>";
							  dialog_html += "<option value=59>59</option>";
							  dialog_html += "<option value=60>60</option>";
							  dialog_html += "<option value=61>61</option>";
							  dialog_html += "<option value=62>62</option>";
							  dialog_html += "<option value=63>63</option>";
							  dialog_html += "<option value=64>64</option>";
							  dialog_html += "<option value=65>65</option>";
							  dialog_html += "<option value=66>66</option>";
							  dialog_html += "<option value=67>67</option>";
							  dialog_html += "<option value=68>68</option>";
							  dialog_html += "<option value=69>69</option>";
							  dialog_html += "<option value=70>70</option>";
							  dialog_html += "<option value=71>71</option>";
							  dialog_html += "<option value=72>72</option>";
							  dialog_html += "<option value=73>73</option>";
							  dialog_html += "<option value=74>74</option>";
							  dialog_html += "<option value=75>75+</option>";
							dialog_html += "</select></td>";
						  dialog_html += "</tr>";  
				dialog_html += "<tr>";
				dialog_html += "<td height='18' align='right' class='mail_whitetxt'>Gender  : <span class='normal_white'>*</span></td>";
				dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
				dialog_html += "<td height='23' class='mail_whitetxt'><select name='gender' id='gender' size=1 class='textfield05'>";
				dialog_html += "<option value='' selected='selected'>Select Gender</option>";
				dialog_html += "<option value=Male>Male</option>";
				dialog_html += "<option value=Female>Female</option>";
							dialog_html += "</select></td>";
						  dialog_html += "</tr>";  


				dialog_html += "<tr>";
				dialog_html += "<td align='center'></td>";
				dialog_html += "<td>&nbsp;</td>";
				dialog_html += "<td height='23' align='left'><span class='mail_whitetxt'>For Text Alerts</span></td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='right'><span class='mail_whitetxt'>Cell Phone Number :&nbsp;&nbsp;</span></td>";
				dialog_html += "<td>&nbsp;</td>";
				dialog_html += "<td height='23' align='left'><input name='phone1' id='phone1' type='text' class='textfield05' size='1'>";			 
				dialog_html += "<span class='normal_white'>-";
			  	dialog_html += "<input name='phone2' id='phone2' type='text' class='textfield05' size='1'>-";
				dialog_html += "</span>";
				dialog_html += "<input name='phone3' id='phone3' type='text' class='textfield05' size='3'>";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td height='18' align='right' class='mail_whitetxt'>Mobile Carrier :&nbsp;&nbsp;</td>";
				dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
				dialog_html += "<td height='23' class='mail_whitetxt'><SELECT class=textfield05 name='selCellPhoneCarrierID' id='selCellPhoneCarrierID'>";
				dialog_html += "<OPTION value='' selected>please select</OPTION>";
				dialog_html += "<OPTION value=1012>Alltel</OPTION>";
				dialog_html += "<OPTION value=1013>AT&amp;T Wireless</OPTION>";
				dialog_html += "<OPTION value=1009>Boost Mobile</OPTION>";
				dialog_html += "<OPTION value=1010>Midwest</OPTION>";
				dialog_html += "<OPTION value=1003>Nextel</OPTION>";
				dialog_html += "<OPTION value=1004>Sprint</OPTION>";
				dialog_html += "<OPTION value=1011>Suncom</OPTION>";
				dialog_html += "<OPTION value=1005>T-Mobile</OPTION>";
				dialog_html += "<OPTION value=1002>Verizon Wireless</OPTION>";
				dialog_html += "<OPTION value=1019>Virgin Mobile</OPTION>";
				dialog_html += "</SELECT></td>";
				dialog_html += "</tr>";
						  dialog_html += "<tr>";
							dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
							dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
							dialog_html += "<td height='18' class='mail_whitetxt'>&nbsp;</td>";
						  dialog_html += "</tr>";
						  dialog_html += "<tr>";
							dialog_html += "<td class='mail_whitetxt'>&nbsp;</td>";
							dialog_html += "<td class='mail_whitetxt'>&nbsp;</td>";
							dialog_html += "<td class='mail_whitetxt'><a href='#'><img onclick='return sendmail(frm);' src='images/submit_button.jpg' width='99' height='33' border='0'></a></td>";
						  dialog_html += "</tr>";
						  dialog_html += "<tr>";
							dialog_html += "<td class='mail_whitetxt'>&nbsp;</td>";
							dialog_html += "<td colspan='2' class='mail_whitetxt'>&nbsp;</td>";
						  dialog_html += "</tr>";
						dialog_html += "</table>";
						dialog_html +="</div></span>";	
					///////////////////////////////////////////
						dialog_html += "</td>";
					  dialog_html += "</tr>";
					  dialog_html += "<tr>";
						dialog_html += "<td height='20' align='center'>&nbsp;</td>";
					  dialog_html += "</tr>";
					dialog_html += "</table></td>";
				  dialog_html += "</tr>";
				dialog_html += "</table>"
				dialog_html +="</form>";	
				
				/////////////////////////////////////////

	            

/*				dialog_html = "<table width='350' border='0' cellspacing='0' cellpadding='0' >";
	            dialog_html += "<tr>";
                dialog_html += "<td width='7' height='7'><img src='images/corner_top_left.png' width='7' height='7' /></td>";
				dialog_html += "<td width='99%' class='bg_lightbluecolor'></td>";
				dialog_html += "<td width='7' height='7'><img src='images/corner_top_right.png' width='7' height='7' /></td>";
                dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td class='bg_lightbluecolor'>&nbsp;</td>";
                dialog_html += "<td valign='top' class='bg_lightbluecolor'>";
				dialog_html += "<table>";	
				dialog_html += "<tr>";
				dialog_html += "<td align='left'>";
				dialog_html += "<h4>Upload Photo</h4>";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td class='edit_bluecolor' height='30'>";
				dialog_html += "<form action=change-photo-db.php method='post' enctype='multipart/form-data' onsubmit='return check_valid_image(this)'>";
				dialog_html += "<input type='file' name='photo' id='photo' size='30'/><input type='submit' 	value='Submit' style='margin-left:5px;' ><input type='button' value='close' onclick='hide_modal_dialog()' style='margin-left:5px;'/>";
				dialog_html += "</form>";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td height='5'>";
				dialog_html += "&nbsp;";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr id='err_msg' style='display:none'>";
				dialog_html += "<td class='err_msg'>";
				dialog_html += "invalid image. please upload a file ending with JPG, JPEG, GIF or PNG.";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='left' class='home_text_blacknormal'>";
				dialog_html += "You can upload a JPG, GIF, BMP or PNG file (Maximum size of 10Mb). Do not upload photos containing cartoons, celebrities, nudity, artwork or copyrighted images. Minimum image size is 32x32.";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "</table>";
				dialog_html += "</td>";
                dialog_html += "<td class='bg_lightbluecolor'>&nbsp;</td>";
                dialog_html += "</tr>";
                dialog_html += "<tr>";
                dialog_html += "<td width='7' height='7'><img src='images/corner_bottom_left.png' width='7' height='7' /></td>";
                dialog_html += "<td class='bg_lightbluecolor'></td>";
                dialog_html += "<td height='7'><img src='images/corner_bottom_right.png' width='7' height='7' /></td>";
                dialog_html += "</tr>";
                dialog_html += "</table>";
*/				
				show_modal_dialog(dialog_html);
			}
			
			function add_photo_in_scrap() 
			{
				//In this example, just display some form elements. This could easily be replaced with a call to an iframe
				//var dialog_html = "<label for='file_input'>Specify a file to upload:</label><input type='file' id='file_input'/><input type='button' value='submit' onclick='hide_modal_dialog()'/>";
				//dialog_html += "<input type='button' value='close' onclick='hide_modal_dialog()' style='margin-left:30px;'/>";
				dialog_html = "<table width='350' border='0' cellspacing='0' cellpadding='0' >";
	            dialog_html += "<tr>";
                dialog_html += "<td width='7' height='7'><img src='images/corner_top_left.png' width='7' height='7' /></td>";
				dialog_html += "<td width='99%' class='bg_lightbluecolor'></td>";
				dialog_html += "<td width='7' height='7'><img src='images/corner_top_right.png' width='7' height='7' /></td>";
                dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td class='bg_lightbluecolor'>&nbsp;</td>";
                dialog_html += "<td valign='top' class='bg_lightbluecolor'>";
				dialog_html += "<table>";	
				dialog_html += "<tr>";
				dialog_html += "<td align='left'>";
				dialog_html += "<h4>Upload Photo</h4>";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td class='edit_bluecolor' height='30'>";
				dialog_html += "<form action=post-scrap-photo.php method='post' enctype='multipart/form-data' onsubmit='return check_valid_image(this)'>";
				dialog_html += "<input type='file' name='photo' id='photo' size='30'/><input type='submit' 	value='Submit' style='margin-left:5px;' ><input type='button' value='close' onclick='hide_modal_dialog()' style='margin-left:5px;'/>";
				dialog_html += "</form>";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td height='5'>";
				dialog_html += "&nbsp;";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr id='err_msg' style='display:none'>";
				dialog_html += "<td class='err_msg'>";
				dialog_html += "invalid image. please upload a file ending with JPG, JPEG, GIF or PNG.";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='left' class='home_text_blacknormal'>";
				dialog_html += "You can upload a JPG, GIF, BMP or PNG file (Maximum size of 10Mb). Do not upload photos containing cartoons, celebrities, nudity, artwork or copyrighted images. Minimum image size is 32x32.";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "</table>";
				dialog_html += "</td>";
                dialog_html += "<td class='bg_lightbluecolor'>&nbsp;</td>";
                dialog_html += "</tr>";
                dialog_html += "<tr>";
                dialog_html += "<td width='7' height='7'><img src='images/corner_bottom_left.png' width='7' height='7' /></td>";
                dialog_html += "<td class='bg_lightbluecolor'></td>";
                dialog_html += "<td height='7'><img src='images/corner_bottom_right.png' width='7' height='7' /></td>";
                dialog_html += "</tr>";
                dialog_html += "</table>";
				
				show_modal_dialog(dialog_html);
			}
			
			function launch_edit_settings() 
			{
				//In this example, just display some form elements. This could easily be replaced with a call to an iframe
				//var dialog_html = "<label for='file_input'>Specify a file to upload:</label><input type='file' id='file_input'/><input type='button' value='submit' onclick='hide_modal_dialog()'/>";
				//dialog_html += "<input type='button' value='close' onclick='hide_modal_dialog()' style='margin-left:30px;'/>";
				dialog_html = "<table width='350' border='0' cellspacing='0' cellpadding='0' >";
	            dialog_html += "<tr>";
                dialog_html += "<td width='7' height='7'><img src='images/corner_top_left.png' width='7' height='7' /></td>";
				dialog_html += "<td width='99%' class='bg_lightbluecolor'></td>";
				dialog_html += "<td width='7' height='7'><img src='images/corner_top_right.png' width='7' height='7' /></td>";
                dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td class='bg_lightbluecolor'>&nbsp;</td>";
                dialog_html += "<td valign='top' class='bg_lightbluecolor'>";
				dialog_html += "<form action=change-photo-db.php method='post' enctype='multipart/form-data' onsubmit='return check_valid_image(this)'>";
				dialog_html += "<table>";	
				dialog_html += "<tr>";
				dialog_html += "<td align='left'>";
				dialog_html += "<h4>Notice</h4>";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td class='edit_bluecolor' height='30'>";
				
				dialog_html += "<input type='radio' name='radio1' id='radio1' checked='checked' />Everyone";
				dialog_html += "</td>";
				dialog_html += "<tr>";
				dialog_html += "<td class='edit_bluecolor' height='30'>";
				dialog_html += "<input type='radio' name='radio1' id='radio1' />friends Of friends";
				dialog_html += "</td>";
				dialog_html += "<tr>";
				dialog_html += "<td class='edit_bluecolor' height='30'>";
				dialog_html += "<input type='radio' name='radio1' id='radio1' />all of my friends";
				dialog_html += "</td>";
				dialog_html += "<tr>";
				dialog_html += "<td class='edit_bluecolor' height='30'>";
				dialog_html += "<input type='radio' name='radio1' id='radio1' />Group of my friends<input type='submit' 	value='Submit' style='margin-left:5px;' ><input type='button' value='close' onclick='hide_modal_dialog()' style='margin-left:5px;'/>";
				dialog_html += "</td>";
				
				
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td height='5'>";
				dialog_html += "&nbsp;";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr id='err_msg' style='display:none'>";
				dialog_html += "<td class='err_msg'>";
				dialog_html += "invalid image. please upload a file ending with JPG, JPEG, GIF or PNG.";
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "<tr>";
				dialog_html += "<td align='left' class='home_text_blacknormal'>";
				
				dialog_html += "</td>";
				dialog_html += "</tr>";
				dialog_html += "</table>";
				dialog_html += "</form>";
				dialog_html += "</td>";
                dialog_html += "<td class='bg_lightbluecolor'>&nbsp;</td>";
                dialog_html += "</tr>";
                dialog_html += "<tr>";
                dialog_html += "<td width='7' height='7'><img src='images/corner_bottom_left.png' width='7' height='7' /></td>";
                dialog_html += "<td class='bg_lightbluecolor'></td>";
                dialog_html += "<td height='7'><img src='images/corner_bottom_right.png' width='7' height='7' /></td>";
                dialog_html += "</tr>";
                dialog_html += "</table>";
				
				
				show_modal_dialog(dialog_html);
			}
			
			function check_valid_image(th)
			{
				if (!validimage(th.photo))
				{
					document.getElementById ('err_msg').style.display='block';
					return false;
				}
				else
				{
					hide_modal_dialog();
				}
				
			}
			
			function body_onscroll() 
			{
				window.status = getScrollXY();
			}
			
			function show_modal_dialog(dialog_html) 
			{
				if (content_shield == null) 
				{
					content_shield = document.createElement("div");
					content_shield.style.height = getPageSize()[1];
					document.body.appendChild(content_shield);content_shield.className = "content_faded";window.status="disabled";
					//Because the div is only ever going to be the height of the displayable area of the browser (100%),//it needs to move with the scrollbars (width will always be 100%). We could instead explicitly set//div height to the complete height of the page including non-visible scrollable areas, but then//we would need to handle window resize events as well.//eg. 
					addEvent(document.body, "onscroll", body_onscroll);
				}
				modal_dialog = document.getElementById("internal_dialog");
				modal_dialog.innerHTML = dialog_html;
				modal_dialog.style.display = "block";
			}
			
					
			function hide_modal_dialog() 
			{
				modal_dialog.style.display = "none";
				if (content_shield != null) 
				{
					document.body.removeChild(content_shield);content_shield = null;
				}
			}
			function addEvent(obj, evType, fn, useCapture)
			{
				//From http://www.scottandrew.com/weblog/articles/cbs-events
				if (obj.addEventListener)
				{
					obj.addEventListener(evType, fn, useCapture); return true;
				} 
				else if (obj.attachEvent)
				{
					var r = obj.attachEvent("on"+evType, fn); return r;
				} 
				else 
				{
					alert("Handler could not be attached");
				}
			}
			function getScrollXY() 
			{
				var scrOfX = 0, scrOfY = 0;
				if( typeof( window.pageYOffset ) == 'number' ) 
				{ //Netscape compliant 
					scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
				} 
				else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
				{ //DOM compliant 
					scrOfY = document.body.scrollTop; 
					scrOfX = document.body.scrollLeft;
				} 
				else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
				{ //IE6 standards compliant mode 
				scrOfY = document.documentElement.scrollTop; 
				scrOfX = document.documentElement.scrollLeft;
				}
				return [ scrOfX, scrOfY ];
			}
		
function validimage(myfld)
{
	strname = myfld.value;
	strname=strname.substring(strname.lastIndexOf(".")+1)
	strname=strname.toLowerCase();
	if(strname != "jpg" && strname!="gif" && strname!="png")
	{
		//alert(" Please Select Image Type To [jpg | gif | png ]");
		myfld.focus();
		return false;
	}
	return true;
}
