		var newWin = null;
		var submitted = false;

		function dofocus() {
		    document.form1.txtFrom.focus();
		}

		function doSubmit() {
			if (!submitted) {
				if (validateinput()) {
					submitted = true;
					ProgressImg = document.getElementById('inprogress_img');
					document.getElementById("inprogress").style.visibility = "visible";
					setTimeout("ProgressImg.src = ProgressImg.src",100);
					return true;
				} else
					return false;
			} else {
				submitted = false;
				return false;
			}
		}
		
		function validateinput() {
			var ie4 = false;
			if(document.all) {
				ie4 = true;
			}
			if (ie4) {
				var str;
				str = document.getElementById("File1").value;
				if (str.indexOf("/")<0&&str.indexOf("\\")<0) {
					alert("Please use Browse button to select file");
					return false;
				}
			}
			return true;
		}

		function validatesendto() {
			var str;
			str = document.getElementById("txtSendTo1").value;
			if (str.length == 0 || str == "") return true;

			// ! # $ % * / ? ^ ` { | } ~
			if (str.indexOf("<")>=0 ||str.indexOf(">")>=0 ||str.indexOf(":")>=0 ||str.indexOf("+")>=0 ||str.indexOf("=")>=0 ||str.indexOf("|")>=0 ||str.indexOf("~")>=0 ||str.indexOf("#")>=0 ||str.indexOf("$")>=0) {
				alert("Unsupported symbols detected in [Email To].\n\nExamples of correct email format: john.doe@email.com,johndoe@subdomain.email.com.\n\nUse commas (,) or semicolons (;) to separate addresses.");
				return false;
            }

            if (str.indexOf("@") <= 0 || str.indexOf(".") <= 0) {
                alert("Unsupported e-mail address format.\n\nExample of correct e-mail: johndoe@email.com");
                return false;
            }
            if (str.indexOf(" ") >= 0) {
                alert("Do not use space character in [Email To].\n\nUse comma , or semicolon ; to separate e-mail addresses.");
                return false;
            }
            return true;
		}

		function validateyouremail() {
		    var str;
		    str = document.getElementById("txtFrom").value;
            if (str.length==0 || str=="") {
                alert("Your E-Mail address is required");
		        return false;
		    }
		    if (str.indexOf("<") >= 0 || str.indexOf(">") >= 0 || str.indexOf(":") >= 0 || str.indexOf("+") >= 0 || str.indexOf("=") >= 0 || str.indexOf("|") >= 0 || str.indexOf("~") >= 0 || str.indexOf("#") >= 0 || str.indexOf("$") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) {
		        alert("Unsupported symbols detected in [Your E-Mail].\n\nExamples of correct email format: john.doe@email.com,johndoe@subdomain.email.com");
		        return false;
		    }
		    if (str.indexOf("@") <= 0 || str.indexOf(".") <= 0) {
		        alert("Unsupported e-mail address format.\n\nExample of correct e-mail: johndoe@email.com");
		        return false;
		    }
		    return true;
		}
				
		function popUp(strURL, strType, strHeight, strWidth) {
		 if (newWin != null && !newWin.closed)
		   newWin.close();
		 var strOptions="";
		 if (strType=="console")
		   strOptions="resizable,height="+
			 strHeight+",width="+strWidth;
		 if (strType=="fixed")
		   strOptions="status,height="+
			 strHeight+",width="+strWidth;
		 if (strType=="elastic")
		   strOptions="toolbar,menubar,scrollbars,"+
			 "resizable,location,height="+
			 strHeight+",width="+strWidth;
		 newWin = window.open(strURL, 'newWin', strOptions);
		 newWin.focus();
		}
		 function addBookmark(title,url) {
		  if (window.sidebar) {
			window.sidebar.addPanel(title, url,"");
		  } else if( document.all ) {
				window.external.AddFavorite( url, title);
			} else {
				return true;
			}
		  }

		var ie4 = false;
		if(document.all) {
			ie4 = true;
		}
		function getObject(id) {
			if (ie4) {
				return document.all[id]; 
			} else { 
				return document.getElementById(id); 
			}
}

		function toggle(image,link, divId, from) {
			var lText = link.innerHTML;
			var d = getObject(divId);
			if (lText.indexOf("More ")>=0||from!='') {
				link.innerHTML = '<b>Less Options &laquo;</b>'; d.style.display = 'block'; 
				image.src = "images/minus.gif"
			} else { 
				link.innerHTML = '<b>More Options &raquo;</b>'; d.style.display = 'none'; 
				image.src = "images/plus.gif"
				//var item_from = getObject("txtFrom");
				//item_from.value = '';
			} 
		}


