<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function OpenWindow(filename,cname,cheight,cwidth)
{
var csize ='width=' + cwidth + ',height=' + cheight + ',scrollbars';
var newWindow = window.open(filename,cname,csize); 
}


//----------------------------------------------
//校验上传图片的属性，例如文件名，文件名称
//----------------------------------------------
function checkvalues0()
{ 
  if (document.Form.remark!=null)
  {
  if (document.Form.remark.value.length==0)
      {
	  document.Form.remark.focus();
	  alert("请填写作品名称.");
	  return false;
	  }
  }
  if (document.Form.Filename!=null)
  {
  if (document.Form.Filename.value.length==0)
      {
	  document.Form.Filename.focus();
	  alert("请选择上传图片");
	  return false;
	  }
  if (document.Form.Filename.value.length==0)
      {
	  document.Form.Filename.focus();
	  alert("请选择上传图片");
	  return false;
	  }	  
  }

  return true;
 }
//------------------------------------------------
 function CheckUploadImag()
{
  if(checkvalues0())
  {
    document.Form.submit()
  }
}
//function end
//--------------------------------------------------
//----------------------------------------------
//校验装修提交信息
//----------------------------------------------
function checkvalues1()
{ 
  if (document.Form.phone!=null)
  { 
  if (document.Form.phone.value.length==0||isNaN(document.Form.phone.value))
      {
	  document.Form.phone.focus();
	  alert("请检查电话号码是否正确");
	  return false;
	  }
  if (document.Form.phone.value.length>20)
      {
	  document.Form.phone.focus();
	  alert("电话号码不能超过20位.");
	  return false;
	  }	  
  }
  if (document.Form.email!=null)
  {
  if (document.Form.email.value.length==0)
      {
	  document.Form.email.focus();
	  alert("请填写Email地址。");
	  return false;
	  }
  }  
  if (document.Form.sTitle!=null)
  {
  if (document.Form.sTitle.value.length==0)
      {
	  document.Form.sTitle.focus();
	  alert("请填写标题。");
	  return false;
	  }
  }    
  if (document.Form.sArea!=null)
  { 
  if (document.Form.sArea.value.length==0||isNaN(document.Form.sArea.value))
      {
	  document.Form.sArea.focus();
	  alert("请检查面积是否正确，且确保面积是数字。");
	  return false;
	  }	  
  }
  if (document.Form.fitment_day!=null)
  { 
  if (document.Form.fitment_day.value.length==0||isNaN(document.Form.fitment_day.value))
      {
	  document.Form.fitment_day.focus();
	  alert("请检查天数是否正确，且确保天数是数字。");
	  return false;
	  }	  
  }
  if (document.Form.sMoney!=null)
  { 
  if (document.Form.sMoney.value.length==0||isNaN(document.Form.sMoney.value))
      {
	  document.Form.sMoney.focus();
	  alert("请检查预算是否正确，且确保预算不超出范围。");
	  return false;
	  }	  
  }  
  if (document.Form.remark!=null)
  {
  if (document.Form.remark.value.length==0)
      {
	  document.Form.remark.focus();
	  alert("请填写留言。");
	  return false;
	  }
  }    
  return true;
 }
//------------------------------------------------
 function CheckFitmentSubmit()
{
  if(checkvalues1())
  {
    document.Form.submit()
  }
}
//function end
//--------------------------------------------------
