﻿// JavaScript Document
//切版js
var menu1Show=function(str1,str2,num){
	var aqa1=document.getElementById(str1).getElementsByTagName("dt");
	var bqb1=document.getElementById(str2);
	for(i=0;i<aqa1.length;i++){
		aqa1.item(i).className="";
		document.getElementById(str2+""+i).style.display="none";
	}
	aqa1.item(num).className="active";
	document.getElementById(str2+num).style.display="";
}

var menu2Show=function(str1,str2,num){
	var aqa1=document.getElementById(str1).getElementsByTagName("dd");
	var bqb1=document.getElementById(str2);
	for(i=0;i<aqa1.length;i++){
		aqa1.item(i).className="";
		document.getElementById(str2+""+i).style.display="none";
	}
	aqa1.item(num).className="active";
	document.getElementById(str2+num).style.display="";
}

checkBody();

function checkBody(){
	var TFF=false;//判断是否为ie6
	if(navigator.appName == "Microsoft Internet Explorer") 
	{ 
		if(navigator.appVersion.match(/6./i)=='6.') 
		{ 
		  TFF=true;
		}else{ 		
		  TFF=false;
		} 
	} 
	
	
	
	if(TFF!=true){
		if(window.document.body.offsetWidth<=1024)//1024屏下，去掉边框阴影
		{
			document.getElementById("AllMain").style.width=1004;
			document.getElementById("Top").style.width=1004;
			document.getElementById("TLeft").style.display="none";
			document.getElementById("TRight").style.display="none";
			
			document.getElementById("Bottom").style.width=1004;
			document.getElementById("BLeft").style.display="none";
			document.getElementById("BRight").style.display="none";
			window.document.documentElement.scrollLeft=(1004-window.document.body.offsetWidth)/2;
		}else{
			window.document.documentElement.scrollLeft=(1272-window.document.body.offsetWidth)/2;
		}
	}else{
		if(window.screen.width<=1024)//1024屏下，去掉边框阴影
		{
			document.getElementById("AllMain").style.width=1004;
			document.getElementById("Top").style.width=1004;
			document.getElementById("TLeft").style.display="none";
			document.getElementById("TRight").style.display="none";
			
			document.getElementById("Bottom").style.width=1004;
			document.getElementById("BLeft").style.display="none";
			document.getElementById("BRight").style.display="none";
			window.document.documentElement.scrollLeft=(1004-window.document.body.offsetWidth)/2;
		}else{
			window.document.documentElement.scrollLeft=(1272-window.document.body.offsetWidth)/2;
		}	
	}
}

function quvalue(str){//搜索text清空
  str.value="";
  str.className="";
}

function getURLPath(str){//友情链接
	var urlPath=str.options[str.selectedIndex].value;
	if(urlPath!="0")
		window.open(urlPath);
}

function imgshowbg(str){
	str.className=str.className+" s1";	
}

function imghiddbg(str){
	str.className=str.className.replace(" s1","");
}

if(document.getElementById("Mleft") && document.getElementById("MRight")){
	var a=document.getElementById("Mleft");
	var b=document.getElementById("MRight");
	a.style.height=b.offsetHeight;
}

function doPrint() {//打印
	var code="<html><head><meta http-equiv='x-ua-compatible' content='ie=7' /><link href='/CSS/RootBase.CSS' type='text/css' rel='stylesheet' /><link href='/CSS/neiye02.CSS' type='text/css' rel='stylesheet' /></head><body onload=window.print()><style>body{ background:none;}</style>";
	var bdhtml=window.document.body.innerHTML;    
	var sprnstr="<!--startprint-->";    
	var eprnstr="<!--endprint-->";    
	var prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);    
		prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));   
		code+=prnhtml;			
		code+="</body></html>";			
	var newwin=window.open('','','');
		newwin.opener = null;
		newwin.document.write(code);
		newwin.document.close();
}

function SetFont(size) //打字体大中小
  { 
	  var divBody = document.getElementById("MRCContent"); 
	  if(!divBody) 
	  { 
		  return; 
	  } 
	  divBody.style.fontSize = size + "px"; 
	  var divChildBody = divBody.childNodes; 
	  for(var i = 0; i < divChildBody.length; i++) 
	  { 
		  if (divChildBody[i].nodeType==1) 
		  { 
			  divChildBody[i].style.fontSize = size + "px"; 
		  } 
	  } 
  }
  
  function MM_displayStatusMsg(msgStr) { //v1.0
  window.status=msgStr;
  document.MM_returnValue = true;
  //alert("过");
}

//everyTimeShow=setTimeout("MM_displayStatusMsg('欢迎光临 上海青浦白鹤草莓网')",1000);


//js经过图片效果
// JavaScript Document
// style="filter: alpha(opacity=100)"
//var allanchor=document.body.getElementsByTagName("a");
//zhouyou();

function zhouyou(){
	for(i=0;i<allanchor.length;i++){
		var ancho = allanchor.item(i);
		
		var relAttribute = String(ancho.getAttribute('rel'));
		if (relAttribute=="showLight"){
			ancho.getElementsByTagName("img").item(0).style.filter='alpha(opacity=100)';
			//alert(ancho.getElementsByTagName("img").item(0).onmouseover);
		}
	}
}

