function reloadFrame(link,images) {
 	frames["news"].location.replace(link);
	document.getElementById('bigpic').src=images;
}
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_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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function IsNumeric(strString){
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;
   for (i = 0; i < strString.length && blnResult == true; i++){
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1){
         blnResult = false;
      }
   }
   return blnResult;
}
function IsEmpty(aTextField) {
   if ((aTextField.value.length==0) || (aTextField.value==null)) {
      return true;
   }else { return false; }
}
function checkbox(obj){
	
    if (obj.checked){
    	obj.value="yes";
		return true;
	}
	return false;
}
function checkForm(){
	var obj = document.form1;
	var msg = "";
	var correct = true;
	var chk_radio_title=false;

	for (var i=0; i < obj.radio_title.length; i++)
    {
	    if (obj.radio_title[i].checked)
		{
	      chk_radio_title = true;
	    }
    }
	with( obj ){	
		if(chk_radio_title==false){
			msg += "Title is empty!\n";
			correct = false;
		}	
		if(text_year.value=='year' || IsEmpty(text_year) ){
			msg += "year is empty!\n";
			correct = false;
		}
		else if(!IsNumeric(text_year.value)){
			msg += "Year should be in number format!\n";
			correct = false;
		}
		else if(text_year.value.length < 4){
			msg += "Please enter 4 digits for year!\n";
			correct = false;
		}			
		if(IsEmpty(text_person)){
			msg += "Number of person is empty!\n";
			correct = false;
		}	
		else if(!IsNumeric(text_person.value)){
			msg += "Number of person should be in number format!\n";
			correct = false;
		}		
		if(IsEmpty(text_name)){
			msg += "Name is empty!\n";
			correct = false;
		}			
		if(IsEmpty(text_email)){
			msg += "Email is empty!\n";
			correct = false;
		}else{
			if(text_email.value.indexOf("@") == -1 || text_email.value.indexOf(".") == -1){
				msg += " Invaild Email! (e.g., xxx@yyy.com)\n";
				correct = false;
			}
		}
		if(IsEmpty(text_mobile)){
			msg += "Mobile is empty!\n";
			correct = false;
		}			
	}
	if (correct) {
		document.form1.submit();
	}
	else
		alert(msg);
}
function renew(){
	var obj = document.form1;
	for (var i=0; i < obj.radio_title.length; i++)
    {
	    obj.radio_title[i].checked=false;
    }
	with( obj ){	
		select_day.value=1;
		select_month.value='January';
		text_year.value='year';
		select_time.value='1:00'
		select_period.value='AM';
		text_person.value='';
		text_name.value='';
		text_email.value='';
		text_mobile.value='';	
		texta_remark.value='';		
	}
}

