function set_tab(show){
	for(var i=1; j=document.getElementById("form_"+i); i++){
		j.style.display = "none";
		document.getElementById("tab_"+i).className = '';
	}
	document.getElementById("form_"+show).style.display='block';
	document.getElementById("tab_"+show).className = 'focus';
}


function get_value(aa)
{
var name='<img src="'+document.getElementById(aa).value+'"  onload=javascript:resizeimg(this,500,500) />';
//alert(name);
//document.write(name);
if(name!="")
  {
	  
	  document.getElementById('rating').innerHTML=name;
	//$('#rating').html(name);
	
	//$('#rating').html(unescape(UrlEncode(name)));
	
	

	/*	$.ajax({
		type: "POST",
		url: "uploadfile.php",
		data: "up_pic="+UrlEncode(name),
		callback:$('#rating').html('<img src=../../images/loading.gif />'),
		success: function(xml){			
			var weath=xml;		
			if(weath!=0)
				{$('#rating').html(weath);
				}
				else
				{$('#rating').html('<span class=red_10>错误提示：确保图片格式为jpg/gif,小于200K.<span>');
				}			
		  }
		});
	*/
  }
}

function UrlEncode(str){ 
 /*-- Modify from qiushuiwuhen --*/ 
 var i,temp,p,q; 
 var result=""; 
 for(i=0;i<str.length;i++){ 
  temp = str.charCodeAt(i); 
  if(temp>=0x4e00){ 
   execScript("ascCode=hex(asc(\""+str.charAt(i)+"\"))", "vbscript"); 
   result+=ascCode.replace(/(.{2})/g, "%$1"); 
  }else{ 
   result+=escape(str.charAt(i)); 
  } 
 } 
 return result; 
}  

function resizeimg(ImgD,iwidth,iheight) { 
     var image=new Image(); 
     image.src=ImgD.src; 
     if(image.width>0 && image.height>0){ 
        if(image.width/image.height>= iwidth/iheight){ 
           if(image.width>iwidth){ 
               ImgD.width=iwidth; 
               ImgD.height=(image.height*iwidth)/image.width; 
           }else{ 
                  ImgD.width=image.width; 
                  ImgD.height=image.height; 
                } 
               ImgD.alt=image.width+"×"+image.height; 
        } 
        else{ 
                if(image.height>iheight){ 
                       ImgD.height=iheight; 
                       ImgD.width=(image.width*iheight)/image.height; 
                }else{ 
                        ImgD.width=image.width; 
                        ImgD.height=image.height; 
                     } 
                ImgD.alt=image.width+"×"+image.height; 
            } 
　　　　　ImgD.style.cursor= "pointer"; //改变鼠标指针 
　　　　　ImgD.onclick = function() { window.open(this.src);} //点击打开大图片 
　　　　if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器，如果是IE 
　　　　　　ImgD.title = "请使用鼠标滚轮缩放图片，点击图片可在新窗口打开"; 
　　　　　　ImgD.onmousewheel = function img_zoom() //滚轮缩放 
　　　　　 { 
　　　　　　　　　　var zoom = parseInt(this.style.zoom, 10) || 100; 
　　　　　　　　　　zoom += event.wheelDelta / 12; 
　　　　　　　　　　if (zoom> 0)　this.style.zoom = zoom + "%"; 
　　　　　　　　　　return false; 
　　　　　 } 
　　　  } else { //如果不是IE 
　　　　　　　     ImgD.title = "点击图片可在新窗口打开"; 
　　　　　　   } 
    } 
} 

function clip(id){

	var clipBoardContent=""; 
	try{

		clipBoardContent+="";

		clipBoardContent+=document.getElementById(id).value;

		window.clipboardData.setData("Text",clipBoardContent);

		alert("你已复制你的推广连接!");
		document.getElementById(id).select();

	}catch(e){
		alert("非IE游览，请手动复制！");
		document.getElementById(id).select();
	}

}