var loadimg = "<img src=\"/images/load.gif\" border=\"0\" >";
var link = "http://www27.53kf.com/webCompany.php?arg=newgenegle&style=2&kflist=off&kf=&zdkf_type=1&language=cn&charset=GBK&username=&userinfo=&introurl=&lyurl=&lytype=0&copartner=&referer=http%3A%2F%2Fwww.dnachina.org%2F&keyword=http%3A%2F%2Fwww.dnachina.org%2Fsupport%2Fsupport_payment.php&brief=&logo=&question=&tfrom=2";
var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);

$(document).ready(function(){
   $("#menus > ul > li").mouseover(function(){
	   $(this).css("background-color","#063d3a");
	   $(this).find("ul").show();
   });
   $("#menus > ul > li ").mouseout(function(){
	   $(this).css("background-color","");
	   $(this).find("ul").hide();
   });
   $("#sevic > li > a,#setp > li > a ").mouseover(function(){
	   $(this).next().show();
   });
   $("#sevic a> li > a,#setp > li > a ").mouseout(function(){
	   $(this).next().hide();
   });
   loadimage();
});

function home_advs(object){
   var newname = object.id;
   newname = newname.replace("pd","");
   newname = parseInt(newname);
   for(i=1;i<=4;i++){
	  if($("#bd"+i).is(":hidden")===false){ break; }
   }
   if(i!=newname){
   $("#bd"+i).animate({
	   height:1,opacity:"toggle"
   },500);
   $("#bd"+newname).animate({
	   opacity:"show",height:"85px"
   },500);
   }
}

function m_spec(v){
  if(v==""){;} else {

  for(i=1;i<=4;i++){
   if($("#spec"+i).is(":hidden")===false){ break;}
  }
  for(x=1;x<=4;x++){
  if(x==v){
  $("#spimg"+x).attr("src","images/q"+x+"_1.gif");
  } else {
  $("#spimg"+x).attr("src","images/q"+x+".gif");
   }
  }
  if(v==i){;} else {

  $("#spec"+i).animate({
	   width:"1px",opacity:"toggle"
	},500);
  }
    $("#spec"+v).animate({
      width:"250px",opactiy:"show"
  },500);
  }

}

function loadimage(){
  himg1 = new Image();
  himg1.src = "images/q1_1.gif";
  himg2 = new Image();
  himg2.src = "images/q2_1.gif";
  himg3 = new Image();
  himg3.src = "images/q3_1.gif";
  himg4 = new Image();
  himg4.src = "images/q4_1.gif";

}

function mov_m(object,type){
  thid = object.id;
  nid  = thid.replace("jy","");
  newid = "jd"+nid;
  if(type==2){
	  thisrc = object.src;
	  thisrc = thisrc.split("images");
	  thisrc = thisrc[1].replace(".gif","");

  }
  for(i=1;i<=6;i++){
	  if(type==1){
	  $("#jy"+i).css("background","none");
	  } else if(type==2){
      $("#jy"+i).attr("src","/images/process_no"+i+".gif");
	  } else if(type==3){
	  } else if(type==5){
	  $("#jy"+i).css("background","none");
	  }
	  $("#jd"+i).hide();
  }
  if(type==1){
  $("#"+thid).css("background","#000 url(/images/product_21.gif) left top no-repeat");
  } else if(type==2){
	  if(thisrc.indexOf("_m")!=-1){; } else {
  $("#"+thid).attr("src","/images"+thisrc+"_m.gif");
  }
  } else if(type==3){
  }
  $("#"+newid).show();
}

function sel_city(id){
  $.ajax({
	  timeout:"5000",
	  type:"GET",
		  url:"../dodata.php",
		  data:"action=sel_city&id="+id+"&r="+Math.random(),
		  success:function(msg){
		  $("#jb").html(msg);
 	  },
		  beforeSend:function(msg){
		  $("#jb").html(loadimg);
	  },
		  error:function(){
		  sel_city(id);
	  }
  })
}
function sel_area(id){
	for(i=1;i<=7;i++){
		$("#jy"+i).css("background","none");
	}
  $("#jy"+id).css("background","#fff url(/images/contact_agent.gif) let top no-repeat");
  $.ajax({
	  timeout:"5000",
	  type:"GET",
		  url:"../dodata.php",
		  data:"action=area&id="+id+"&r="+Math.random(),
		  success:function(msg){
		  $("#jd1").html(msg);
 	  },
		  beforeSend:function(){
		  $("#jd1").html(loadimg);
	  },
		  error:function(){
		  sel_area(id);
	  }
  })
}
function CLink(t){
   $.ajax({
	  timeout:"5000",
	   type:"GET",
	   url:"/dodata.php",
	   data:"action="+t+"&r="+Math.random(),
		   success:function(msg){
		   $("#tipMsg").html(msg);
	   },
		   beforeSend:function(){
		   $("#tipMsg").html(loadimg);
	   },
		   error:function(){
		   CLink(t);
	   }
   })
}
function propOpen(t,width,height){
	$("#web2").animate({
		width:"100%",height:"100%"
	},500,function(){
	$("#tip").animate({
		width:width,height:"10"
	},500,function(){
	$("#tip").animate({
		height:height
	},500,function(){
		$("#close").fadeIn("fast");
	  	CLink(t);
	})
	})
    })
}


function glsOf(url) { /* This fuction pops up gls.html and scrolls down to the glossary item the users have clicked. */
	window.open(url,'','width=680,height=430,scrollbars=0,top=50,left=50,resizable=0,menubar=0,toolbar=0,status=0,location=0');
}


function fixPNG(myImage)
{
if ((version >= 5.5) && (version < 7) && (document.body.filters))
{
var imgID = (myImage.id) ? "id='" + myImage.id + "' " : "";
var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' ";
var imgStyle = "display:inline-block;cursor:pointer;" + myImage.style.cssText;
var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+ "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>";
myImage.outerHTML = strNewHTML   ;
}
}

