																														function HandlerHTML (TSV1) {return "H_" + TSV1 + ".php";}function ToUpperCase () {PressedKeyCode = window.event.keyCode;if ((PressedKeyCode >= 97) && (PressedKeyCode <= 122)) {window.event.keyCode = PressedKeyCode - 32;window.event.returnValue = true;}}function FilterNumeric () {var PressedKeyCode, IsValid;PressedKeyCode = window.event.keyCode;IsValid = false;if (PressedKeyCode == 13) {IsValid = true;}if ((PressedKeyCode >= 48) && (PressedKeyCode <= 57)) {IsValid = true;}if ((PressedKeyCode == 45) || (PressedKeyCode == 46)) {IsValid = true;}if (!IsValid) {window.event.keyCode = 0;}}function ChangeInnerHTML (LayerName, TSV) {if (document.layers) {TP = document.layers[LayerName].document; TP.open(); TP.write(TSV); TP.close();}else if (document.getElementById) {document.getElementById(LayerName).innerHTML = TSV;}else if (document.all) {document.all[LayerName].innerHTML = TSV;}}function GetElement (TSV) {if (document.getElementById) {return document.getElementById(TSV);}else if (document.all) {return document.all[TSV];}}function GoTo (TSV) {document.location = TSV;}function Trim (TSV) {while ((TSV.substring(0, 1) == ' ') || (TSV.substring(0, 1) == '\n') || (TSV.substring(0,1) == '\r')) {TSV = TSV.substring(1, TSV.length);}while ((TSV.substring(TSV.length-1, TSV.length) == ' ') || (TSV.substring(TSV.length-1, TSV.length) == '\n') || (TSV.substring(TSV.length-1, TSV.length) == '\r')) {TSV = TSV.substring(0, TSV.length-1);}return TSV;}function IsValidEMail (TSV1) {TV1 = TSV1.lastIndexOf('@');TV2 = TSV1.lastIndexOf('.');if ((TV1 < 1) || (TV2 < TV1)) {return false;} else {return true;}}function NullValueFound (TP1, TA1, TA2) {for (TV1=0; TV1 <= TA1.length-1; TV1++) {if (Trim(TP1[TA1[TV1]].value) == '') {alert(TA2[TV1] + ' is not specified'); return true;}}}function RemoveItem (TSV1, TV) {if (confirm('Are you sure you want to remove this item?')) {document.location = 'H_' + TSV1 + '.php?Action=Remove&' + TSV1 + 'ID=' + TV;}}function RemoveUserItem (TSV1, TV1, TV2) {if (confirm('Are you sure you want to remove this item?')) {document.location = 'H_' + TSV1 + '.php?Action=Remove&' + TSV1 + 'ID=' + TV1 + "&UserID=" + TV2;}}function URLEncode (TSV1) {return ReplaceAll(escape(TSV1), '%20', '+');}function ChangeBackGround (TP, TSV) {TP.style.background = TSV;}function ActiveRadioNumber (TSV) {var TV1, TV2, TV3;TV1 = 0;TV2 = document.all[TSV].length;if (TV2 != null) {for (TV3=0; TV3 <= TV2-1; TV3++) {if (document.all[TSV][TV3].checked) {TV1 = TV3 + 1;}}} else {if (document.all[TSV].checked) {TV1 = 1;}}return TV1;}function ReplaceAll (TSV1, TSV2, TSV3) {if (TSV2 != TSV3) {while (TSV1.indexOf(TSV2) != -1) {TSV1 = TSV1.replace(TSV2, TSV3);}}return TSV1;}function DrawFlash (URL, Width, Height, BackgroundColor, IsTransparent, ReturnHTML) {TSV1 = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + Width + "' height='" + Height + "'>"+ "<PARAM name='movie' value='" + URL + "'> <PARAM name='quality' value='high'>" + (IsTransparent ? "<PARAM name='Wmode' value='transparent'>" : "<PARAM name='bgcolor' value='" + BackgroundColor + "'>")+ "<EMBED src='" + URL + "' width='" + Width + "' height='" + Height + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'" + (IsTransparent ? " wmode='transparent'" : " bgcolor='" + BackgroundColor + "'") + "></EMBED>"+ "</OBJECT>";if (ReturnHTML) {return TSV1;} else {document.write(TSV1);}}function DrawExtendedSelect (Layer, Type, Name, OptionsVariable, SelectedValue) {TA1 = Name.split('=');if (TA1.length == 2) {Name = TA1[0];Title = TA1[1];} else {Title = Name;}Options = eval(OptionsVariable);nOptions = Options.length;if (Type == -1) {nOptions > 0 ? Type = 1 : Type = 0;}if (Type == 0) {TSV1 = "<TD style='WIDTH:100%'>"+ "<INPUT name='" + Name + "' style='WIDTH:100%' value='" + SelectedValue + "'>"+ "</TD>"+ "<TD style='PADDING-LEFT:2px'>"+ "<IMG src='pic/Button_SelectItem.gif' onclick='DrawExtendedSelect(\"" + Layer + "\", 1, \"" + Name + "\", \"" + OptionsVariable + "\", \"" + SelectedValue + "\")' style='CURSOR:hand' alt='Select'>";+ "</TD>";}else if (Type == 1) {TA1 = new Array();SelectedValue == "" ? TSV3 = " selected" : TSV3 = "";TSV2 = "<OPTION value=''" + TSV3 + ">- select " + Title.toLowerCase() + " -";for (TV1=0; TV1 <= nOptions-1; TV1++) {if (isNaN(TA1[Options[TV1]])) {SelectedValue == Options[TV1] ? TSV3 = " selected" : TSV3 = "";TSV2 += "<OPTION value='" + Options[TV1] + "'" + TSV3 + ">" + Options[TV1];TA1[Options[TV1]] = true;}}TSV1 = "<TD style='WIDTH:100%'>"+ "<SELECT name='" + Name + "' style='WIDTH:100%'>"+ TSV2+ "</SELECT>"+ "</TD>"+ "<TD style='PADDING-LEFT:2px'>"+ "<IMG src='pic/Button_NewItem.gif' onclick='DrawExtendedSelect(\"" + Layer + "\", 0, \"" + Name + "\", \"" + OptionsVariable + "\", \"" + SelectedValue + "\")' style='CURSOR:hand' alt='New'>"+ "</TD>";}TSV1 = "<TABLE cellpadding='0' cellspacing='0' style='WIDTH:100%'>"+ "<TR>"+ TSV1+ "</TR>"+ "</TABLE>";ChangeInnerHTML(Layer, TSV1);}function HideForm (TSV1, TSV2) {TSV3 = GetElement(TSV1 + 'Layer').innerHTML;ChangeInnerHTML(TSV1 + 'Layer', "<B><A href='javascript:DrawHiddenForm(\"" + TSV1 + "\")' style='COLOR:white; BACKGROUND-COLOR:#B63170; BORDER:white 2px solid; LINE-HEIGHT:160%; PADDING:5px'>" + TSV2 + "</A></B>");return TSV3;}function DrawHiddenForm (TSV1) {ChangeInnerHTML(TSV1 + 'Layer', eval(TSV1 + 'HTML'));}function GetScrollXY () {var scrOfX = 0, scrOfY = 0;if (typeof(window.pageYOffset) == 'number') {scrOfY = window.pageYOffset;scrOfX = window.pageXOffset;} else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {scrOfY = document.body.scrollTop;scrOfX = document.body.scrollLeft;} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {scrOfY = document.documentElement.scrollTop;scrOfX = document.documentElement.scrollLeft;}return new Array(scrOfX, scrOfY);}function ShowDialogBox (TSV1, event) {var TA1 = GetScrollXY();GetElement('DialogBoxLayer').style.visibility = 'visible';GetElement('DialogBoxLayer').style.left = TA1[0] + event.clientX;GetElement('DialogBoxLayer').style.top = TA1[1] + event.clientY - 132;TSV1 = "<A href='javascript:HideDialogBox()'><IMG src='pic/Icon_Close.gif' alt='Close' style='FLOAT:right'></A>"+ "<DIV style='PADDING-TOP:9px; PADDING-LEFT:9px'>"+ TSV1+ "</DIV>";ChangeInnerHTML('DialogBoxContentsLayer', TSV1);GetElement('DialogBoxContentsLayer').style.visibility = 'visible';GetElement('DialogBoxContentsLayer').style.left = TA1[0] + event.clientX;GetElement('DialogBoxContentsLayer').style.top = TA1[1] + event.clientY - 132;}function HideDialogBox () {GetElement('DialogBoxLayer').style.visibility = 'hidden';GetElement('DialogBoxContentsLayer').style.visibility = 'hidden';}function ShowMailingDialogBox (event) {TSV1 = "<DIV id='DialogBoxFormLayer'>"+ "<FORM name='MailingForm'>"+ "<TABLE cellpadding='1' cellspacing='0' style='MARGIN-LEFT:auto; MARGIN-RIGHT:auto; FONT:10px verdana'>"+ "<TR>"+ "<TD>"+ "First Name:"+ "</TD>"+ "<TD>"+ "<INPUT type='text' name='FirstName' style='WIDTH:120px; FONT:9px verdana'>"+ "</TD>"+ "</TR>"+ "<TR>"+ "<TD>"+ "Last Name:"+ "</TD>"+ "<TD>"+ "<INPUT type='text' name='LastName' style='WIDTH:120px; FONT:9px verdana'>"+ "</TD>"+ "</TR>"+ "<TR>"+ "<TD>"+ "E-mail:"+ "</TD>"+ "<TD>"+ "<INPUT type='text' name='EMail' style='WIDTH:120px; FONT:9px verdana'>"+ "</TD>"+ "<TD>"+ "</TR>"+ "<TR>"+ "<TD colspan='2' align='right'>"+ "<A href='javascript:SubmitMailing()'><IMG src='pic/Button_Join.gif' alt='Join'></A>"+ "</TD>"+ "</TR>"+ "</TABLE>"+ "</FORM>"+ "</DIV>";ShowDialogBox(TSV1, event);document.MailingForm.FirstName.focus();}function SubmitMailing () {ChangeInnerHTML('DialogBoxFormLayer', "<IFRAME src='H_Mailing.php?Action=Add&FirstName=" + URLEncode(document.MailingForm.FirstName.value) + "&LastName=" + URLEncode(document.MailingForm.LastName.value) + "&EMail=" + URLEncode(document.MailingForm.EMail.value) + "' style='WIDTH:185px; HEIGHT:30px; MARGIN-TOP:25px; BORDER:#003366 1px dotted' scrolling='no' frameborder='0' marginheight='0' style='FILTER:alpha(opacity=70); -moz-opacity:0.7; -khtml-opacity:0.7; opacity:0.7'></IFRAME>");}function HandleHTTPRequest (Method, URL, Variables, SuccessHandler, FailureHandler) {var TP1 = null;if (window.XMLHttpRequest) {TP1 = new XMLHttpRequest();}else if (window.ActiveXObject) {TP1 = new ActiveXObject('Microsoft.XMLHTTP');}if (TP1 != null) {TP1.onreadystatechange = function () {if (TP1.readyState == 4) {if (TP1.status == 200) {if (SuccessHandler != '') {eval(SuccessHandler);}} else {if (FailureHandler != '') {eval(FailureHandler);}}}};TP1.open(Method, URL, true);if (Method == 'POST') {TP1.setRequestHeader('content-type', 'application/x-www-form-urlencoded');TP1.setRequestHeader('content-length', Variables.length);TP1.setRequestHeader('connection', 'close');} else {Variables = null;}TP1.send(Variables);} else {if (FailureHandler != '') {eval(FailureHandler);}}}function GetCityInfos () {HandleHTTPRequest('POST', 'http://www.advance-international.com/Get_AJAX_Citys.php', '', 'HandleGetCityInfosSuccess(TP1)', '');setTimeout('GetCityInfos()', 5 * 60 * 1000);}function HandleGetCityInfosSuccess (TP1) {var TA1;TA1 = TP1.responseText.split('<RESULT>');if (TA1.length == 3) {messages = GetCityInfosHTML(eval('new Array(' + TA1[1] + ')'));}}function GetCityInfosHTML (TA1) {var TA2 = new Array();TV1 = TA1.length;for (TV2=0; TV2 <= TV1-1; TV2++) {TA2[TV2] = "<TABLE cellpadding='0' cellspacing='0' style='WIDTH:290px; HEIGHT:35px'>"+ "<TR>"+ "<TD>"+ "<TABLE cellpadding='0' cellspacing='0' style='WIDTH:218px; HEIGHT:23px; BORDER-RIGHT:#919CB8 1px solid; BORDER-BOTTOM:#919CB8 1px solid'>"+ "<TR>"+ "<TD style='PADDING-LEFT:4px'>"+ "<IMG src='pic/Caption_Time" + ReplaceAll(TA1[TV2][0], " ", "") + ".gif' style='HEIGHT:16px'>"+ "</TD>"+ "<TD align='right' style='PADDING-RIGHT:5px'>"+ TA1[TV2][1]+ "<IMG src='pic/Caption_TimeColon.gif?3' style='HEIGHT:16px'>"+ TA1[TV2][2]+ "</TD>"+ "</TR>"+ "</TABLE>"+ "</TD>"+ "<TD rowspan='2' align='center' style='WIDTH:100%'>"+ "<IMG src='pic/Icon_Weather" + TA1[TV2][3] + ".gif'>"+ "</TD>"+ "<TD rowspan='2' align='right' style='PADDING-RIGHT:3px'>"+ "<DIV style='MARGIN-BOTTOM:3px'>"+ "<IMG src='pic/Icon_Temperature.gif'>"+ "</DIV>"+ "<DIV style='WHITE-SPACE:nowrap'>"+ TA1[TV2][4]+ "</DIV>"+ "</TD>"+ "</TR>"+ "<TR>"+ "<TD style='COLOR:#415697; FONT-FAMILY:tahoma; FONT-SIZE:" + (TA1[TV2][5].length > 35 ? 8 : 10) + "px; PADDING-LEFT:2px'>"+ "&nbsp;" + TA1[TV2][5]+ "</TD>"+ "</TR>"+ "</TABLE>";}return TA2;}																												
