// JavaScript Document
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(){ 
	$('.one').mousemove(function(){
		$('.two_absolute').slideUp().end();
		$('.three_absolute').slideUp().end();
		$('.four_absolute').slideUp().end();
		$('.five_absolute').slideUp().end();
	});
	$('.two').mousemove(function(){
		$('.two_absolute').slideDown().end();
		$('.three_absolute').slideUp().end();
		$('.four_absolute').slideUp().end();
		$('.five_absolute').slideUp().end();
	});
	$('.three').mousemove(function(){
		$('.two_absolute').slideUp().end();
		$('.three_absolute').slideDown().end();
		$('.four_absolute').slideUp().end();
		$('.five_absolute').slideUp().end();
	});
	$('.four').mousemove(function(){
		$('.two_absolute').slideUp().end();
		$('.three_absolute').slideUp().end();
		$('.four_absolute').slideDown().end();
		$('.five_absolute').slideUp().end();
	});
	$('.five').mousemove(function(){
		$('.two_absolute').slideUp().end();
		$('.three_absolute').slideUp().end();
		$('.four_absolute').slideUp().end();
		$('.five_absolute').slideDown().end();
	});
	$('.six').mousemove(function(){
		$('.two_absolute').slideUp().end();
		$('.three_absolute').slideUp().end();
		$('.four_absolute').slideUp().end();
		$('.five_absolute').slideUp().end();
	});
});

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_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_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];}
}
//-->

var xmlHttp;
function createXMLHttpRequest(){
	if (window.ActiveXObject){
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest){
		xmlHttp = new XMLHttpRequest();
	}
}

function get_city(provinceid) {
	createXMLHttpRequest();
	xmlHttp.open("GET","./include/get_city.php?provinceid="+provinceid+"&nocache="+new Date().getTime(),false);
	xmlHttp.onreadystatechange=function(){
		if (xmlHttp.readystate==4 && xmlHttp.status==200) {
				if(xmlHttp.responseText=="") {
					document.getElementById("cityid").innerHTML="";
				} else {
					document.getElementById("cityid").innerHTML=xmlHttp.responseText;
				}
		}
	}
	xmlHttp.send();
}

function changepaixu(table,id,value) {
	createXMLHttpRequest();
	xmlHttp.open("GET","changepaixu.php?table="+table+"&id="+id+"&value="+value+"&nocache="+new Date().getTime(),false);
	xmlHttp.onreadystatechange=function(){
		if (xmlHttp.readystate==4 && xmlHttp.status==200) {
				if(xmlHttp.responseText=="") {
					alert('排序修改失败');
				} else {
					alert('排序修改成功');
				}
		}
	}
	xmlHttp.send();
}

// JavaScript Document
function changecolor(a){//顶部点击时按钮变色
	var clickurl
	clickurl=a;
	for(i=1;i<9;i++){
		if(i==clickurl){
			document.getElementById('a'+i).style.color='yellow';
			}else{
				document.getElementById('a'+i).style.color='#CBDAB3';
				}
		}
	}

function checkall()//全选
{
   var a = document.getElementsByTagName("input");
   if(a[0].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}

function gotopage(filename)//跳转到第几页
{
	var page;
	page=document.form1.gopage.value;
	if(page<0||isNaN(page)||page==""){
		page=1;
		}
	location.href=filename+page;
	}

function changeimg(id){//状态1表示+状态，0表示-状态
	var value;
	value=document.getElementById('changeimg'+id).value;
	if (value==0){
		document.getElementById('changeimg'+id).innerHTML="<img src='image/-.jpg' width='16' height='9'/>";
		document.getElementById('smallclass'+id).style.display='block';
		document.getElementById('changeimg'+id).value=1;		
	}else if (value==1){
		document.getElementById('changeimg'+id).innerHTML="<img src='image/+.jpg' width='16' height='9'/>";
		document.getElementById('smallclass'+id).style.display='none';
		document.getElementById('changeimg'+id).value=0;		
		}
}

function changepic(xilie,id){
	document.getElementById("bigpic").innerHTML="<a href='"+xilie+id+".php' target='_blank'><img src='web/"+xilie+"_b"+id+".jpg' border='0' /></a>";
}

function get_city(provinceid) {
	createXMLHttpRequest();
	xmlHttp.open("GET","./include/get_city.php?provinceid="+provinceid+"&nocache="+new Date().getTime(),false);
	xmlHttp.onreadystatechange=function(){
		if (xmlHttp.readystate==4 && xmlHttp.status==200) {
				if(xmlHttp.responseText=="") {
					document.getElementById("cityid").innerHTML="";
				} else {
					document.getElementById("cityid").innerHTML=xmlHttp.responseText;
				}
		}
	}
	xmlHttp.send();
}
