function open_win(url,popW,popH){
var   w = screen.availWidth;
var   h = screen.availHeight;
//var popW = 400, popH = 250;
var leftPos = (w-popW)/2 ;
var topPos = (screen.availHeight-popH)/2;
window.open(url,'','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',status=yes,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
// window.open(url,"","top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+(screen.width-10)+",height="+(screen.availHeight-50)+"");
}


function go(url){
		window.location=url;
	

}



//跳轉頁面顯示
function ShowPage(TotalPage,PageIndex,url){
	
if(TotalPage!=1){
//document.write("<table  cellspacing=0 cellpadding=2 ><tr ><td bgcolor=black nowarp><font color=white size=2>Page: "+PageIndex+"/"+TotalPage+"&nbsp;</td>");
document.write("<table  cellspacing=0 cellpadding=2 class=font_3_black><tr >");
if (PageIndex>1)
	document.write("<td  nowarp><a target='_self'  style='TEXT-DECORATION: underline' href=?page="+(PageIndex-1)+"&"+url+"><font color=green>上頁</a></td>");
if (PageIndex<6){PageLong=11-PageIndex;}
else
if (TotalPage-PageIndex<6){PageLong=10-(TotalPage-PageIndex)}
else{PageLong=5;}
for (var i=1; i <= TotalPage; i++) {
if (i < PageIndex+PageLong && i > PageIndex-PageLong || i==1 || i==TotalPage){
if (PageIndex==i){document.write("<td class='red_font'>&nbsp;"+ i +"&nbsp;</td>");}else{document.write("<td  >&nbsp;<a  target='_self' style='TEXT-DECORATION: underline' href=?page="+i+"&"+url+"><font color=blue>"+ i +"</a>&nbsp;</td>");}
}
}
if (PageIndex<TotalPage)
document.write("<td><a  target='_self' class='font_2_white bold' style='TEXT-DECORATION: underline' href=?page="+(PageIndex+1)+"&"+url+"><font color=green>下頁</a>&nbsp;</td>");
document.write("</tr></table>");
}
}

function getFlashVersion(){
  // ie
  try {
    try {
      // avoid fp6 minor version lookup issues
      // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
      var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
      try { axo.AllowScriptAccess = 'always'; }
      catch(e) { return '6,0,0'; }
    } catch(e) {}
    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
  // other browsers
  } catch(e) {
    try {
      if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
        return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
      }
    } catch(e) {}
  }
  return '0,0,0';
}


function writeFlash(swfPath, ID, width, height, basePath)
{

	var version = getFlashVersion().split(',').shift();
	if(version < 10){
		document.writeln("你的瀏覽器不支援 Flash 或版本太舊！<a href=\"http://get.adobe.com/tw/flashplayer/\" target=_blank>按此下載 Flash 撥放器！</a>");
		return;
	}


	var flashVars = '';
	var bgcolor = "#ffffff";

	var version="7,0,0,0";
		
	var wmode="window";
	
	var play="true";

    var idAttrib = "id=\"" + ID + "\"";
    var objectID = "";
    var embedID = "";
	if($.browser.msie)
        objectID = idAttrib;
    else
        embedID = idAttrib;
        
	document.writeln("<object " + objectID + " classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + version + "\" width=\"" + width + "\" height=\"" + height + "\" >");
	document.writeln("<param name=\"wmode\" value=\"" + wmode + "\" />");
	document.writeln("<param name=\"movie\" value=\"" + swfPath + "\" />");
	document.writeln("<param name=\"flashvars\" value=\"" + flashVars + "\" />");
	document.writeln("<param name=\"play\" value=\"" + play + "\" />");
	document.writeln("<param name=\"bgcolor\" value=\"" + bgcolor + "\" />");
	document.writeln("<param name=\"base\" value=\"" + basePath + "\" />");
	document.writeln("<PARAM name=\"allowScriptAccess\" value=\"always\">");
	document.writeln("<param name=\"menu\" value=\"false\" />");
	document.writeln("<embed " + embedID + " name=\"" + ID + "\" src=\"" + swfPath + "\"");
	document.writeln("wmode=\"" + wmode + "\"");
	document.writeln("base=\"" + basePath + "\"");
	document.writeln("menu=\"false\"");
	document.writeln("allowScriptAccess=\"always\"");
    document.writeln("flashvars=\"" + flashVars + "\"");
	document.writeln("play=\"" + play + "\"");
	document.writeln("bgcolor=\"" + bgcolor + "\"");
	document.writeln("width=\"" + width + "\"");
	document.writeln("height=\"" + height + "\"");
	document.writeln("type=\"application/x-shockwave-flash\"");
	document.writeln("PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"");	
	document.writeln("swliveconnect=true >");
	document.writeln("</embed>");
	document.writeln("<noembed>");
	document.writeln("<blockquote><font face=\"Lucida Console, Monaco, mono\" size=\"-2\">你的瀏覽器不支援 Flash 或版本太舊！<a href=\"http://get.adobe.com/tw/flashplayer/\" target=_blank>按此下載 Flash 撥放器！</a></font></blockquote>");
	document.writeln("</noembed>");
	document.writeln("</object>");
}
