//彈出警告視窗後連結指定網址
function alerthref(msg,url){
	alert(msg);
	location.href= url;
}

//彈出確認視窗後連結指定網址
function confhref(msg,url){
	conf = confirm(msg);
	if (conf){
		location.href= url;
	}
}

//彈出式視窗
function jsopen(url,w,h,x,y,full,menu,tool,loc,stat,scl,resize){
	if (w ==""){
		w = "640"
	}
	if (h ==""){
		h = "480"
	}
	if (x ==""){
		x = "center"
	}
	if (y ==""){
		y = "center"
	}
	if (x =="center"){
		x = (screen.width - w)/2;
	}  
	if (y =="center"){
		y = (screen.height - h)/2;
	}
	winstatus = "width="+w+",height="+h+",top="+x+",left="+y
	if (full =="1"){
		winstatus = winstatus+",fullscreen=yes"
	}
	if (menu =="1"){
		winstatus = winstatus+",menubar=yes"
	}
	if (tool =="1"){
		winstatus = winstatus+",toolbar=yes"
	}
	if (loc =="1"){
		winstatus = winstatus+",location=yes"
	}
	if (stat =="1"){
		winstatus = winstatus+",status=yes"
	}
	if (scl =="1"){
		winstatus = winstatus+",scrollbars=yes"
	}
	if (resize =="1"){
		winstatus = winstatus+",resizable=yes"
	}
	window.open(url,"",winstatus);
}

//Image alpha change
function imgalpha(img,value) {

	img.filters.alpha.opacity = value;
	
}

//全選刪除JS

function ToggleAll(e){
	if (e.checked) {
	    CheckAll();
	}
	else {
	    ClearAll();
	}
    }

function CheckAll(){
	var ml = document.form1;
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
	    if (e.name == "dels") {
		e.checked = true;
	    }
	}
}

function ClearAll(){
	var ml = document.form1;
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
	    if (e.name == "dels") {
		e.checked = false;
	    }
	}
}