﻿// JScript 文件
//代码开始
/*function writeflashhtml( arg )
{
    var parm = []
    var _default_version = "8,0,24,0";
    var _default_quality = "high";
    var _default_align = "middle";
    var _default_menu = "false";

    for(i = 0; i < arguments.length; i ++)
    {
        parm[i] = arguments[i].split(' ').join('').split('=')
        for (var j = parm[i].length-1; j > 1; j --){
            parm[i][j-1]+="="+parm[i].pop();
        }
        switch (parm[i][0])
        {
            case '_version' : var _version = parm[i][1] ; break ; 
            case '_swf' : var _swf = parm[i][1] ; break ; 
            case '_base' : var _base = parm[i][1] ; break ; 
            case '_quality' : var _quality = parm[i][1] ; break ; 
            case '_loop' : var _loop = parm[i][1] ; break ; 
            case '_bgcolor' : var _bgcolor = parm[i][1] ; break ; 
            case '_wmode' : var _wmode = parm[i][1] ; break ; 
            case '_play' : var _play = parm[i][1] ; break ; 
            case '_menu' : var _menu = parm[i][1] ; break ; 
            case '_scale' : var _scale = parm[i][1] ; break ; 
            case '_salign' : var _salign = parm[i][1] ; break ; 
            case '_height' : var _height = parm[i][1] ; break ; 
            case '_width' : var _width = parm[i][1] ; break ; 
            case '_hspace' : var _hspace = parm[i][1] ; break ; 
            case '_vspace' : var _vspace = parm[i][1] ; break ; 
            case '_align' : var _align = parm[i][1] ; break ; 
            case '_class' : var _class = parm[i][1] ; break ; 
            case '_id' : var _id = parm[i][1] ; break ; 
            case '_name' : var _name = parm[i][1] ; break ; 
            case '_style' : var _style = parm[i][1] ; break ; 
            case '_declare' : var _declare = parm[i][1] ; break ; 
            case '_flashvars' : var _flashvars = parm[i][1] ; break ; 
            case '_elm' : var _elm = parm[i][1] ; break ; 

            default :;
        }
    }
    
    var thtml = ""
    thtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + ((_version)?_version:_default_version) + "'"
    if(_width) thtml += " width='" + _width + "'"
    if(_height) thtml += " height='" + _height + "'"
    if(_hspace) thtml += " hspace='" + _hspace + "'"
    if(_vspace) thtml += " vspace='" + _vspace + "'"
    if(_align) thtml += " align='" + _align + "'"
    else thtml += " align='" + _default_align + "'"
    if(_class) thtml += " class='" + _class + "'"
    if(_id) thtml += " id='" + _id + "'"
    if(_name) thtml += " name='" + _name + "'"
    if(_style) thtml += " style='" + _style + "'"
    if(_declare) thtml += " " + _declare
    thtml += ">"
    if(_swf) thtml += "<param name='movie' value='" + _swf + "'>"
    if(_quality) thtml += "<param name='quality' value='" + _quality + "'>" 
    else thtml += "<param name='quality' value ='" + _default_quality + "'>"
    if(_loop) thtml += "<param name='loop' value='" + _loop + "'>"
    if(_bgcolor) thtml += "<param name='bgcolor' value='" + _bgcolor + "'>"
    if(_play) thtml += "<param name='play' value='" + _play + "'>"
    if(_menu) thtml += "<param name='menu' value='" + _menu + "'>"
    else thtml += "<param name='menu' value='" + _default_menu + "'>"
    if(_scale) thtml += "<param name='scale' value='" + _scale + "'>"
    if(_salign) thtml += "<param name='salign' value='" + _salign + "'>"
    if(_wmode) thtml += "<param name='wmode' value='" + _wmode + "'>"
    if(_base) thtml += "<param name='base' value='" + _base + "'>"
    if(_flashvars) thtml += "<param name='flashvars' value='" + _flashvars + "'>"
    thtml += "<embed pluginspage='http://www.macromedia.com/go/getflashplayer'"
    if(_width) thtml += " width='" + _width + "'"
    if(_height) thtml += " height='" + _height + "'"
    if(_hspace) thtml += " hspace='" + _hspace + "'"
    if(_vspace) thtml += " vspace='" + _vspace + "'"
    if(_align) thtml += " align='" + _align + "'"
    else thtml += " align='" + _default_align + "'"
    if(_class) thtml += " class='" + _class + "'"
    if(_id) thtml += " id='" + _id + "'"
    if(_name) thtml += " name='" + _name + "'"
    if(_style) thtml += " style='" + _style + "'"
    thtml += " type='application/x-shockwave-flash'"
    if(_declare) thtml += " " + _declare 
    if(_swf) thtml += " src='" + _swf + "'"
    if(_quality) thtml += " quality='" + _quality + "'"
    else thtml += " quality='" + _default_quality + "'"
    if(_loop) thtml += " loop='" + _loop + "'"
    if(_bgcolor) thtml += " bgcolor='" + _bgcolor + "'"
    if(_play) thtml += " play='" + _play + "'"
    if(_menu) thtml += " menu='" + _menu + "'"
    else thtml += " menu='" + _default_menu + "'"
    if(_scale) thtml += " scale='" + _scale + "'"
    if(_salign) thtml += " salign='" + _salign + "'"
    if(_wmode) thtml += " wmode='" + _wmode + "'"
    if(_base) thtml += " base='" + _base + "'"
    if(_flashvars) thtml += " flashvars='" + _flashvars + "'"
    thtml += "></embed>"
    thtml += "</object>"
    
    if (!document.getElementById(_elm))
    {    
        document.write(thtml);
    }
    else
    {
        document.getElementById(_elm).innerHTML = thtml;
    }
}

function tabit(btn){var idname = new String(btn.id);var s = idname.indexOf("_");var e = idname.lastIndexOf("_")+1;var tabName = idname.substr(0, s);var id = parseInt(idname.substr(e, 1));var tabNumber = btn.parentNode.childNodes.length;for(i=0;i<tabNumber;i++){document.getElementById(tabName+"_div_"+i).style.display = "none";document.getElementById(tabName+"_btn_"+i).style.backgroundColor = "#EBF3FB";document.getElementById(tabName+"_btn_"+i).style.borderBottomColor = "#ace";document.getElementById(tabName+"_btn_"+i).style.cursor = "pointer";};document.getElementById(tabName+"_div_"+id).style.display = "block";btn.style.backgroundColor = "#fff";btn.style.borderBottomColor = "#fff";btn.style.cursor = "default";}*/

