
function search () {
    if(document.getElementById("w").value == '')
    {
    	//无数据,直接返回
    }else if ((document.getElementById("d").value == '')||(document.getElementById("d").value == 1))
    {
        top.location.href='/'+encodeURIComponent(document.getElementById("w").value)+'/';
    }else
    {
        top.location.href='/'+encodeURIComponent(document.getElementById("w").value)+'/'+document.getElementById("d").value+'/';
    }
    return false;
}


document.write("<object	classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");

document.write("	width=\"1\"");

document.write("	height=\"1\"");

document.write("	codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab\"");

document.write("	id=\"playa\"");

document.write("	style=\"position:absolute\">");

document.write("	<param name=\"movie\" value=\"\/playa.swf\">");

document.write("	<param name=\"quality\" value=\"high\">");

document.write("	<param name=\"flashvars\" value=\"autoplay=false&urlfile=\">");

document.write("	<embed");

document.write("		name=\"playa\"");

document.write("		src=\"\/playa.swf\"");

document.write("		width=\"1\"");

document.write("		height=\"1\"");

document.write("		quality=\"high\"");

document.write("		swLiveConnect=\"true\"");

document.write("		flashvars=\"autoplay=false&urlfile=\"");

document.write("		pluginspage=\"http:\/\/www.macromedia.com\/go\/flashplayer\/\"");

document.write("		style=\"position:absolute\">");

document.write("	<\/embed>");

document.write("<\/object>");

var Playa = {};

// constants
Playa.VERSION = "1.5";
Playa.STATE_STOPPED = 0;
Playa.STATE_PLAYING = 1;

// private
Playa.__isStarted = false;

// events
Playa.onPlayStop = function() {};
Playa.onPlayStart = function() {};
Playa.onStateChange = function() {};

// public properties
Playa.title = "";
Playa.playListPosition = -1;
Playa.playlistSize = -1;
Playa.path = "";
Playa.state = Playa.STATE_STOPPED;
Playa.btnState = "Loading";

/**
  * Internal function to retrieve player-object
  * @private
  */
Playa.__getPlaya = function() {
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		var p = window["playa"];
	} else {
		var p = document["playa"];
	}
	if (typeof(p) != "undefined") {
		if (p.PercentLoaded() == 100) {
			return p;
		}
	}
	return null;
};

/**
  * This is the main loop
  * @private
  */
Playa.poll = function() {
	var p = Playa.__getPlaya();
	setTimeout("Playa.poll()", 200);
	if (p != null) {
		var previousState = Playa.state;
		var previousPath = Playa.path;

		Playa.title = p.GetVariable("Response_title");
		Playa.playListPosition = parseInt(p.GetVariable("Response_playListPosition"));
		Playa.path = p.GetVariable("Response_path");
		Playa.btnState = p.GetVariable("Response_btnState");
		Playa.playlistSize = parseInt(p.GetVariable("Response_playlistSize"));

		// update state
		if (Playa.btnState == "Play") {
			Playa.state = Playa.STATE_STOPPED;
		} else if (Playa.btnState == "Stop") {
			Playa.state = Playa.STATE_PLAYING;
		}

		// trigger events
		if (Playa.state != previousState || previousPath != Playa.path) {
			if (Playa.state == Playa.STATE_STOPPED) {
				Playa.onPlayStop();
			} else {
				Playa.onPlayStart();
			}
			Playa.onStateChange();
		}
	}
};

/**
  * Starts the playa
  * @public
  */
Playa.start = function() {
	if (Playa.__isStarted) {
		return;
	}
	Playa.poll();
	Playa.__isStarted = true;
};

/**
  * Fire this event when user press the play/stop button
  * Toggles between playing/stopped state.
  * @public
  */
Playa.doPlayStop = function() {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_command", "PlayStop");
	}
};

/**
  * Starts playing, if the playback is stopped
  * @public
  */
Playa.doPlay = function() {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_command", "Play");
	}
};

/**
  * Stops playback if it's playing
  * @public
  */
Playa.doStop = function() {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_command", "Stop");
	}
};

/**
  * Fire this event when user press the next button
  * @public
  */
Playa.doNext = function() {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_command", "Next");
	}
};

/**
  * Fire this event when user press the prev button
  * @public
  */
Playa.doPrev = function() {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_command", "Prev");
	}
};

/**
  * Plays a file.
  * @param    url    String
  * @public
  */
Playa.doPlayUrl = function(sUrl) {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_args", sUrl);
		p.SetVariable("Request_command", "PlayUrl");
	}
};

/**
  * Jumps to a position in the playlist.
  * @param    index    Integer
  * @public
  */
Playa.doJump = function(nIndex) {
	var p = Playa.__getPlaya();
	if (p != null) {
		p.SetVariable("Request_args", "" + nIndex);
		p.SetVariable("Request_command", "PlayPosition");
	}
};

/*** Start processing */
Playa.start();

function pplay(c){
	var playurl;
	playurl='http://www.oldict.com/mp3/'+c.replace("wav","mp3");
	Playa.doPlayUrl(playurl);
}
function pstop(){
	Playa.doStop();
}