   function look1(){
     var now=new Date(); 
	 now=now.getTime(); 
	 var ind=document.form_one.picture1.selectedIndex;  
	 if (ind > 0){
	   ind=document.form_one.picture1.options[ind].value;               msgWindow=window.open('../picture/' + ind , now , 'toolbar=yes,width=550,height=400,directories=no,status=no,scrollbars=yes,resizeable=no,menubar=no');
	 }else{
	   alert('未選擇圖片'); 
	 }
   }
   
   function check_add_save(){
		 if(document.form_one.inputmail.value==""){
			alert(document.form_one.alertword.value);
		 }
		 else{
			document.form_one.index.value="add_save"; 
			document.form_one.submit();
		 }
   }

   function add_save(){
		document.form_one.index.value="add_save"; 
		document.form_one.submit();
   }

   function check_modify_save(){
		if(document.form_one.ans.value==""){
			alert(document.form_one.input_ans.value);
		}
		else{
			document.form_one.index.value="modify_save"; 
			document.form_one.submit(); 
		}
   }

   function modify_save(){
		document.form_one.index.value="modify_save"; 
		document.form_one.submit(); 
   }

   function del(){
     if (confirm('是否確定刪除？')){
	   document.form_one.index.value='del';  
	   document.form_one.submit();
	 } 
   }
   
   function look(arg1,arg2){
     var now=new Date();  
	 now=now.getTime();
	 msgWindow=window.open('/picture/' + arg2 + '/' + arg1 , now ,'toolbar=yes,width=400,height=280,directories=no,status=no,scrollbars=yes,resizable=yes');
   }
   
   function server(arg1,arg2,arg3){
     var now=new Date(); 
	 now=now.getTime();  
	 msgWindow=window.open('_server1.php?picture=' + arg1 + '&upath=' + arg2+ '&what_lang=' + arg3 , now , 'toolbar=yes,width=800,height=600,directories=no,status=no,scrollbars=yes,resizable=yes');
   }
   
   function upload(arg1,arg2){
     var now=new Date();  
	 now=now.getTime();    
	 msgWindow=window.open('_upload1.php?picture=' + arg1 + '&upath=' + arg2 , now , 'toolbar=yes,width=420,height=180,directories=no,status=no,scrollbars=yes,resizable=yes');
   } 
   
   function adserver(arg1,arg2){
     var now=new Date(); 
     now=now.getTime();   
     msgWindow=window.open('_adserver1.php?picture=' + arg1 + '&upath=' + arg2 , now , 'toolbar=yes,width=420,height=150,directories=no,status=no,scrollbars=yes,resizable=yes'); 
   } 
   
   function adupload(arg1,arg2){
     var now=new Date();   
	 now=now.getTime(); 
	 msgWindow=window.open('_adupload1.php?picture=' + arg1 + '&upath=' + arg2 , now , 'toolbar=yes,width=420,height=180,directories=no,status=no,scrollbars=yes,resizable=yes');
   }        

    // name is a string of the name of your cookie

// value is the value corresponding to name

function SetCookie(name, value) {

 var expString = "; expires=" + never.toGMTString();

 document.cookie = name + "=" + escape(value) + expString;

}



// returns value of cookie or null if cookie does not exist

function GetCookie(name) {

 var result = null;

 var myCookie = " " + document.cookie + ";";

 var searchName = " " + name + "=";

 var startOfCookie = myCookie.indexOf(searchName);

 var endOfCookie;

 if (startOfCookie != -1) {

  startOfCookie += searchName.length; // skip past name of cookie

  endOfCookie = myCookie.indexOf(";", startOfCookie);

  result = unescape(myCookie.substring(startOfCookie, endOfCookie));

 }

 return result;

}



//use_cookies = "unsure";

use_cookies = "yes";



function saveValue(element) {

/* if (document.images && use_cookies == "unsure")

  use_cookies = (confirm("Will you allow the values you enter into this form "

   +"to be stored as cookies so that those values will be pre-filled the next "

   +"time you return to this page?") ? "yes":"no"); */

 if (document.images && use_cookies == "yes") {

  if ((element.type == "text")

  || (element.type == "password")

  || (element.type == "textarea")

  || (element.type == "radio")) {

   val = element.value;

  } else if (element.type.indexOf("select") != -1) {

   val = "";

   for(k=0;k<element.length;k++)

    if (element.options[k].selected)

     val += k+" ";

  } else if (element.type == "checkbox") {

   val = element.checked;

  }

  SetCookie("memory_"+element.form.name+"_"+element.name,val);

 }

}



function storedValues() {

 if (document.images) { // only do it in JavaScript 1.1 browsers

  for (i=0;i<document.forms.length;i++) {

   for (j=0;j<document.forms[i].elements.length; j++) {

    cookie_name = "memory_"+document.forms[i].name+"_"

     +document.forms[i].elements[j].name;

    val = GetCookie(cookie_name);

    if (val) {

     if ((document.forms[i].elements[j].type == "text")

     || (document.forms[i].elements[j].type == "password")

     || (document.forms[i].elements[j].type == "textarea")) {

      document.forms[i].elements[j].value = val;

     } else if (document.forms[i].elements[j].type.indexOf("select") != -1) {

      document.forms[i].elements[j].selectedIndex = -1;

      while (((pos = val.indexOf(" ")) != -1) && (val.length > 1)) {

       sel = parseInt(val.substring(0,pos));

       val = val.substring(pos+1,val.length);

       if (sel < document.forms[i].elements[j].length)

        document.forms[i].elements[j].options[sel].selected = true;

      }

     } else if (document.forms[i].elements[j].type == "checkbox") {

      document.forms[i].elements[j].checked = val;

     } else if (document.forms[i].elements[j].type == "radio") {

      if (document.forms[i].elements[j].value == val)

       document.forms[i].elements[j].checked = true;

     }

    }

   }

  }

 }

}
