if (top.location != location) top.location.href = location.href;
self.moveTo(-2,-4);
self.resizeTo(screen.availWidth+6,screen.availHeight+6);
this.focus();
window.setTimeout('this.focus();',1000);


var proMaxHeight = 1500;
var proMaxWidth = 920;

function proDownImage(ImgD){
      var image=new Image();
      image.src=ImgD.src;
      if(image.width>0 && image.height>0){
      var rate = (proMaxWidth/image.width < proMaxHeight/image.height)?proMaxWidth/image.width:proMaxHeight/image.height;
    if(rate <= 1){   
     ImgD.width = image.width*rate;
     ImgD.height =image.height*rate;
    }
    else {
                          ImgD.width = image.width;
                          ImgD.height =image.height;
                  }
      }
}

function setCookie(name, value, expiresd)
{
	var expdate = new  Date();
	var expires = arguments[2] || null;
	var  path  =  arguments[3] || "/";
	var  domain  =  arguments[4] || null;
	var  secure  =  arguments[5] || false;
	if(expires) expdate.setMinutes(expdate.getMinutes() + parseInt(expires));
	var cookietemp = escape(name) + '=' + escape(value) + (expires ? '; expires=' + expdate.toGMTString() : '') + (path ? '; path=' + path : '')+ (domain ? '; domain=' +  domain : '')+(secure ? '; secure' : '');
	document.cookie = cookietemp;
}
function getCookie(name)
{
	var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
	if(arr=document.cookie.match(reg))
	{
		return unescape(arr[2]);
	}
	else
	{
		return false;
	}

}
function addBookmark(url, title)
{
	if(window.sidebar){ 
		window.sidebar.addPanel(title, url, "")
	}else if(document.all){
		window.external.AddFavorite(url, title)
	}else{
		alert("本操作暂不支持您的浏览器, 请您手动添加到收藏夹/书签.")
	}
}
function addBookmark1()
{
	if (!getCookie('favorited'))
	{
		setCookie('favorited', '1', 60*24*3650, '/');
		alert('我们检测到您第一次访问『爱死美女』，为了方便您下次访问，请点确定收藏我们的网址吧！');
		addBookmark('http://www.24mn.net#sc', '爱死美女（www.24mn.net） - 最大胆的美女人体艺术网站');
	}
}
setTimeout('addBookmark1()', 7777);
