﻿var _w = 750;var _h = 563;
var screenWidth = 1024;

var movie;
function initial()
{
if(getOs()==0){
	movie = document.getElementById("flashgame");
	strMovieUrl = movie.Movie;
}
else{
	movie = document.getElementById("flashgame1");
	strMovieUrl = movie.src;
}
ReSize(screenWidth);
}

function getOs(){
	var agt=window.navigator.userAgent.toLowerCase();
	if(agt.indexOf("msie")>=0)return 0;
	if(agt.indexOf("firefox")>=0)return 1;
	if(agt.indexOf("opera")>=0)return 3;
	if(agt.indexOf("camino")>=0)return 4;
	if(agt.indexOf("gecko/")>=0)return 5;
	return 0;
}
function GetSize(w, h, m){
	var t;
	if(m == "w"){
		t = parseInt(_w * h/_h);
		return t;
	}else{
		t = parseInt(w * _h/_w);
		return t;
	}
}
function ReSize(strSize){
	var intNextWidth;
	var intNextHeight;

	if (_w==0){
		_w = 750
	}

	if (_h==0){
		_h = 563
	}

	switch (strSize){
	case "1280":
		intNextWidth = 1000;
		intNextHeight = GetSize(intNextWidth,728,"h");
		break;
	case "1024":
		intNextWidth = 700;
		intNextHeight = GetSize(intNextWidth,509,"h");
		break;
	case "800":
		intNextWidth = 550;
		intNextHeight = GetSize(intNextWidth,400,"h");
		break;
	case "min":
		intNextWidth = 437;
		intNextHeight = GetSize(intNextWidth,281,"h");
		break;
	default :
		intNextWidth = _w;
		intNextHeight = _h;
		break;
	}

	movie.width = intNextWidth;
	movie.height = intNextHeight;
}
function Replay(){
	var strMovieUrl;

	if(movie.PercentLoaded()==100){
		if(getOs()==0){
			strMovieUrl = movie.movie;
			movie.movie = " ";
			movie.movie = strMovieUrl;
		}
		else{
			strMovieUrl = movie.src;
			movie.src = " ";
			movie.src = strMovieUrl;
		}
	}
}
function GetUrlParam( paramName )
{
    var sValue = unescape(location.search).match(new RegExp("[\?\&]" + paramName + "=([^\&]*)(\&?)","i"));
    return sValue ? sValue[1] : sValue;
}
function soso()
{
    var key=document.getElementById('txtKey').value;
    if(key=='')
        alert('请输入搜索字符！');
    else
        location="http://www.4399yx.net/search.aspx?key="+escape(key);
    return false;
}