<%@ Page Language="vb" AutoEventWireup="false" Codebehind="ChatIEBottom.aspx.vb" Inherits="ChattyWays.ChatIEBottom" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>Chatty Ways</title>
		<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
		<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="../includes/stylesheets/ChatStyle.css" rel="stylesheet">
	</head>
	<!--
		'=======================================================================================
		'AUTHOR                  : David Silverlight
		'
		'CLAIM TO FAME      : Head Geek at XMLPitstop.com and CoFounder of NonProfitWays.com
		'
		'EMAIL                      : HeadGeek@XMLPitstop.com
		'
		'SHAMELESS PLUG  :Yes I am a consultant who is always looking for cool projects.
		'
		'PHONE                    : (561) 212-5707  Coconut Grove, Florida
		'
		'COPYWRIGHT		: This demo is not copywrighted so feel free to use it however it may help you.  Credit is always appreciated,
		'                                  but not required.  I created it simply for the learning experience. If you have any suggestions on areas that 
		'                                  can be improved upon, please feel free to email me.  All credit for enhancements will be given to 
		'                                  those who suggest them.  Enjoy.
		'=======================================================================================
	-->
	<body leftMargin="0" background="../images/fla_backGround.gif" topMargin="0" scroll="no" onload="Form1.txtSendMessage.focus();" MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<table height="100%" cellSpacing="0" cellPadding="0" width="100%">
				<tr style="HEIGHT: 35px">
					<td vAlign="center" width="100%" colSpan="2">
						<input class="inputButton" style="WIDTH: 120px; HEIGHT: 25px" onclick="doShowEmoticonsSmall();" type="button" value="Pick Emoticon">
						<font face="arial" color="black" size="3">IMVironment</font>
						<select class="inputText" id="selIMVironments" style="Z-INDEX: 101; LEFT: 238px; WIDTH: 191px;" name="selIMVironments" onchange="doChangeIMVironment(this);">
							<option value="Default" selected>None</option>
							<option value="Humor">Humor</option>
							<option value="GlobalWarming">Global Warmin</option>
							<option value="PhasesOfTheMoon">Phases of the Moon</option>
							<option value="Space">Space</option>
							<option value="Spiderman">Spiderman</option>
							<option value="WindSurfing">Wind Surfing</option>
							<option value="BoatHouseAtFiji">BoatHouse at Fiji</option>
							<option value="ChromeSmile">Chrome Smile</option>
							<option value="FlightPower">Flight Power</option>
							<option value="HangGliding">Hang Gliding</option>
							<option value="HeavensFlight">Heaven's Flight</option>
							<option value="IllFlyAway">I'll Fly Away</option>
							<option value="RadiatingRipples">Radiating Ripples</option>
							<option value="SaburuHills">Saburu Hills</option>
							<option value="SurfingTheNet">SurfingTheNet</option>
							<option value="TheThaw">The Thaw</option>
							<option value="VictoriaAustralia">Victoria Australia</option>
							<option value="WindSurfing">WindSurfing</option>
						</select>
						<input class="inputButton" style="WIDTH: 120px; HEIGHT: 25px" onclick="doChangeColor();" type="button" value="Change Color">
						<input class="inputButton" style="WIDTH: 120px; HEIGHT: 25px" onclick="doGoToWelcome();" type="button" value="Back">
						<asp:button class="inputButton" id="btSignOut" style="DISPLAY: none" runat="server" height="25" text="Sign Out"></asp:button>
						<font face="arial" color="black" size="3">Font Size:</font>
						<select class="inputButton" id="selFont" style="WIDTH: 120px; HEIGHT: 25px" onchange="doChangeFont(this.value);" name="selFont">
							<option value="">Change Font Size</option>
							<option value="WayTooSmall">Way Too Small</option>
							<option value="ExtraSmall">ExtraSmall</option>
							<option value="Small">Small</option>
							<option value="Medium" selected>Medium</option>
							<option value="Large">Large</option>
							<option value="ExtraLarge">Extra Large</option>
							<option value="WayTooLarge">Way Too Large</option>
						</select>
					</td>
				</tr>
				<tr vAlign="top">
					<td vAlign="top" width="80%"><asp:textbox class="inputTextArea" onkeypress="doKeyPress();" id="txtSendMessage" tabIndex="0" runat="server" maxlength="8000" textmode="MultiLine" style="width:100%;height:60%;"></asp:textbox></td>
					<td vAlign="top" width="10%">
						<p><asp:button class="inputButton" id="btSend" runat="server" text="Send" style="width:100%;height:40px;"></asp:button></p>
						<asp:button class="inputButton" id="btRemove" runat="server" text="Remove" name="btRemove" style="display:none;"></asp:button>
						<p></p>
						<p></p>
						<p>&nbsp;</p>
					</td>
				</tr>
			</table>
			<span style="DISPLAY: none">UI<asp:textbox class="inputText" id="txtUserID" runat="server" Value="3" Width="30px" Height="20px"></asp:textbox>
				CI<asp:textbox class="inputText" id="txtChatID" runat="server" Value="2" Width="30px" Height="20px" name="txtChatID"></asp:textbox>
				<asp:textbox id="txtNameColor" runat="server" Value="green"></asp:textbox><asp:textbox id="txtMessageColor" runat="server" value="red"></asp:textbox>
			</span>
		</form>
		<script language="JavaScript" src="../includes/ChatFuncsIE.js"></script>
		<script language="javascript">
			var hwnd;

			function  doGoToWelcome() {
				try {
					parent.location.href = "../ChatWelcome.aspx"
				} 
				catch (error) 	{
					alert("doGoToWelcome() in ChatIEBottom.aspx caused the following error: " + error.description)
				}
			}


			function doKeyPress () {
				try {
					if (window.event.keyCode == 13) {
						Form1.btSend.click();	
					}
				} 
				catch (error) 	{
					alert("doKeyPress() in ChatIEBottom.aspx caused the following error: " + error.description)
				}


			}


			function doChangeFont(strFontScheme) {
				try {
					var strSpeakerClass = "SpeakerTextSmall";
					var strMessageClass = "MessageTextSmall";
				
					if (strFontScheme == "WayTooSmall") {
						strSpeakerClass =  "SpeakerTextWayTooSmall";
						strMessageClass =  "MessageTextWayTooSmall";
					}
					if (strFontScheme == "ExtraSmall") {
						strSpeakerClass =  "SpeakerTextExtraSmall";
						strMessageClass =  "MessageTextExtraSmall";
					}
					if (strFontScheme == "Small") {
						strSpeakerClass =  "SpeakerTextSmall";
						strMessageClass =  "MessageTextSmall";
					}
					if (strFontScheme == "Medium") {
						strSpeakerClass =  "SpeakerTextMedium";
						strMessageClass =  "MessageTextMedium";
					}
					if (strFontScheme == "Large") {
						strSpeakerClass =  "SpeakerTextLarge";
						strMessageClass =  "MessageTextLarge";
					}
					if (strFontScheme == "ExtraLarge") {
						strSpeakerClass =  "SpeakerTextExtraLarge";
						strMessageClass =  "MessageTextExtraLarge";
					}

					if (strFontScheme == "WayTooLarge") {
						strSpeakerClass =  "SpeakerTextWayTooLarge";
						strMessageClass =  "MessageTextWayTooLarge";
					}

					//var strIMVironment = selIMVironment.value;
					//var strThemeURL = "Themes/" + strIMVironment + "/default.htm";
					//alert(strFontScheme);
					parent.frames(0).doClearMessageTable();
					parent.frames(0).document.Form1.txtSpeakerClass.value=strSpeakerClass;
					parent.frames(0).document.Form1.txtMessageClass.value=strMessageClass;
					parent.frames(0).doClearMessageTable();
					parent.frames(0).document.all.txtLastMessageID.value = "0";

				} 
				catch (error) {
					alert("doChangeFont() in ChatIEBottom.aspx caused the following error: " + error.description)
				}
			}

			function  doShowEmoticonsSmall() {
				try {
					var strEmoticon = doShowDialog("../images/emoticons/EmoticonsLB.htm", "720px", "450px")
					if (strEmoticon != null) {
						document.all.txtSendMessage.value += strEmoticon;
					}
					Form1.txtSendMessage.focus();
				} 
				catch (error) {
					alert("doShowEmoticonsSmall() in ChatIEBottom.aspx caused the following error: " + error.description)
				}
			}

			function  doChangeColor() {
				try {

					var strColor = doShowDialog("../ColorPicker/ColorPicker.htm", "330px", "230px");
					if (strColor != null) {
						//alert(strColor);
						var objColor = new ActiveXObject("MSXML2.DOMDocument");
						objColor.async = false;
						objColor.loadXML(strColor);
						var strNameColor = objColor.selectSingleNode("/colors/name").text;
						var strMessageColor = objColor.selectSingleNode("/colors/message").text;
						//Form1.txtNameColor.text = strNameColor;
						//Form1.txtMessageColor.value = strMessageColor;


						parent.frames(0).doClearMessageTable();
						parent.frames(0).document.Form1.txtSpeakerColor.value= "black";
						parent.frames(0).document.Form1.txtMessageColor.value=strMessageColor;
						parent.frames(0).document.all.txtLastMessageID.value = "0";
						Form1.txtSendMessage.focus();
					}
				} 
				catch (error) {
					alert("doChangeColor() in ChatIEBottom.aspx caused the following error: " + error.description)
				}
			}

			function doChangeIMVironment(selIMVironment) {
				try {

					var strIMVironment = selIMVironment.value;
					var strThemeURL = "Themes/" + strIMVironment + "/default.htm";
					var strSpeakerColor = "Black";
					var strMessageColor = "Blue";
					var strMessageAlign = "left";

					switch (strIMVironment) {
						case "BoatHouseAtFiji":{
							strSpeakerColor = "Red";
							strMessageColor = "Yellow";
							strMessageAlign = "right"
							break;
						}
						case "ChromeSmile":{
							strSpeakerColor = "Red";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "Humor":{
							strSpeakerColor = "Red";
							strMessageColor = "Black";
							strMessageAlign = "right"
							break;
						}
						case "GlobalWarming":{
							strSpeakerColor = "Black";
							strMessageColor = "DarkRed";
							strMessageAlign = "right"
							break;
						}
						case "PhasesOfTheMoon":{
							strSpeakerColor = "Red";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "Space":{
							strSpeakerColor = "Red";
							strMessageColor = "White";
							strMessageAlign = "left"
							break;
						}
						case "Spiderman":{
							strSpeakerColor = "Blue";
							strMessageColor = "DarkRed";
							strMessageAlign = "right"
							break;
						}

						case "FlightPower":{
							strSpeakerColor = "Red";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "HangGliding":{
							strSpeakerColor = "Red";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "HeavensFlight":{
							strSpeakerColor = "Black";
							strMessageColor = "DarkBlue";
							strMessageAlign = "left"
							break;
						}
						case "IllFlyAway":{
							strSpeakerColor = "White";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "RadiatingRipples":{
							strSpeakerColor = "White";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "SaburuHills":{
							strSpeakerColor = "LightGreen";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "SurfingTheNet":{
							strSpeakerColor = "Red";
							strMessageColor = "Yellow";
							strMessageAlign = "right"
							break;
						}

						case "TheThaw":{
							strSpeakerColor = "Yellow";
							strMessageColor = "LightGreen";
							strMessageAlign = "left"
							break;
						}
						case "VictoriaAustralia":{
							strSpeakerColor = "White";
							strMessageColor = "Yellow";
							strMessageAlign = "left"
							break;
						}
						case "WindSurfing":{
							strSpeakerColor = "Black";
							strMessageColor = "Green";
							strMessageAlign = "left"
							break;
						}



					}


					var strLeftStyle = "OVERFLOW-Y: scroll; WIDTH: 100%; POSITION: relative; TOP: 5%; HEIGHT: 95%;z-index:99"
					var strMidStyle = "OVERFLOW-Y: scroll; WIDTH: 50%; POSITION: relative; TOP: 5%; LEFT:50%; HEIGHT: 95%;z-index:99"

					parent.frames(0).doClearMessageTable();
					parent.frames(0).document.all.tblMessageCol.align=strMessageAlign;
					parent.frames(0).document.Form1.txtSpeakerColor.value=strSpeakerColor;
					parent.frames(0).document.Form1.txtMessageColor.value=strMessageColor;
					parent.frames(0).document.all.txtLastMessageID.value = "0";
					parent.frames(0).document.all.ChatTheme.src=strThemeURL;
					Form1.txtSendMessage.focus();



				} 
				catch (error) {
					alert("doChangeIMVironment() in ChatIEBottom.aspx caused the following error: " + error.description)
				}
			}
		</script>
	</body>
</html>
