﻿/* 爬行蜘蛛记录 */
str = "/Robot.asp?RobotScript=" + window.location.pathname + "&RobotQuery=" + escape(window.location.search) + "&RobotUserAgent=" +navigator.userAgent;
document.write(unescape("%3Cscript src='" + str + "' type='text/javascript'%3E%3C/script%3E"));

/* google翻译 */
function tranlanguage(lang){
  thisURL = document.URL;
  tranURL = "http://translate.google.com/translate?u="+thisURL+"&sl=en&tl="+lang+"&hl=en&ie=UTF-8";
  window.open(tranURL);
}

/* Flash播放 */
function WriteFlash(FlashFile, width, height)
{
  document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=9,0,28,0\" width=\""+width+"\" height=\""+height+"\">");
  document.writeln("  <param name=\"movie\" value=\""+FlashFile+"\" \/>");
  document.writeln("  <param name=\"quality\" value=\"high\" \/>");
  document.writeln("  <param name=\"wmode\" value=\"transparent\" \/>");
  document.writeln("  <embed src=\""+FlashFile+"\" quality=\"high\" pluginspage=\"http:\/\/www.adobe.com\/shockwave\/download\/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application\/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\" wmode=\"transparent\"> <\/embed>");
  document.writeln("<\/object>")
}

/* Flash+XML播放 */
function WriteFlashXml(flashfile,xmlfile,width,height)
{
  document.writeln("<object id=\"basspop\" data=\""+flashfile+"?xml="+xmlfile+"\" type=\"application\/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\" \/>");
  document.writeln("<param name=\"movie\" value=\""+flashfile+"?xml="+xmlfile+"\" \/>");
  document.writeln("<\/object>");
}

/* 媒体播放 */
function WriteMovie(MovieFile,FileType,width,height)
{
 
  switch(FileType)
  {
    case "avi":
    case "wmv":
    case "asf":
    case "mov":
      document.writeln("<embed id=\"MediaPlayer\" src=\""+MovieFile+"\" width=\""+width+"\" height=\""+height+"\" loop=\"false\" autostart=\"true\"><\/embed>");
      break;
    case "mov":
    case  "rm":
    case  "ra":
    case "ram":
      document.writeln("<object height=\""+height+"\" width=\""+width+"\" classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\">");
      document.writeln("<param name=\"_ExtentX\" VALUE=\"12700\">");
      document.writeln("<param name=\"_ExtentY\" VALUE=\"9525\">");
      document.writeln("<param name=\"AUTOSTART\" VALUE=\"-1\">");
      document.writeln("<param name=\"SHUFFLE\" VALUE=\"0\">");
      document.writeln("<param name=\"PREFETCH\" VALUE=\"0\">");
      document.writeln("<param name=\"NOLABELS\" VALUE=\"0\">");
      document.writeln("<param name=\"SRC\" VALUE=\""+MovieFile+"\">");
      document.writeln("<param name=\"CONTROLS\" VALUE=\"ImageWindow\">");
      document.writeln("<param name=\"CONSOLE\" VALUE=\"Clip\">");
      document.writeln("<param name=\"LOOP\" VALUE=\"0\">");
      document.writeln("<param name=\"NUMLOOP\" VALUE=\"0\">");
      document.writeln("<param name=\"CENTER\" VALUE=\"0\">");
      document.writeln("<param name=\"MAINTAINASPECT\" VALUE=\"0\">");
      document.writeln("<param name=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">");
      document.writeln("</object>");
      document.writeln("<br />");
      document.writeln("<object height=\"32\" width=\""+width+"\" classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\">");
      document.writeln("<param name=\"_ExtentX\" VALUE=\"12700\">");
      document.writeln("<param name=\"_ExtentY\" VALUE=\"847\">");
      document.writeln("<param name=\"AUTOSTART\" VALUE=\"0\">");
      document.writeln("<param name=\"SHUFFLE\" VALUE=\"0\">");
      document.writeln("<param name=\"PREFETCH\" VALUE=\"0\">");
      document.writeln("<param name=\"NOLABELS\" VALUE=\"0\">");
      document.writeln("<param name=\"CONTROLS\" VALUE=\"ControlPanel,StatusBar\">");
      document.writeln("<param name=\"CONSOLE\" VALUE=\"Clip\">");
      document.writeln("<param name=\"LOOP\" VALUE=\"0\">");
      document.writeln("<param name=\"NUMLOOP\" VALUE=\"0\">");
      document.writeln("<param name=\"CENTER\" VALUE=\"0\">");
      document.writeln("<param name=\"MAINTAINASPECT\" VALUE=\"0\">");
      document.writeln("<param name=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">");
      document.writeln("</object>");
      break;
    default:
   }
}

function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
  }
}

function ShowDialog(url,width,height) {
  var arr = showModalDialog(url,window,"dialogWidth: " + width + "px; dialogHeight: " + height + "px; help: no; scroll: no; status: no");
}

function isEmail(vEMail)
{
  var regInvalid=/^[a-z0-9]([a-z0-9]*[+-_\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?$/i;
  return (regInvalid.test(vEMail));
}

function refreshimg(){
 document.getElementById("checkcodeimg").src="Include/CheckCode/CheckCode.asp?s="+Math.random();
}
//function countryChange(countrySelect) {
  //document.getElementById("countryFlagImg").src="Images/Flag/"+countrySelect.options[countrySelect.selectedIndex].value.toLowerCase()+".gif"; 
//}

