//*************************************************************************
//**** 公共JS
//**** Author:yzxiong
//**** upDate:2008-09-25
//*************************************************************************
function pnShow1(v){
	var p=document.getElementById("f");
	var pn=document.getElementById("pn");
	var province=document.getElementById("f1");
	var pORn=document.getElementById("pORn");
	//var pnMore=document.getElementById("pnMore");
	if(v==p){
		province.style.display="block" ;
		national.style.display="none" ;
		pORn.style.display="none";
		//pnMore.style.display="block";
		p.style.color="#FF0000";
		n.style.color="#000000";
		pn.style.color="#000000";
	}else if(v==n){
		province.style.display="none";
		national.style.display="block";
		pORn.style.display="none";
		//pnMore.style.display="block";
		n.style.color="#FF0000";
		p.style.color="#000000";
		pn.style.color="#000000";
	}
	else if(v==pn){
		province.style.display="none";
		national.style.display="none";
		//pnMore.style.display="block";
		pORn.style.display="block";
		n.style.color="#000000";
		p.style.color="#000000";
		pn.style.color="#ff0000";
	}
}



//*************************************************************************
//The flowing is the function about nartional or province news's  show style
//*************************************************************************
function pnShow(v){
	var f=document.getElementById("f");
	var p=document.getElementById("p");
	var n=document.getElementById("n");
	var pn=document.getElementById("pn");
	var f1=document.getElementById("f1");
	var province=document.getElementById("province");
	var national=document.getElementById("national");
	var pORn=document.getElementById("pORn");
	//var pnMore=document.getElementById("pnMore");
	if(v==p){
		province.style.display="block" ;
			f1.style.display="none" ;
		national.style.display="none" ;
		pORn.style.display="none";
		//pnMore.style.display="block";
		p.style.color="#FF0000";
		n.style.color="#000000";
		f.style.color="#000000";
		pn.style.color="#FFFFFF";
	}else if(v==n){
		f1.style.display="none" ;
		province.style.display="none";
		national.style.display="block";
		pORn.style.display="none";
		//pnMore.style.display="block";
		n.style.color="#FF0000";
		f.style.color="#000000";
		p.style.color="#000000";
		pn.style.color="#FFFFFF";
	}else if(v==f){
		province.style.display="none";
		f1.style.display="block" ;
		national.style.display="none";
		pORn.style.display="none";
		//pnMore.style.display="block";
		n.style.color="#000000";
		f.style.color="#FF0000";
		p.style.color="#000000";
		pn.style.color="#FFFFFF";
	}
	else if(v==pn){
		province.style.display="none";
		national.style.display="none";
		//pnMore.style.display="block";
		pORn.style.display="block";
		n.style.color="#000000";
		p.style.color="#000000";
		pn.style.color="#ff0000";
	}
}

//***********************************************************************************
//The flowing if the function for the news show 
//***********************************************************************************
 

  function showNewsMsg(col,tempSt){
 //alert(tempSt)
                var tempSt1 = tempSt;
            	var tempTitle=document.getElementById(tempSt1).value;
				var tempSp=tempTitle.split("<br>");
				var lg=tempSp.length ;				
				var Sp="" ;				
				if(lg>0)
				{
					for(i=0;i<lg-1;i++)
					{	
						Sp=tempSp[i].split("{&$}");
						document.write("<table width='100%'> <tr height='25'>")						
						document.write("<td >"+Sp[0]+"</td>");
						
						         if(col>0){
								 document.write("<td  width='12%'>"+Sp[col]+"</td>");}
						         else if(col<0)
								 {
									document.write("<td width='15%'>"+Sp[1]+"</td>"); 
									 document.write("<td width='15%'>"+Sp[3]+"</td>"); }
									 
									
							   document.write("</tr></table>");
						
					 } 
						
					}							
					
				}	

 
 function showNewspage(col,iTemp,elementid){
            	var tempTitle=document.getElementById(elementid).value;
				var tempSp=tempTitle.split("<br>");				
				var Sp=tempSp[iTemp].split("{&$}");
						if(col==3){
							document.write(Sp[col]+"&nbsp;");
						}else if(col==0){
							document.write(Sp[col]);
						}else if(col==2){
							document.write(Sp[col].substring(0,10)+"&nbsp;");
						}else if(col==1){
							document.write(Sp[col]+"&nbsp;");
						}else if(col==4){
							document.write(Sp[col]+"&nbsp;");
						}
						
							
}


