function validateEmail(url,email)
{


  $isEmail=checkEmail(email);
  if(!$isEmail)
  {
	   ShowInfo('<span style="font-size:12px; color:#999999">Invaliable mail format, please enter again</span>'); 
	   return false;
  }
  else
  {
    saveEmail(url,email);
	return false;
  }
}

function checkEmail(email)
{
  if(!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(email)) 
  { 
   
    return false; 
  }
  else
  {
	  return true;
  }
}

function saveEmail(url,email)
{
  var url = url+"&email="+email;
  g_pop=new Popup({ contentType:1,isReloadOnClose:false,scrollType:false,width:300,height:80});
  g_pop.setContent("title","Submitted successfully!");
  g_pop.setContent("contentUrl",url);
  g_pop.build();
  g_pop.show();
}

function ShowInfo(str)
{
  g_pop=new Popup({ contentType:4,isReloadOnClose:false,width:340,height:80});
  g_pop.setContent("title","System");
  g_pop.setContent("alertCon",'<span style="font-size:12px; color:#999999">'+str+'</span');
  g_pop.build();
  g_pop.show();	
}

function Post(str)
{
  g_pop=new Popup({ contentType:3,isReloadOnClose:false,width:340,height:80});
  g_pop.setContent("title","System");
  g_pop.setContent("confirmCon","Are you sure to submit?");
  g_pop.setContent("callBack",delCallback);
  g_pop.setContent("parameter",{fid:str,popup:g_pop});
  g_pop.build();
  g_pop.show();
  return false;
}

function delCallback(para)
{
	var o_pop=para["popup"];
	o_pop.config.contentType=1;
	o_pop.setContent("contentUrl","");
	o_pop.reBuild();
	eval("document."+para["fid"]).target=o_pop.iframeIdName;
	eval("document."+para["fid"]).submit();
	return false;
}
