// =========================================
var dHtml = 'You must general contents';
var __left = '0';
var __top = '0';
var __width = '800';
var __height = '600';
var __background = '#FFFFFF';
var __w = $('body').width();
var __h = $('body').height();

// ===========================
function showFull( __this ) {

    backgroundFullColor();
    var dHtml = '<div id="show-image">'
                    + '<div class="content">'
                    + '<img src="' + ( __this.src ) + '" />'
                    + '</div>'
                    + '<div class="nav">' + ( __this.alt ) + '<b onclick="return cancelDialog( \'usageBlock\' );">&nbsp;</b></div>'
                + '</div>';

    addDialogBlock( dHtml , __left = '0', __top = '0', __width = '800', __height = '600', __background = '#FFFFFF', __status = true );
}

// 构建自定义函数
String.prototype.trim = function(){

  return this.replace(/^\s+(.*?)\s+$/,"$1");

}
/**
+------------------------------
* 背景 满屏 颜色
+------------------------------
*/
function backgroundFullColor() {

	if(F('fullcolorinround')) {
		if(F('fullcolorinround').style.display == 'none') {
			F('fullcolorinround').style.display = '';
		} else {
			F('fullcolorinround').style.display = 'none';
		}

	} else {
		var gration = CR('div');
		document.body.appendChild(gration);
		gration.id = 'fullcolorinround';
		gration.align = 'center';
		var w = $('body').width();
		var h = $('body').height();
		var bodySize = getScreenSize();

		with(gration.style) {
			position = 'absolute';
			left = '0px';
			top  = '0px';
			background = '#000000';
			width = bodySize[0] + 'px';
			height = bodySize[1] + 'px';
			zIndex = 1338;
			if(isIE()) {
			  filter = "Alpha(Opacity=90)";
			 } else {
			  opacity = 0.9;
			}
		}
	}
}
/**
+-----------------------------------
* 增加一个对话框
+-----------------------------------
*/
function addDialogBlock( dHtml, __left, __top, __width, __height, __background, __status ) {
    if( true == __status ) {
        __top = (__h - __height )/2;
        __left = ( __w - __width )/2;
    }
    __top = 100;
    if( F('usageBlock') ) {
        if(F('usageBlock').style.display == 'none') {
            F('usageBlock').style.display = '';
        } else {
            F('usageBlock').style.display = 'none';
        }
        $("#usageBlock").html( dHtml );

    } else {
        var gration = CR('div');
        document.body.appendChild(gration);
        gration.id = 'usageBlock';
        gration.align = 'center';
        var w = $('body').width();
        var h = $('body').height();
        var bodySize = getScreenSize();

        with(gration.style) {
            position = 'absolute';
            left = __left + 'px';
            top  = __top + 'px';
            background = __background;
            width = __width + 'px';
            zIndex = 99999;
            if(isIE()) {
              filter = "Alpha(Opacity=100)";
             } else {
              opacity = 1;
            }
        }
        $("#usageBlock").html( dHtml );
    }
}
/**
+------------------------------
* Browse screen size
+------------------------------
*/
function getScreenSize(){

	var bodySize = [];

	with(document.documentElement) {

		bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
		bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;

	}

	return bodySize;
}

/**
+--------------------
*
+--------------------
*/
function CR(id) {
	return document.createElement(id);
}
/**
+--------------------
*
+--------------------
*/
function isIE() {
	return (document.all && ActiveXObject && !window.opera) ? true:false;
}
/**
+--------------------
*
+--------------------
*/
function F(id) {
	return document.getElementById(id);
}
/**
+--------------------
*
+--------------------
*/
function cancelDialog( __id ) {
	F(__id).style.display = 'none';
    document.body.style.overflow = '';
    F('fullcolorinround').style.display = 'none';
}

//==================
$(function(){
$("dd").find('img').mouseover(function(i){

    $(this).css({ "border-color": "#8AB114", "border-width": "1px", "border-style": "solid", "background-color":"#8AB114" });

});


$("dd").find('img').mouseout(function(i){
    $(this).css({ "border-color": "#8AB114", "border-width": "1px", "border-style": "solid", "background-color":"#FFFFFF"  });
});

})