function checkGuestForm(form)
{
	
	//alert(checkemail());
	if(checkemail())
	{
		form.psubmit.disabled=true;
	}
	else
	{
		alert("�����ʽ���ԣ�");
		return false;
	}
}
function checkemail()
{
	var email = $("#email").val();
	if (email != "") {
		var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
		if (reg.test(email))
		{
			//$('#emailstatus').html("<img src='/images/check_right.gif'>");
			return true;
		}
	}
	//$('#emailstatus').html("<img src='/images/check_error.gif'>$l_user[notemail]");
	$("#email").focus();
	return false;
}
function showpophrefwindow(title,url,frame,width,height)
{
	if (width==0)
	{
		width = Math.floor($(window).width() / 1.5);
	}
	if (height==0)
	{
		height = Math.floor($(window).height() / 1.5);
	}
	var diag = new Dialog();
	diag.Width = width;
	diag.Height = height;
	diag.Title = title;
	diag.URL = url;
	diag.show();
	if(isIE6)
	{
		diag.innerFrame.contentWindow.location.href=url;
	}
}
function showpophrefwindow_bak(title,url,frame,width,height)
{
	//alert(title);
	if (width==0)
	{
		width = Math.floor($(window).width() / 1.5);
	}
	if (height==0)
	{
		height = Math.floor($(window).height() / 1.5);
	}
	
	var left = ($(document.documentElement).width()- width)/2,
		top = ($(window).height() - height)/2,
		controller = $('<div title="'+title+'"><div style="width:100%;height:100%;position:relative;"><img src="images/loading.gif" style="position:absolute;top:45%;left:45%;"/></div></div>').dialog({
			width:width,
			height:height,
			//modal:true,
			resizable:false,
			draggable:false,
			open:function(){
				var box = $('.ui-dialog').css({
						'position':'fixed',
						'left':	left,
						'top': top
//'position':'absolute',
//'bottom':'auto',
//'top':top
				});						
				if (!$.browser.msie) {
					box.css({opacity:0,
						top: -height
					}).animate({
							opacity:1,
							top:top + 30			
					},330).animate({
							top:top		
					},270);						
				}
			},											
			beforeclose:function(){
				if ($.browser.msie) {
					$('#xhePanel').hide();
					controller.dialog('destroy').remove();
					overlay.remove();					
				}else{
					controller.css('opacity',0);
					var box = $('.ui-dialog');
					box.animate({
						opacity:0,
						top: -height			
					},450,function(){
							$('#xhePanel').hide();
							controller.dialog('destroy').remove();
							overlay.animate({opacity:0},50,function(){
								overlay.remove();
							});													
					});							
				}
				return false;
			},
			zIndex:10002
		});
		

	var overlay=overlayDialog(10001).click(function(){
		controller.dialog('close');
	});
	
	if(url){
		if(frame){
			controller.html('<iframe id="newsappend" width="100%" height="'+(height-100)+'" frameborder="no" marginheight="1" marginwidth="0" border="0" src="'+url+'"/>');
		}else{
			controller.load(url);
		}
	}
}
function overlayDialog(zindex)
{
	var width = $(document.documentElement).width(),
	height = $(document).height();
	return $('<div class="ui-widget-overlay" style="z-index:'+zindex+';width:'+width+'px;height:'+height+'px;"/>').appendTo(document.body);
}