function isDateString(sDate)
{	var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
	var iaDate = new Array(3)
	var year, month, day

	if (arguments.length != 1) return false
	iaDate = sDate.toString().split("-")
	if (iaDate.length != 3) return false
	if (iaDate[1].length > 2 || iaDate[2].length > 2) return false
	if (isNaN(iaDate[0])||isNaN(iaDate[1])||isNaN(iaDate[2])) return false

	year = parseFloat(iaDate[0])
	month = parseFloat(iaDate[1])
	day=parseFloat(iaDate[2])

	if (year < 1900 || year > 2100) return false
	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
	if (month < 1 || month > 12) return false
	if (day < 1 || day > iaMonthDays[month - 1]) return false
	return true
}

/*function stringToDate(sDate, bIgnore)
{	var bValidDate, year, month, day
	var iaDate = new Array(3)
	
	if (bIgnore) bValidDate = true
	else bValidDate = isDateString(sDate)
	
	if (bValidDate)
	{  iaDate = sDate.toString().split("-")
		year = parseFloat(iaDate[0])
		month = parseFloat(iaDate[1]) - 1
		day=parseFloat(iaDate[2])
		return (new Date(year,month,day))
	}
	else return (new Date(1900,1,1))
}

function GotoPage(url) 
{ 
    window.location.href=url; 
} */
    
/*    function addFav()
{
    window.external.AddFavorite('http://www.haistudy.com','海学网网站');
}

function addHome()
{
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage('http://www.haistudy.com');
}*/

var flag=false; 
/*function DrawImage(ImgD,w,h){ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if(image.width>0 && image.height>0){ 
        flag=true; 
        if(image.width/image.height>= w/h){ 
            if(image.width>w){ 
                ImgD.width=w; 
                ImgD.height=(image.height*w)/image.width; 
            }else{ 
                ImgD.width=image.width; 
                ImgD.height=image.height; 
            }
        } 
        else{ 
            if(image.height>h){ 
                ImgD.height=h; 
                ImgD.width=(image.width*h)/image.height; 
            }else{ 
                ImgD.width=image.width; 
                ImgD.height=image.height; 
            }
        } 
    } 
}

function insertFlash(elm, url, w, h) 
{
     writeflashhtml("_elm="+elm,"_swf="+url, "_width="+w, "_height="+h ,"_wmode=opaque");
}*/

function getObjectMouseOver(objectId) {	
  if(document.getElementById && document.getElementById(objectId)) {return document.getElementById(objectId);} 
  else if (document.all && document.all(objectId)) {return document.all(objectId); } 
  else if (document.layers && document.layers[objectId]) {return document.layers[objectId]; } 
  else {return false;}	 
}

function changNavMouseOver(m){
    for(var i=1;i<=12;i++){				
        if(i==m) {
	        getObjectMouseOver("nav_"+m).className="bg";		
	        getObjectMouseOver("subnav_"+m).className="SecondTitle";
        }
        else{
	        getObjectMouseOver("nav_"+i).className="";	
	        getObjectMouseOver("subnav_"+i).className="hidden";				
        }  			
    }
} 

/*var oEditer;
function CustomValidate(source, arguments)
{
    var value = oEditer.GetXHTML(true);
    if(value=="")
    {
       arguments.IsValid = false;    
    }
    else
    {
        arguments.IsValid = true;
    }
}
function FCKeditor_OnComplete( editorInstance )
{ 
    oEditer = editorInstance;
}
function fnWrite(strTarget){
document.write(strTarget);
}
function jxlltFlash(strParam,height,width){
var strObject;

strObject = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' WIDTH='" + width + "' HEIGHT='" + height + "' id='menu'> " +
"<PARAM NAME=movie VALUE='" + strParam + "'>" +
"<PARAM NAME=menu VALUE=false>" +
"<PARAM NAME=quality VALUE=High>" +
"<PARAM NAME=wmode VALUE=transparent>" +
"<PARAM NAME=bgcolor VALUE=#011d28>" +
"<EMBED src='" + strParam + "' menu=false quality=High wmode=transparent bgcolor=#011d28 WIDTH='" + width + "' HEIGHT='" + height + "' NAME='menu' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>;</EMBED>" +
"</OBJECT>";

fnWrite(strObject);
}*/