//------控制图片的说明显示-----begin--------
function movelayer(ly)
{
 var ev= ev || window.event;
 var lytop=ev.clientY + document.documentElement.scrollTop  - document.documentElement.clientTop-30;
 var lyleft=ev.clientX + document.documentElement.scrollLeft - document.documentElement.clientLeft+15;
 
 ly.style.top=lytop;
 ly.style.left=lyleft;
 ly.style.display="";
}
function hidelayer(ly)
{
 ly.style.display="none";
}
//--------------------------end--------------


function bookmarkit()
{
	window.external.addFavorite('http://www.sm-web.net/','沙漠设计')
}

function DrawImage(ImgD,width,height){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= width/height){ 
   if(image.width>width){
    ImgD.width=width; 
    ImgD.height=(image.height*width)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详情"; 
  } 
  else{ 
   if(image.height>height){
    ImgD.height=height; 
    ImgD.width=(image.width*height)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="查看原图"; 
  } 
 }
}

function CheckMessage()
{	  
	if (document.formm.username.value.length == 0) {
		alert("您的姓名不能为空.");
		document.formm.username.focus();
		return false;
	}	
	if (document.formm.phone.value.length == 0) {
		alert("联系电话不能为空.");
		document.formm.phone.focus();
		return false;
	}	
	if (document.formm.content.value.length == 0) {
		alert("内容不能为空.");
		document.formm.content.focus();
		return false;
	}	
	return true;
}
	
function swiptag1(ID,Content)
{
	for ( i = 1; i < 3; i++)
	{
	if ("diva"+i == ID)
	{
		document.getElementById(ID).className = "c1title"+i+"_2";
		document.getElementById(Content).style.display = "block";
	}
	else
	{
		document.getElementById("diva"+i).className = "c1title"+i+"_1";
		document.getElementById("diva1_"+i).style.display = "none";
	}
	}
}

function swiptag2(ID,Content)
{
	for ( i = 1; i < 3; i++)
	{
	if ("divb"+i == ID)
	{
		document.getElementById(ID).className = "c2title2";
		document.getElementById(Content).style.display = "block";
	}
	else
	{
		document.getElementById("divb"+i).className = "c2title1";
		document.getElementById("divb1_"+i).style.display = "none";
	}
	}
}
