function favorite(){
if (document.all){
window.external.AddFavorite('http://www.sistylensp.com','矽世代─天然奈米矽土美妝保養清潔用品');
}else if(window.sidebar){
window.sidebar.addPanel('http://www.sistylensp.com','矽世代─天然奈米矽土美妝保養清潔用品','');
}
}

function pop(url,catelog,inter){
window.open(url,catelog,inter);
}

function pop_close(){
windwo.close();
}

function CheckDelete(url){
var x=window.confirm('刪除後將無法回復，您確定要刪除？');
if(x)
window.location=url;
}

function blink(id){
document.getElementById(id).style.backgroundColor="#FFF";
document.getElementById(id).style.color="#333";
}

function darker(id){
document.getElementById(id).style.backgroundColor="#EEE";
document.getElementById(id).style.color="#999";
}

function submit(id){
document.getElementById(id).submit();
}

function citychange(id) {
	var i = window.document.getElementById(id).area.selectedIndex;//選擇的縣市
	window.document.getElementById(id).area02.length = cityarea_account[i] - cityarea_account[i-1];//鄉鎮市區選項數量
	var index = cityarea_account[i-1] + 1;//開始的編號
	window.document.getElementById(id).area02.options[0].selected=true;
	for (j = 0; j < window.document.getElementById(id).area02.length; j ++) {
		window.document.getElementById(id).area02.options[j].value = cityarea[index + j];
		window.document.getElementById(id).area02.options[j].text = cityarea[index + j];
	}
}

function zipcode_change(id){
var i = window.document.getElementById(id).area.selectedIndex;//選擇的縣市
var j=window.document.getElementById(id).area02.selectedIndex;//選擇的鄉鎮市區
var index = cityarea_account[i-1]+1;//開始的編號
var k=index+j;
window.document.getElementById(id).zipcode.value=zipcode[k];
}

  function getCaptcha() {       // 讓使用者可更換圖案
    var d = new Date();
    document.getElementById("captchaImage").
      setAttribute('src' , 'captcha/captcha.php?r='+ d.getTime());
  }



//全選函式
function select_all(formName, elementName, selectAllName) {
  elem = document.forms[formName].elements[elementName];
  if(!elem) // 若找不到元素
    return;
  else if(elem.length!= null) // 若網頁列出多個產品 (elem 是陣列)
    for(var i = 0; i < elem.length; i++)
      elem[i].checked =
        document.forms[formName].elements[selectAllName].checked;
  else
    elem.checked =
        document.forms[formName].elements[selectAllName].checked;
}

function chk_member(){
var ask=window.confirm('是否加入會員？');
if(ask==false){
return true;
}else{
location.href="../member-rights.php";
return false;
}
}

function chk_licensed(){
var alt=window.alert('必須認證您的E-mail才能累積您的點數，未認證前您的消費點數將不會累積！');
return true;
}

//改數量即勾選函式
function check(form,name,count){
elem = document.forms[form].elements[name];
if(elem.length!=null){
document.forms[form].elements[name][count].checked=true;
}else{
document.forms[form].elements[name].checked=true;
}
}

function go(url){
window.location=url;
}