//***********************************************************************************
//if the value of scrollPresentTemp is "scrollTop" ,  the scroll is show like this:
//<DIV align=center></DIV>
//          <DIV id=demo style=OVERFLOW: hidden; width:204px; height:132px;>
//            <DIV id=demo1> 
//            <img  src=*.jpg/>
//                   </DIV>
// <DIV id=demo2></DIV></DIV> 
//*****************************************
//if the value of scrollPresentTemp is "scrollLeft" ,  the scroll is show like this:
//<div id="scroll_div" style="overflow: hidden; width: 772px; height: 50px" align="center">
//  <table align=left cellpadding=0 cellspace=0 border=0>
//    <tr>
//      <td id=scroll_begin> <img  src=*.jpg/></td>
//      <td id=scroll_end></td>
//    </tr>
//  </table>
//</div> 	
//****************************************
//The flowing if the function for pictures cycle srolling	
	
//	demo2.innerHTML=demo1.innerHTML
//		function Marquee(){		
//			if(scrollPresentTemp=="scrollTop"){
//				if(demo2.offsetHeight-demo.scrollTop<=0)
//					demo.scrollTop-=demo1.offsetHeight
//				else{
//					demo.scrollTop++
//				}
//			}else if(scrollPresentTemp=="scrollLeft"){
//				if(demo2.offsetWidth-demo.scrollLeft<=0)
//					demo.scrollLeft-=demo1.offsetWidth
//				else{
//					demo.scrollLeft++
//				}
//			}
//		}
//	var MyMar=setInterval(Marquee,speed)
//	demo.onmouseover=function() {clearInterval(MyMar)}
//	demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
//***********************************************************************************
 function scrollFunction(scroll_div,scroll_begin,scroll_end,scrollPresentTemp,speed){
scroll_end.innerHTML = scroll_begin.innerHTML;
	function Marquee(){		
			if(scrollPresentTemp=="scrollTop"){
				if(scroll_end.offsetHeight-scroll_div.scrollTop<=0)
					scroll_div.scrollTop-=scroll_begin.offsetHeight
				else{
					scroll_div.scrollTop++
				}
			}else if(scrollPresentTemp=="scrollLeft"){
				 if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
					scroll_div.scrollLeft -= scroll_begin.offsetWidth
				else {
					scroll_div.scrollLeft++;
				}
			}
		}
	var MyMar = setInterval(Marquee, speed);
	scroll_div.onmouseover = function() {
		clearInterval(MyMar);
	}
	scroll_div.onmouseout = function() {
	   MyMar = setInterval(Marquee, speed);
	}
}


//***********************************************************************************
//The flowing if the function for  pictures show style like  Powerpoint
//***********************************************************************************
function objSP_Article() {this.ImgUrl=""; this.LinkUrl=""; this.Title=""; this.TitleShow="";}
function SlidePic_Article(_id) {this.ID=_id; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=SlidePic_Article_Add; this.Show=SlidePic_Article_Show; this.LoopShow=SlidePic_Article_LoopShow;}
function SlidePic_Article_Add(_SP) {this.AllPic[this.AllPic.length] = _SP;}
function SlidePic_Article_Show() {
  if(this.AllPic[0] == null) return false;
  document.write("<div align='center'><a id='Url_" + this.ID + "' href='' target='_blank'><img id='Img_" + this.ID + "' style='width:" + this.Width + "px; height:" + this.Height + "px; filter: revealTrans(duration=2,transition=23);' src='javascript:null' border='0'></a>");
  if(this.TitleLen != 0) {document.write("<span id='Title_" + this.ID + "'></span></div>");}
  else{document.write("</div>");}
  this.Img = document.getElementById("Img_" + this.ID);
  this.Url = document.getElementById("Url_" + this.ID);
  this.Title = document.getElementById("Title_" + this.ID);
  this.LoopShow();
}
function SlidePic_Article_LoopShow() {
  if(this.PicNum<this.AllPic.length-1) this.PicNum++ ; 
  else this.PicNum=0; 
  this.Img.filters.revealTrans.Transition=this.Effect; 
  this.Img.filters.revealTrans.apply(); 
  this.Img.src=this.AllPic[this.PicNum].ImgUrl;
  this.Img.filters.revealTrans.play();
  this.Url.href=this.AllPic[this.PicNum].LinkUrl;
  if(this.Title) this.Title.innerHTML="<br><a href="+this.AllPic[this.PicNum].LinkUrl+" target='_blank' title='"+this.AllPic[this.PicNum].TitleShow+"'>"+this.AllPic[this.PicNum].Title+"</a>";
  this.Img.timer=setTimeout(this.ID+".LoopShow()",this.TimeOut);
}


//***********************************************************************************
//The flowing if the function for the messages which customers response checking 
//***********************************************************************************
function checku(){
		var u=document.getElementById("username1");
		var t=document.getElementById("title");
		var c=document.getElementById("content");
		 if (u.value==""){
			alert("请输入您的称呼！");
			u.focus();
			return false;
		}else if (c.value==""){
			alert("请输入留言内容！");
			c.focus();
			return false;
		}else{
			return true ;
		}
}