﻿function createxmlDoc()
{
var xmlDoc;
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    xmlDoc=document.implementation.createDocument("","",null);
    }
  catch(e)
    {
    alert(e.message);
    return;
    }
  }
xmlDoc.async=false;
return xmlDoc ;
}

function createxmlHttp(){
　　var xmlhttp_request = false;
　　　try{

　　if( window.ActiveXObject ){

　　for( var i = 5; i; i-- ){

　　try{

　　if( i == 2 ){

　　xmlhttp_request = new ActiveXObject( "Microsoft.XMLHTTP" );

　　}else{

　　xmlhttp_request = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );

　　xmlhttp_request.setRequestHeader("Content-Type","text/xml");

　　xmlhttp_request.setRequestHeader("Content-Type","gb2312");

　　}

　　break;}

　　catch(e){

　　xmlhttp_request = false;

　　}

　　}

　　}else if( window.XMLHttpRequest ){

　　xmlhttp_request = new XMLHttpRequest();

　　if (xmlhttp_request.overrideMimeType) {

　　xmlhttp_request.overrideMimeType('text/xml');

　　}

　　}

　　}catch(e){

　　xmlhttp_request = false;

　　}

　　return xmlhttp_request ;

　}　
var xmlhttp=createxmlHttp();
function Request(method,url,flag,callback,content)
{
xmlhttp.open(method,url,flag);
xmlhttp.onreadystatechange=callback;
xmlhttp.send(content);
}
//加载项
function LoadSelectItem(obj,xml)
{
var option=document.createElement("option");
option.value ="";
option.text ="请选择";
document.getElementById (obj).options.add(option);
if(xml=="")
{
return ;
}
var list=new Array();
list=xml.split(";");

for(var i=0;i<list.length;i++)
{
var v=list[i].split(",");
var option=document.createElement("option");
option.value=v[0];
option .text=v[1];
document.getElementById (obj).options.add(option);
}
}
function handlexml(xml)
{
var list=new Array();
list=xml.split(";");
return list ;
}
function handlearray(item)
{
var array=new Array()
array=item.split(",");
return array;
}
function insertFlash(elm,url, w, h) {
url="./flash/"+url ;
if (!document.getElementById(elm)) return;
var str = '';
str += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
str += '<param name="movie" value="'+ url +'">';
str += '<param name="wmode" value="opaque">';
str += '<param name="quality" value="autohigh">';
str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
str += '</object>';
document.getElementById(elm).innerHTML = str;
}
function writeFlash(flashURL,flashWIDTH,flashHEIGHT){
	document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>'); 
	document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">'); 
	document.writeln ('<PARAM NAME=wmode VALUE=transparent>'); 
	document.writeln ('<PARAM NAME=loop VALUE=true>'); 
	document.writeln ('<PARAM NAME=quality VALUE=high>'); 
	document.writeln ('<PARAM NAME=menu VALUE=false>'); 
	document.writeln ('<EMBED src="'+flashURL+'" wmode="transparent" loop=true wmode=opaque quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'); 
	document.writeln ('</OBJECT>');
}