function high(which){
	which.filters.alpha.opacity=20
	theobject=which;
	highlighting=setInterval("highlightit(theobject)",50);
}

function low(which){
	clearInterval(highlighting);
	which.filters.alpha.opacity=100
} 

function highlightit(cur){
	if(cur.filters.alpha.opacity==20){
		cur.filters.alpha.opacity==60;	
	}
	if(cur.filters.alpha.opacity<100) 
		cur.filters.alpha.opacity+=10;
	else if(window.highlighting) 
		clearInterval(highlighting);
}

function movuMenu(){
	var MmmmList=document.getElementById("MDLDhMenuList").getElementsByTagName("dt");
	for(i=0;i<MmmmList.length;i++){
		if(MmmmList.item(i).className=="active"){
			MmmmList.item(i).getElementsByTagName("img").item(0).src=(MmmmList.item(i).getElementsByTagName("img").item(0).src).replace("_bgN_","_bg_");
		}
	}
}

function changeInBtn(str){
	var thisMDRPContent=document.getElementById("MDRPContent").getElementsByTagName("img");
	for(i=0;i<thisMDRPContent.length;i++){
		thisMDRPContent.item(i).src=(thisMDRPContent.item(i).src).replace("04DSHXC_imgM","04DSHXC_img");
	}
	str.src=(str.src).replace("04DSHXC_img","04DSHXC_imgM");
}
function changeOutBtn(str){
	str.src=(str.src).replace("04DSHXC_imgM","04DSHXC_img");
}


//搜索框
function seachFocusIn(str){
	if(str.value=="站内搜索                "){
		str.value="";	
	}
	str.className="s1d";
}

function seachFocusOut(str){
	if(str.value==""){
		str.value="站内搜索                ";
		str.className="";
	}	
}

function goSeachCheck(){
	if(document.getElementById("keywords").value==""){
		alert("搜索内容不能为空,请填写正确内容!");
		return false;	
	}
	if(document.getElementById("keywords").value=="站内搜索"){
		alert("搜索内容不能为空,请填写正确内容!");
		return false;	
	}
	
	var nowtimes = new Date();
	document.getElementById("thisdatetime").value=nowtimes.getTime();
	return true;
}


function DZZZShow(num,strURL){//杂志在线观看
	  var Divif=document.getElementById("DZZVIew"+num);
	  var ifDiv=document.getElementById("DZZVIewIF"+num);
	  var coloseifDiv=document.getElementById("closeIFDIV"+num);
	  
	  Divif.style.display="";
	  ifDiv.style.display="";
	  coloseifDiv.style.display="";
	  
	  Divif.style.backgroundColor="#000000";
	  Divif.style.filter="alpha(opacity=80)";
	  ifDiv.innerHTML="<iframe src='"+strURL+"' frameborder='0' width='800' height='600'></iframe>";
	  
	  setTimeout(function (){
						   if(Divif.style.display==""){
						   ifDiv.innerHTML="<iframe src='"+strURL+"' frameborder='0' width='800' height='600'></iframe>";
						   }},600);
	  
	  
	  Divif.style.width=window.document.body.offsetWidth;
	  Divif.style.height=window.document.body.offsetHeight;
	  
	  widthNum=parseInt((Divif.style.width).replace("px",""));
	  heightNum=parseInt((Divif.style.height).replace("px",""));
	  IwidthNum=parseInt((ifDiv.style.width).replace("px",""));
	  IheightNum=parseInt((ifDiv.style.height).replace("px",""));
	  
	  ifDiv.style.top=(heightNum-IheightNum)/2;
	  ifDiv.style.left=(widthNum-IwidthNum)/2;
	  coloseifDiv.style.top=(heightNum-IheightNum)/2-30;
	  coloseifDiv.style.left=(widthNum-IwidthNum)/2;
  }
  function DZZZHidd(num){
	  var Divif=document.getElementById("DZZVIew"+num);
	  var ifDiv=document.getElementById("DZZVIewIF"+num);
	  var coloseifDiv=document.getElementById("closeIFDIV"+num);
	  
	  Divif.style.display="none";
	  ifDiv.style.display="none";
	  coloseifDiv.style.display="none";
	  
	  ifDiv.innerHTML="";	  
  }




//footer用

	var kvkus;

function showDXUs(num){

	document.getElementById("DXShowInfous"+num).style.display="";
	var SSSname=document.getElementById("DXShowInfous"+num);
	SSSname.style.width=0;
	SSSname.style.height=0;

	SSSname.style.top=document.body.offsetHeight-810;
	SSSname.style.left= window.screen.width/2-405;
	
	kvkus=setInterval("fangdatableus('DXShowInfous"+num+"')",5);
	
}
function fangdatableus(strName){
	var tSname=document.getElementById(strName);
	var w1=parseInt((tSname.style.width).replace("px",""));
	var h1=parseInt((tSname.style.height).replace("px",""));
	if(w1<800){
		tSname.style.width=w1+40;
	}
	if(h1<630){
		tSname.style.height=h1+30;
	}
	if(w1>800 && h1>630){
		clearInterval(kvkus);	
	}
}
