//圖片等比例縮放
$(document).ready(function(){
/*家族會員區----------------
	$('.g_r1_c_photo1 > a >img').each(function(){
		imgWidth =$(this).attr('width');
		imgHeight=$(this).attr('height');
		
		if(imgWidth > 100 && imgHeight < 120)
		{//如果寬大於100
			$(this).attr('width','100');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
			//調整垂直
			marHeight=(120-changeHeight.attr('height'))/2;
			$(this).css('top',marHeight);
		}
		else if(imgWidth < 100 && imgHeight > 120)
		{
			$(this).attr('height','120');
			changeHeight=$(this).attr('height');
			adv=imgHeight/changeHeight;
			changeWidth=imgWidth/adv;
			changeWidth=$(this).attr('width',changeWidth);
		}
		else if(imgWidth < imgHeight)
		{
			$(this).attr('height','120');
			changeHeight=$(this).attr('height');
			adv=imgHeight/changeHeight;
			changeWidth=imgWidth/adv;
			changeWidth=$(this).attr('width',changeWidth);
		}
		else if(imgWidth > imgHeight)
		{
			$(this).attr('width','100');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
			//調整垂直
			marHeight=(120-changeHeight.attr('height'))/2;
			$(this).css('top',marHeight);
		}
	});
*/	
/*家族管理員區--------------
	$('.manage2_photo2 > a >img').each(function(){
		imgWidth =$(this).attr('width');
		imgHeight=$(this).attr('height');
		
		if(imgWidth > 100 || imgHeight < 120)
		{//如果寬大於100
			$(this).attr('width','100');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
			//調整垂直
			marHeight=(120-changeHeight.attr('height'))/2;
			$(this).css('top',marHeight);
		}
		else if(imgWidth < 100 || imgHeight > 120)
		{
			$(this).attr('height','120');
			changeHeight=$(this).attr('height');
			adv=imgHeight/changeHeight;
			changeWidth=imgWidth/adv;
			changeWidth=$(this).attr('width',changeWidth);
		}
		else if(imgWidth < imgHeight)
		{
			$(this).attr('height','120');
			changeHeight=$(this).attr('height');
			adv=imgHeight/changeHeight;
			changeWidth=imgWidth/adv;
			changeWidth=$(this).attr('width',changeWidth);
		}
		else if(imgWidth > imgHeight)
		{
			$(this).attr('width','100');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
			//調整垂直
			marHeight=(120-changeHeight.attr('height'))/2;
			$(this).css('top',marHeight);
		}
	});
*/
/*交流討論區會員照片---------------
	$('div.talk_photo_img > img').each(function(){
		imgWidth =$(this).attr('width');
		imgHeight=$(this).attr('height');
		
		if(imgWidth > 110 || imgHeight < 130)
		{//如果寬大於100
			$(this).attr('width','110');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
		}
		else if(imgWidth < 110 || imgHeight > 130)
		{
			$(this).attr('height','130');
			changeHeight=$(this).attr('height');
			adv=imgHeight/changeHeight;
			changeWidth=imgWidth/adv;
			changeWidth=$(this).attr('width',changeWidth);
		}
		else if(imgWidth < imgHeight)
		{
			$(this).attr('height','130');
			changeHeight=$(this).attr('height');
			adv=imgHeight/changeHeight;
			changeWidth=imgWidth/adv;
			changeWidth=$(this).attr('width',changeWidth);
		}
		else if(imgWidth > imgHeight)
		{
			$(this).attr('width','110');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
		}
	});
*/	
/*編輯器上傳照片---------------*/
	$('.talk2_2_3_1').find("img").each(function(){
		imgWidth =$(this).attr('width');
		imgHeight=$(this).attr('height');
		//alert(imgWidth);
		if(imgWidth > 570)
		{//如果寬大於100
			$(this).attr('width','570');
			changeWidth=$(this).attr('width');
			adv=imgWidth/changeWidth;
			changeHeight=imgHeight/adv;
			changeHeight=$(this).attr('height',changeHeight);
		}
	});
});

