var xmlHttp;
function createXHR(){
        if(window.XMLHttpRequest){
                xmlHttp = new XMLHttpRequest();
        }else if(window.Activexobject){
                xmlHttp = new activexobject("Microsoft.XMLHTTP");
        }
        if(!xmlHttp){
                alert('您使用的瀏覽器不支援XMLHTTP物件');
        return false;
        }
}
function catchStatus(){
        if(xmlHttp.readyState == 4){
                if(xmlHttp.status == 200){
			var container = document.getElementById('video_cover');
			container.innerHTML = xmlHttp.responseText;
                }else{
                        alert(xmlHttp.status);
                }
        }
}

function changeMovie(id){
        createXHR();
        var url='getYoutubeCode.php?id='+id;
        xmlHttp.open('GET',url,true);
	xmlHttp.onreadystatechange = catchStatus;
        xmlHttp.send(null);
}

