function Submit_Form(form,message1,message2)
{
	var b_error=false;
	for(i=0;i<required_fields.length;i++)
	{
		if(document.all(required_fields[i]).value=="")
		{
			document.all(required_fields[i]).focus();
			b_error=true;
			break;
		}
	}

	if(b_error)
	{
		alert(message1);
		return false;
	}

	for(i=0;i<email_fields.length;i++)
	{
		if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.all(email_fields[i]).value)) )
		{
			alert(message2);
			document.all(email_fields[i]).focus();
			return false;
		}
	}
}//End function Submit_Form

function CheckField(InputValue,message)
{
  if (document.all(InputValue).value == "")
  {
    alert(message);
    return false;
  }
  return true;
}

function Submit_Routing(message1,message2)
{
	var b_error=false;
	if(document.all("txt_name").value=="")
	{
		document.all("txt_name").focus();
		b_error=true;
	}
	if(document.all("txt_email_routing").value=="")
	{
		document.all("txt_email_routing").focus();
		b_error=true;
	}

	if(b_error)
	{
		alert(message1);
		return false;
	}

	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.all("txt_email_routing").value)) )
	{
		alert(message2);
		document.all("txt_email_routing").focus();
		return false;
	}

}//End function Submit_Routing

	function showGalleryImage(url, name, w, h)
	{
		var n3 = (navigator.appName.indexOf('Netscape')!=-1 && navigator.appVersion.indexOf('3.')!=-1)?true:false;
		var ww = (n3)?(parseInt(w)+15):parseInt(w);
		var wh = (n3)?(parseInt(h)+15):parseInt(h);
		var winname = (name.indexOf(' ')!=-1)?name.substring(0, name.indexOf(' ')):name;
		var wnd = window.open('', winname, 'width='+ww+',height='+(wh));
		var code = '<html><head>\n<title>'+name+'</title></head>\n'+
			   '<body bgcolor="White" marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>\n'+
			   '<div align="center"><img src='+url+' onLoad="window.moveTo((screen.width - this.width) / 2 , (screen.height - this.height) / 2); if (navigator.appName==\'Netscape\'){window.outerWidth = this.width;	window.outerHeight = this.height+75;}else window.resizeTo(this.width, this.height+75); window.focus();" name="main_img"></div></body></html>';
		wnd.document.write(code);
		wnd.document.close();
	}