// JavaScript Document
function ajaxload(pn,para,Container,asyn) {
	if(Container=='') info = "資料處理中...";
	else info = "資料讀取中...";
	$('ps').innerHTML = "<font color=red>"+info+"</font>";
	if(asyn==null) asyn=true;
	//if(para=='') { alert('少傳入para參數'); return false;}
	var ajax = new Ajax.Request ( pn , {
		method:'post',
		parameters:para,
		evalScripts:true,
		asynchronous:asyn,
		onException : function (reqObj) {
			$('ps').innerHTML = "";
		} ,
		onComplete : function (reqObj) {
//			Element.update('debug',reqObj.responseText.escapeHTML()); // debug 用
//		alert(reqObj.responseText);
			if(Container!='') Element.update(Container,reqObj.responseText);
			$('ps').innerHTML = "";
		} 
		
	});
}

function changeImage(src) {
	
	var showVideo = $('showVideo');
//	var img = $('showimg');
	var show2=$('show2');
	
	if(show2.style.display == 'none') {
		var show1=$('show1');
		show2.style.display = 'block';
		show1.style.display = 'none';
//		show1.innerHTML = "";
	}
	if(showVideo!=null) showVideo.src = '';
	show2.innerHTML = "<img id=showimg src=\""+src+"\" height='450' >"; // width='600'
//	img.src = src;
}


function runSlideShow(Imgsrc){
    if (document.all) {
        document.images.mainPic.style.filter="blendTrans(duration=2)";
        document.images.mainPic.style.filter="blendTrans(duration=crossFadeDuration)";
        document.images.mainPic.filters.blendTrans.Apply();
    }
    document.images.mainPic.src =Imgsrc;
    if (document.all) {
        document.images.mainPic.filters.blendTrans.Play();
    }
}

function showObjDataVideo(src,a,b) {
	var showVideo = $('showVideo');
	var show1=$('show1');
	show1.innerHTML = "<iframe src="+src+" id='showVideo' name='showVideo' width='"+a+"' height='"+b+"' marginheight='0' marginheight='0' frameborder='0' scrolling='no'></iframe>";
	if(show1.style.display == 'none') {
		var show2=$('show2');
		show1.style.display = 'block';
		show2.style.display = 'none';
	}
}