 
// -----------------------------------------------------------------
// Function    : IsEmailValid
// Language    : JavaScript
// Description : Checks if given email address is of valid syntax
// Copyright   : (c) 1998 Shawn Dorman
// http://www.goodnet.com/~sdorman/web/IsEmailValid.html
// -----------------------------------------------------------------
// Ver    Date    Description of modification
// --- ---------- --------------------------------------------------
// 1.0 09/04/1996 Original write
// 1.1 09/30/1998 CHG: Use standard header format
// -----------------------------------------------------------------
// Source: Webmonkey Code Library
// (http://www.hotwired.com/webmonkey/javascript/code_library/)
// -----------------------------------------------------------------

function IsEmailValid(FormName,ElemName)
{
 return true;
var EmailOk  = true 
var Temp     = document.forms["newform"].elements["email"] 
var AtSym    = Temp.value.indexOf('@')
var Period   = Temp.value.lastIndexOf('.')
var Space    = Temp.value.indexOf(' ')
var Length   = Temp.value.length - 1   // Array is from 0 to length-1

if ((AtSym < 1) ||                     // '@' cannot be in first position
    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) ||             // Must be atleast one valid char after '.'
    (Space  != -1))                    // No empty spaces permitted
   {  
      EmailOk = false
      alert('请检查邮件信箱是否正确。')
      Temp.value="";
      Temp.focus();
   }
return EmailOk
} 

function showdiv (id) {
	var theEm = document.getElementById(id);
	if (theEm) {
		theEm.style.display = "inline";
	}
}
function hidediv (id) {
	var theEm = document.getElementById(id);
	if (theEm) {
		theEm.style.display = "none";
	}
}

function copyd(ObjName) {
  if( window.clipboardData && clipboardData.setData ) {
	clipboardData.setData("Text", document.getElementById(ObjName).value);
  }
  else {
    try {
	var holdtext = document.getElementById('holdtext');
	holdtext.value = document.getElementById(ObjName).value;
	var Copied = holdtext.createTextRange();
	Copied.execCommand("Copy");
	alert("The  link was copied to your clipboard");
    } catch (err) {
	if (window.netscape) { 
	  try {
		user_pref("signed.applets.codebase_principal_support", true);
		var clip = Components.classes['@mozilla.org/widget/clipboard;[[[[1]]]]'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) {
			alert("Please select the text and press 'Ctrl-C' to copy it instead.\n\nCopy Link will not work with your web browser.");
			return;
		}
		var trans = Components.classes['@mozilla.org/widget/transferable;[[[[1]]]]'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) {
			alert("Please select the text and press 'Ctrl-C' to copy it instead.\n\nCopy Link will not work with your web browser.");
			return;
		}
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes["@mozilla.org/supports-string;[[[[1]]]]"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=meintext;
		str.data=copytext;
		trans.setTransferData("text/unicode",str,copytext.length*[[[[2]]]]);
		var clipid=Components.interfaces.nsIClipboard;
		if (!clip) {
				alert("Please select the text and press 'Ctrl-C' to copy it instead.\n\nCopy Link will not work with your web browser.");
		return;
		}
		clip.setData(trans,null,clipid.kGlobalClipboard);
	  }
	  catch (err2) {
			alert("Please select the text and press 'Ctrl-C' to copy it instead.\n\nCopy Link will not work with your web browser.");
	  }
	}
	else 
		alert("Copy Link will not work with your web browser.\n\nPlease select the text and press 'Ctrl-C' to copy it instead.");
    }
  }
}