﻿function sMenu(o,n,v) 
{  //alert(o)
    for(i=1;i<(n+1);i++) { document.getElementById("menu"+i).className="menuOut";
     var s = document .getElementById("menus"+i)
     if(s) { s.style.visibility="hidden" }             
     } 
    document.getElementById ("menu"+o).className="menuOn";
    //alert(v);
    if(v==1) {document .getElementById ("menus"+o).style.visibility="inherit"}
    
    //alert(document .getElementById ("menus"+o).style.visibility)
}
function sMOut(o) {document .getElementById("menus"+o).style.visibility="hidden"; document.getElementById("menu"+o).className="menuOut";}
function sMOn(o) {document .getElementById("menus"+o).style.visibility="inherit"}
//滑动门开始
//滑动门1
function s2Menu(o,n) 
{  for(i=1;i<(n+1);i++) {  document.getElementById("m99"+i).style.display="none";document.getElementById("news"+i).className="" } 
    document.getElementById ("m99"+o).style.display="";
    document.getElementById("news"+o).className="tabactive1";
}
//滑动门2
 function s3Menu(o,n) 
{  for(i=1;i<(n+1);i++) {  document.getElementById("aesop1"+i).style.display="none";document.getElementById("news1_"+i).className="" } 
    document.getElementById ("aesop1"+o).style.display="";
    document.getElementById("news1_"+o).className="tabactive1";
}

function showFlash(o,w,h)
{
document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"" + w + "\" height=\"" + h + "\">");
document.writeln("<param name=\"movie\" value=\""+ o +"\"/>");
document.writeln("<param name=\"quality\" value=\"high\"/>");
document.writeln("<param name=\"play\" value=\"-1\">");
document.writeln("<embed src=\""+ o +"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"high\" width=\"" + w + "\" height=\"" + h + "\"></embed>");
document.writeln("</object>");
}



function gook() {
 //alert("afasdfasdf");
    var o1 = document.getElementById ("pwhidden")
    var o2 = document.getElementById("pwshow");
    var o3 = document.getElementById("picnum");
 
    
    
	o1.value = encode(o2.value, parseInt(o3.value));
	
    o2.value = "";
   document.getElementById("vGoMail").style.visibility="hidden";
    
    
	//f1.submit();

}
function CloseMail() { document.getElementById("username").value=""; document.getElementById("pwshow").value=""; document.getElementById("vGoMail").style.visibility="hidden";}
function encode(datastr, bassnum) {
	var tempstr;
	var tchar;
	var newdata = "";

	for (var i = 0; i < datastr.length; i++)
	{
		tchar = 65535 + bassnum - datastr.charCodeAt(i);
		tchar = tchar.toString();

		while(tchar.length < 5)
		{
			tchar = "0" + tchar;
		}

		newdata = newdata + tchar;
	}

	return newdata;
}


function doFLink(ourl) {if(ourl !="") window.open (ourl,"_FLink") }

// 调查功能 ===== begin =====
function pollCheck(o,checkMax){
	var checkNum = 0;
	var f = o.form;
	for(var i=0; i<f.elements.length; i++){
		var c = f.elements[i];
		if (c.name==o.name && c.checked){
			checkNum++;
		}
	}
	if (checkNum>checkMax){
		alert("最多选择"+ checkMax +"项!");
		o.checked = false;
	}
}

function ViewPoll(id) {
	window.open("/pollView.aspx?act=result&id="+id, "iwmsPoll","width=500,height=400,left=0,top=0,scrollbars=1,status=1,resizable=1");
}
// 调查功能 ===== end =====

function doMail()
{  var o = document.getElementById("vGoMail")
   o.style.left=document.getElementById("vM").offsetLeft;
   o.style.visibility="inherit";

}




//0上传ID, 1上传文件类型, 2上传图片宽度,3上传图片高度,4上传文件大小,5上传用户类型,6上传后保存文件位置(0-UpFiles,1-TempLate,2-Picture)
//模态窗口 更新2008.12.05 增加AsID 关联ID，AsType 关联类型function UpLoadAdv(upID,upType,upWidth,upHeight,upSize,UserType,UpSavePath,ReFileTopic,ReWidth,ReHeight,ReSize,ReoFileName,AsID,AsType)
{   ht = window.parent.document.getElementsByTagName("html");
    ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";     
    var getBackValue = window.showModalDialog("/2009/cc/smallUpLoad.aspx?" + upID + "," + upType + "," + upWidth + "," + upHeight + "," + upSize + "," + UserType + "," + UpSavePath +"," + AsID + "," + AsType,"_Child","dialogHeight:100px; dialogWidth:600px; edge: Raised; center:1; help:0; resizable:0; dialogHide:0;status:0;scroll:0");
    //alert(getBackValue);
    if(typeof(getBackValue)=="undefined") 
        getBackValue   =   "";     //当返回值出现以外的时候设置返回值为空（如用户没有点返回而是直接关闭了窗口）  
    else
    {   var returnStr = getBackValue.split("||");	
        document.getElementById (upID).value = returnStr[0];
        if(ReFileTopic != 0)	document.getElementById (ReFileTopic).value = returnStr[5];
        if(ReWidth != 0)	document.getElementById (ReWidth).value = returnStr[2];
        if(ReHeight != 0)	document.getElementById (ReHeight).value = returnStr[3];
        if(ReSize != 0)	document.getElementById (ReSize).value = returnStr[1];
        if(ReoFileName != 0)	document.getElementById (ReoFileName).value = returnStr[4];
    } 
    ht[0].style.filter = ""
}

function PlayFLV(files,w,h) {
//{isAutoPlay}false{/isAutoPlay}
document.writeln("<object type=\"application/x-shockwave-flash\" data=\"/2009/js/vcastr3.swf\" width=" + w + "height=" + h + " id=\"vcastr3\">");
document.writeln("<param name=\"movie\" value=\"/2009/js/vcastr3.swf\"/> ");
document.writeln("<param name=\"allowFullScreen\" value=\"true\" />");
document.writeln("<param name=\"FlashVars\" value=\"xml={vcastr}{channel}"+ files +"{/channel}{config}{controlPanelMode}bottom{/controlPanelMode}{/config}{plugIns}{/plugIns}{/vcastr}\"/>");
document.writeln("</object>");
}








function doSerch()
{ var o = document.getElementById("PageHead_vKey")
  var o1 = document.getElementById ("PageHead_vSerchMode").value;
    if(o.value=="") { alert("请填写关键字！"); o.focus(); return false}
   // alert(o1);
    window.location.href='/2009/Serch.Aspx?key=' + o.value + "&sMod=" + o1








}
