//新建系统用的trim方法
String.prototype.trim  =  function()
{
        //  用正则表达式将前后空格
        //  用空字符串替代。
        return  this.replace(/(^\s*)|(\s*$)/g,"");
}

var imageLoaded=false;
var photoWidth = 0;
var photoHeight = 0;

//图片已载入
function loaded()
{
    imageLoaded=true;
	photoWidth = document.images["photo"].width;
	photoHeight = document.images["photo"].height;
	
	document.getElementById("m516").innerHTML="<a href=\"http://www.qinglvzhuang.com.cn/\" class=\"s12\" target=\"_blank\">买情侣装</a><span class=\"sl\">|</span><a href=\"http://www.qipaozhuang.com/\" class=\"s12\" target=\"_blank\">买旗袍</a><span class=\"sl\">|</span><a href=\"http://www.taobaoxiangce.com/\" class=\"s12\" target=\"_blank\" style=\"color:green\" onmouseover=\"this.style.color='white'\" onmouseout=\"this.style.color='green'\">淘宝卖家必备相册</a><span class=\"sl\">|</span><a href=\"http://qinxin.qicaise.com\" style=\"color:red\" class=\"s12\" target=\"_blank\" onmouseover=\"this.style.color='white'\" onmouseout=\"this.style.color='red'\">亲信：为了手机聊天能够更省钱！</a>";
	
	
}


//更改背景色
function bg(color)
{
    imageBG.style.background=color;
}

//图片缩放
function setPhotoScale(value)
{
    if(imageLoaded)
	photo.width=photoWidth*value/100;
}

//彩色与黑白切换
function grayScale()
{
    if(photo.style.filter!="")
	{
	    photo.style.filter="";
	}
	else
	{
	    photo.style.filter="gray()";
	}    
}
