<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments,d;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { 
	  p=val.indexOf('@');
	  d=val.indexOf('.');
        if (p<1 || p==(val.length-1)||val.substring(p+1,val.length).indexOf('@')!=-1||d<1||d==(val.length-1)||p>d) 
	  errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } 
  while(errors.indexOf('add')!=-1) errors=errors.replace('add','');
  if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function checkpassword(a,b)//检查两次输入密码是否一致
{
	var errors='';
	if (MM_findObj(a).value!=MM_findObj(b).value)	errors='The passwords you entered are not match.\n';
	if (MM_findObj(a).value.length<6) errors += 'Password must contain 6 characters at least.\n';
	if (errors) alert('The following error(s) occurred:\n'+errors);
	document.cpvalue=(errors=='');
}


function createeventcheck()
{
	with (document.form1.category)
	if(options[selectedIndex].value=='') 
	{
		alert('Please select a category.\n');
		document.createeventcheckvalue=false;
	}else
	document.createeventcheckvalue=true;
}

var where = new Array(6); 
function comefrom(loca,locacity) { this.loca = loca; this.locacity = locacity; } 
where[0]= new comefrom("United States","Any|Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Washington DC|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming");
where[1]= new comefrom("Canada","Any|Ontario|Alberta|Prince Edward|Newfoundland|British Columbia|Nunavut|Manitoba|Nova Scotia|New Brunswick|Saskatchewan|Quebec|Yukon");
where[2]= new comefrom("United Kingdom","Any|East|Home Counties|London|Midlands|Northeast|Northern Ireland|Northwest|Scotland|South|Southwest|Wales|Guernsey|Isle Of Man|Jersey|Shetland");
where[3]= new comefrom("Australia","Any|Australian Capital Territory|New South Wales|Northern Territory|Queensland|South Australia|Tasmania|Vctoria|Western Australia|Victoria");
where[4]= new comefrom("Hong Kong","Any|Central And Western|Eastern|Islands|Kowloon City|Kwai Tsing|Kwun Tong|North|Sai Kung|Sha Tin|Sham Shui Po|Southern|Tai Po|Tsuen Wan|Tuen Mun|Wan Chai|Wong Tai Sin|Yau Tsim Mong|Yuen Long");
where[5]= new comefrom("Singapore","Any|East|North|South|West");
where[6]= new comefrom("Denmark","All");
where[7]= new comefrom("DoDDs Schools","All");
where[8]= new comefrom("Finland","All");
where[9]= new comefrom("Netherlands","All");
where[10]= new comefrom("New Zealand","All");
where[11]= new comefrom("Sweden","All");
where[12]= new comefrom("Norway","All");

function init(country, state, wh) {
	with (country) {
		length = wh.length;
		for (k = 0; k < wh.length; k++) {
			options[k].text = wh[k].loca;
			options[k].value = wh[k].loca;
		}
	}
	with (state) {
		loca3 = (wh[0].locacity).split("|");
		length = loca3.length;
		for (l = 0; l < length; l++) {
			options[l].text = loca3[l];
			options[l].value = loca3[l];
		}
	}
}

function select(country, state, wh) {
	with (state) {
		j = length;
		
		for (i = 0; i < j; i++) {
			remove(0);
		}
	}
	var eItem;
	with (country) {
		var loca2 = options[selectedIndex].value;
		
	}
	for (i = 0; i < wh.length; i++) {
		if (wh[i].loca == loca2) {
			
			loca3 = (wh[i].locacity).split("|");
			
			for (j = 0; j < loca3.length; j++) {
				with (state) {
					eItem = document.createElement("OPTION");
					add(eItem);
					eItem.innerText = loca3[j];
					eItem.value = loca3[j];
					
					selectedIndex = length - 1;
				}
				
			}
			if(loca3.length>0){
				with (state) {
					eItem = document.createElement("OPTION");
					add(eItem);
					eItem.innerText = loca3[0];//add any
					eItem.value = loca3[0];
					selectedIndex = length - 1;
				}
			}
			break;
		}
	}
	if (i >= wh.length) {
		state.disabled = true;
	} else {
		state.disabled = false;
	}
}

function checkBlogCat(a) {
	with (document.form1) {
		if (a.options[a.selectedIndex].value == "") {
			alert("Please select a category.\n");
			document.cBC = false;
		} else {
			document.cBC = true;
		}
	}
}

function checkfile(file1)
{
	var x=file1.value.substring(file1.value.indexOf("."));
	x=x.toLowerCase();
	if(x.indexOf("gif")!=-1 || x.indexOf("jpg")!=-1)
	{
		return true;
	}
	else
	{
		alert("err:Please select a gif or jpg file.");
		 return false;
	}
}


function chdata(fo,year,month,day)
{
var i=1;
	if(month.options[month.options.selectedIndex].value==4 || month.options[month.options.selectedIndex].value==6 || month.options[month.options.selectedIndex].value==9 ||month.options[month.options.selectedIndex].value==11)
	{
			for(i;i<34;i++)
				day.options.remove(0);
			i=1;
			for(i;i<31;i++)
				day.options.add(new Option(i,i)); 	

			
	}
	else
	{
		if(month.options[month.options.selectedIndex].value!=2)
		{
				 for(i;i<34;i++)
					day.options.remove(0);
				 i=1;
			     for(i;i<32;i++)
					day.options.add(new Option(i,i)); 	
		}
		else
		{
			if(isLeapYear(year.options[year.options.selectedIndex].value))
			{
				 for(i;i<34;i++)
				 	day.options.remove(0);
				 i=1;
			     for(i;i<30;i++)
					day.options.add(new Option(i,i)); 	
			}
			else
			{
				 for(i;i<34;i++)
				 	day.options.remove(0);
				 i=1;
			     for(i;i<29;i++)
					day.options.add(new Option(i,i)); 	
			}
		}

		
	}
	

	
	

}

//判断是否为润年
function isLeapYear(year){
  if(year%100==0){
    if(year%400==0){
      return true;
    }
  }
else if(year%4==0){
  return true;
}
return false;
}

function Years(fo,year,month,day)
{
	if(isLeapYear(year.options[year.options.selectedIndex].value))
	{
			
	}
	else
	{
		if(month.options[month.options.selectedIndex].value==2)
		{
			if(day.options.length>28)
			{
				return true;
			}
		}
	}
}

function selectCombo(a,b)
{
	for (i=0;i<a.length;i++)
	{
		if (a.options[i].value==b)
		{
			a.options.selectedIndex=i;
			break;
		}
	}
	
}

//是否为浮点数
function numValidate(str) {
	var num="0123456789.-";
  	var tempchar="";
  	for(i=0;i<str.length;i++) {
		tempchar=str.charAt(i);
		if(num.indexOf(tempchar)==(-1))
			return (false);
 	}
  	return true;
}
//-->

