var ctrlcode=0;
var IE5=((navigator.appVersion.indexOf("MSIE")!=-1)&&(navigator.appVersion.substr(22,1)>=5))?1:0;
var NS=(navigator.appName == 'Netscape')?1:0;


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function setHomePage(){

aa.style.behavior='url(#default#homepage)';
aa.setHomePage('http://www.jzxf.gov.cn/');
}

function AddFavorite(){
    window.external.AddFavorite('http://www.jzxf.org.cn','金寨先锋网');

}

function printIt(){
	
	if ((IE5) || (NS))
	{	

		window.print();
	}
	else
	{	
		alert("您用的不是IE5.0以上版本，不支持直接打印。请用\n\nCtrl+p或单击鼠标右键,选菜单中的[打印]！");
		//WebBrowser1.ExecWB(6,2);
	}
}

function shutwin(){
window.close();
return;
}
function openwin(zjname)
     {

	window.open(zjname,"","top=0,left=0,height=500,width=610,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	}
function openwin1(zjname)
     {

	window.open(zjname,"","top=0,left=0,height=500,width=610,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	}
function openlm(zjname)
     {

	window.open(zjname,"","top=0,left=0,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes");
	}
function openmin(zjname)
     {

	window.open(zjname,"","top=0,left=0,height=450,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	}
function opencontent(id,Class_ID,LClass_ID){
	window.open("count.asp?id="+id+"&Class_ID="+Class_ID+"&LClass_ID="+LClass_ID,"","top=0,left=0,height=450,width=710,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	}



function opendd(open1,open2){
openlm(open1);
openwin(open2);
}

function isBlank(s){
 var len=s.length;
 var i;
for (i=0;i<len;++i)
{
 if(s.charAt(i)!=" ") return false;
}
 return true;

}


function checkKey(ob)
{
  if((IE5) || (NS)){
	if (window.event.ctrlKey)  // checks whether the ctrl key  // is pressed
	   	JM_cc(ob);
  }	
}

function JM_cc(ob){
  if ((IE5) || (NS))
{
   
	  ob.select();
	  js=ob.createTextRange();
	  js.execCommand("Copy");

   /*
	  ob.readOnly=false;
	  ob.focus();
	  ob.readOnly=true;
	  ob.blur();
  */
  }

else{
   if ((event.button == 2)||(event.button==3)){
     alert("欢迎您访问江苏农产品大市场(http://www.jsagri.com.cn)");
     return false;
       }									
    }
}

  function rand(theobj)
  {
   ran=Math.random()*10000;
   ran=Math.round(ran);
   theobj.value=ran;
  }

function OpenLink(thisform){
  if (thisform.options[thisform.selectedIndex].value.length>0)
  	window.open(thisform.options[thisform.selectedIndex].value)

};

function OpenLink1(thisform){
  if (thisform.options[thisform.selectedIndex].value.length>0)
  	location.href="main.asp?class_id="+thisform.options[thisform.selectedIndex].value
};

function unselect()
{
   document.selection.empty();
   
}

// floating image Dreamweaver Extension ,by jet(dezone@sina.com)
  var brOK=false;   
   var mie=false;  
  var aver=parseInt(navigator.appVersion.substring(0,1));   
  var aname=navigator.appName;   
  //check browser   
  function checkbrOK()   
  	{if(aname.indexOf("Internet Explorer")!=-1)   
   	{if(aver>=4) brOK=navigator.javaEnabled();  
  	mie=true;   
   	}  
  	if(aname.indexOf("Netscape")!=-1)     
   	{if(aver>=4) brOK=navigator.javaEnabled();}  
   }  
   var vmin=5;  
   var vmax=2;  
   var vr=2;  
   var timer1;  
   function Chip(chipname,width,height)  
   	{this.named=chipname;  
   	this.vx=vmin+vmax*Math.random();  
   	this.vy=vmin+vmax*Math.random();  
   	this.w=width;  
   	this.h=height;  
   	this.xx=0;  
   	this.yy=0;  
   	this.timer1=null;  
  }  
   function movechip(chipname) {  
   	if(brOK)  
   	{eval("chip="+chipname);  
   	if(!mie)  
   	{pageX=window.pageXOffset;  
   	pageW=window.innerWidth;  
   	pageY=window.pageYOffset;  
   	pageH=window.innerHeight;  
   	}  
   	else  
   	{pageX=window.document.body.scrollLeft;  
   	pageW=window.document.body.offsetWidth-8;  
   	pageY=window.document.body.scrollTop;  
   	pageH=window.document.body.offsetHeight;  
   	}   
   	chip.xx=chip.xx+chip.vx;  
   	chip.yy=chip.yy+chip.vy;  
   	chip.vx+=vr*(Math.random()-0.5);  
   	chip.vy+=vr*(Math.random()-0.5);  
   	if(chip.vx>(vmax+vmin))  chip.vx=(vmax+vmin)*2-chip.vx;  
   	if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;  
   	if(chip.vy>(vmax+vmin))  chip.vy=(vmax+vmin)*2-chip.vy;  
   	if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;  
   	if(chip.xx<=pageX)  
   	{chip.xx=pageX;  
   	chip.vx=vmin+vmax*Math.random();  
   	}  
   	if(chip.xx>=pageX+pageW-chip.w)  
   	{chip.xx=pageX+pageW-chip.w;  
   	chip.vx=-vmin-vmax*Math.random();  
   	}  
   	if(chip.yy<=pageY)  
   	{chip.yy=pageY;  
   	chip.vy=vmin+vmax*Math.random();  
   	}  
   	if(chip.yy>=pageY+pageH-chip.h)  
   	{chip.yy=pageY+pageH-chip.h;  
   	chip.vy=-vmin-vmax*Math.random();  
   	}  
   	if(!mie)  
  	{eval('document.'+chip.named+'.top ='+chip.yy);   
  	eval('document.'+chip.named+'.left='+chip.xx);   
  	}    
  	else   
  	{eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);   
   	eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);   
  	}   
  	chip.timer1=setTimeout("movechip('"+chip.named+"')",100);   
  	}   
  }   
   function stopme(chipname)  
   	{if(brOK)  
   	{//alert(chipname)  
   	eval("chip="+chipname);  
   	if(chip.timer1!=null)    
 	{clearTimeout(chip.timer1)}  
  	}}   


function confirmdel(url,title){
  if (confirm(title)){
     location.href=url
  }  
}
		
function replaceCharacters(conversionString,inChar,outChar)
{
  var convertedString = conversionString.split(inChar);
  convertedString = convertedString.join(outChar);
  return convertedString;
}

function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}