//begin:用于缩小过大的图片
function setImgSize(img,width,height){

	var MaxWidth = width;   //设置图片宽度界限
	var MaxHeight = height;   //设置图片高度界限
	var HeightWidth = img.offsetHeight/img.offsetWidth;   //设置高宽比
	var WidthHeight = img.offsetWidth/img.offsetHeight;   //设置宽高比

	if (img.offsetWidth > MaxWidth){
		img.width = MaxWidth;
		img.height = MaxWidth*HeightWidth;

		img.title = "点击看大图";
		img.onclick = function() { window.open(img.src);}
		img.style.cursor = "pointer";
	}

	if (img.offsetHeight > MaxHeight){
		img.height = MaxHeight;
		img.width = MaxHeight*WidthHeight;

		img.title = "点击看大图";
		img.onclick = function() { window.open(img.src);}
		img.style.cursor = "pointer";
	}

}
//end:用于缩小过大的图片



//begin:加为好友
function addcontacts(u){
//做好友
window.open("http://www.auly.com/contacts/add-contacts.asp?contacts="+u, "contactswin", "height=300, width=500, top=50, left=50, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");

}
//end:加为好友




//begin:加推荐
function addrecs(flag,id){
window.open("http://www.auly.com/contacts/recommand/add-recs.asp?flag="+flag+"&id="+id, "recommand", "height=300, width=500, left="+(screen.availWidth-500)/2+", top="+(screen.availHeight-300)/2+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no, titlebar=no;");
}
//end:加推荐



//begin:即时帖
function contactspost(url){
window.open("http://www.auly.com/contacts/post.asp?url="+url, "recommand", "height=330, width=500, left="+(screen.availWidth-500)/2+", top="+(screen.availHeight-330)/2+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no, titlebar=no;");
}
//end:即时帖




//begin:打开窗口
function open_window(url,w,h){
window.open(url, "win", "height="+h+", width="+w+", top="+(screen.availHeight-h)/2+", left="+(screen.availWidth-w)/2+", toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
}
//end:打开窗口
