﻿/*
************************
*  北美館多媒體案
*	取網址列參數
*   By Edward
*	2008/11
************************
*/
function getURLParam(Mpath,MpicPath,vFile,vFileLow,downloadPath,captionFile,preview){


//var path=Mpath.toString () +"upfiles/";
var path=Mpath .toString()+"Media/";
var pathO = MpicPath.toString() + "OnlineMedia/";
var pathI = MpicPath.toString() + "imgfile/";
var SaveName = Mpath.toString();
//說明:從網址列抓參數傳給 FLASH 判斷該讀入的圖片與路徑
//flash內無預設值
  var strReturn = "";
  //var httpText = "http://www.tfam.museum/SysUpDoc/OnlineMedia/" + vFile.replace(".flv","") + "/";
  //var httpText = "http://www.tfam.museum/SysUpDoc/OnlineMedia/" + vFile + "/";
  //alert (httpText );
  //var httpText = "http://60.251.163.100/tfam10/SysUpDoc/upfiles/" + vFile.replace(".flv","") + "/";
  var httpText =pathO + vFile.replace(".flv","") + "/";
  var httpImg = "";
  if (vFile.indexOf(".mp4") > -1){
    //httpImg = "http://www.tfam.museum/SysUpDoc/OnlineMedia/" + preview.replace(".jpg","").substring(0, 18) + "/";
    //httpImg = "http://60.251.163.100/tfam10/SysUpDoc/upfiles/" + preview.replace(".jpg","").substring(0, 18) + "/";
    //httpImg = pathO + preview.replace(".jpg","").substring(0, 18) + "/";
    httpImg =pathO  + vFile.replace(".flv","") + "/";
  }else{
    //httpImg = "http://www.tfam.museum/SysUpDoc/OnlineMedia/" + vFile.replace(".flv","") + "/";
    //httpImg = "http://60.251.163.100/tfam10/SysUpDoc/upfiles/" + vFile.replace(".flv","") + "/";
    httpImg =pathO  + vFile.replace(".flv","") + "/";
    
  }
  var strHref = window.location.href;
  //if ( strHref.indexOf("?") > -1 ){
    //var strQueryString = strHref.substr(strHref.indexOf("?")+1);
  //}else{
	//vFile = "AdobeBand_1500K_H264.mp4";
	//vFileLow = "D2-friend.flv"; //"AdobeBand_300K_H264.mp4";
	//downloadPath = "http://localhost/vod2/AdobeBand_1500K_H264.mp4";
	//captionFile = "testCaption.xml";
	//preview = "testPreview-1.png";
	if (vFileLow .indexOf(".mp4") > -1){
	  	//var strQueryString = "vFile=rtmp://media.tfam.gov.tw/vod2/mp4:" + vFile + "&vFileLow=rtmp://media.tfam.gov.tw/vod2/" + vFileLow + "&downloadPath=http://media.tfam.gov.tw/vod2/" + downloadPath + "&captionFile=" + httpText + captionFile + "&preview=" + httpImg + preview;
	  	
	  		var strQueryString = "vFile="+httpImg + vFileLow  + "&vFileLow="+path+vFile  + vFileLow + "&downloadPath="+path+ vFile  + downloadPath + "&captionFile=" +httpText +captionFile +"&preview=" + httpImg + preview;
	}else{
	  	//var strQueryString = "vFile=rtmp://media.tfam.gov.tw/vod2/" + vFile + ".flv&vFileLow=rtmp://media.tfam.gov.tw/vod2/" + vFileLow + "&downloadPath=http://media.tfam.gov.tw/vod2/" + downloadPath + "&captionFile=" + httpText + captionFile + "&preview=" + httpImg + preview;
	  	//var strQueryString = "vFile=http://60.251.163.100/tfam10/SysUpDoc/upfiles/" + vFile + ".flv&vFileLow=http://60.251.163.100/tfam10/SysUpDoc/upfiles/" + vFileLow + "&downloadPath=http://60.251.163.100/tfam10/SysUpDoc/upfiles/" + downloadPath + "&captionFile=" + httpText + captionFile + "&preview=" + httpImg + preview;
	  	//var strQueryString = "vFile="+path  + vFile + ".flv&vFileLow="+path  + vFileLow + "&downloadPath="+path  + downloadPath + "&captionFile=" + httpText + captionFile + "&preview=" + httpImg + preview;
	  	var strQueryString = "vFile="+SaveName  + vFile+".flv&vFileLow="+path  + vFileLow + "&downloadPath="+path  + downloadPath + "&captionFile=" +httpText +captionFile +"&preview=" + httpImg + preview;
	}
  //}
//alert (strQueryString);
  return strQueryString;
} 

function getLang4swf(enver){
  if (enver != "true") {
    enver = "false";
  }
  return "enver="+enver;
}

function getURLParamLow(Mpath, MpicPath, vFile, vFileLow, downloadPath, captionFile, preview) {


    //var path=Mpath.toString () +"upfiles/";
    var path = Mpath.toString() + "Media/";
    var pathO = MpicPath.toString() + "OnlineMedia/";
    var SaveName = Mpath.toString();
    var httpText = pathO + vFile.replace(".flv", "") + "/";
    var httpImg = pathO + vFile.replace(".flv", "") + "/";

    var strHref = window.location.href;
    if (vFileLow.indexOf(".mp4") > -1) {
        var strQueryString = "vFile=" + httpImg + vFileLow + "&vFileLow=" + path + vFile + vFileLow + "&downloadPath=" + path + vFile + downloadPath + "&captionFile=" + httpText + captionFile + "&preview=" + httpImg + preview;
    } else {
        var strQueryString = "vFile=" + SaveName + vFileLow + "&vFileLow=" + path + vFileLow + "&downloadPath=" + path + downloadPath + "&captionFile=" + httpText + captionFile + "&preview=" + httpImg + preview;
    }
    return strQueryString;
} 
