﻿document.writeln("<script type=\"text\/javascript\" src=\"\/Skin\/Skin_05\/script.js\"><\/script>");
document.writeln("<script type=\"text\/javascript\" src=\"\/Skin\/Skin_05\/jquery2.js\"><\/script>");

/**
* @ Author : 花心萝卜 , www.7xiwl.com
* @ version : 2009.11.26
*/
var DomainUrl = top.location.hostname;
var AuthUrl = top.location.hostname;

window.onerror=function(){ return true; };

$ = function(em) {
    if (document.getElementById){ return document.getElementById(em); }
    else if (document.all){ return document.all[em]; }
    else if (document.layers){ return document.layers[em]; }
    else{ return null; }
};

$F = function(em){	return document.getElementById(em).value;	};

function show_select(_title, _options, _input){
    option_obj = $(_options);
    option_obj.style.display = (option_obj.style.display == '') ? 'none' : '';
    option_obj.onblur = function() { option_obj.style.display = 'none'; };
    option_obj.focus();
    for (var i = 0; i < option_obj.childNodes.length; i++){
        option_obj.childNodes[i].onmouseover = function(){ this.className = 'options_over pointer'; };
        option_obj.childNodes[i].onmouseout = function(){ this.className = 'options_out pointer'; };
        option_obj.childNodes[i].onclick = function(){
            $(_title).innerHTML = this.innerHTML;
            $(_input).value = this.id;
            option_obj.blur();
            option_obj.style.display = 'none';
        }
    }
 };
function create_div( _str, _msgw, _msgh ){
    //document.documentElement.style.overflow='hidden';
    //document.getElementsByTagName('body')[0].style.overflow='hidden';
    var bgObj=document.createElement('div');
    bgObj.setAttribute('id','bgDiv');
    bgObj.style.position='absolute';
    bgObj.style.top='0px';
    bgObj.style.left='0px';
    bgObj.style.background='#FFFFFF';
    bgObj.style.opacity='0.60';
    bgObj.style.filter = 'alpha(opacity=60)';
    bgObj.style.width='100%';
    bgObj.style.height=document.body.scrollHeight + 'PX';
    bgObj.style.zIndex = '10000';
    document.body.appendChild(bgObj);

    var msgObj = document.createElement('div');
    var _width = document.body.clientWidth;
    var _height = document.documentElement.clientHeight||document.body.clientHeight;
    var LeftPosition = (_width) ? (_width - _msgw)/2 : 0  ;
    var TopPosition = (_height) ? (_height - _msgh)/2 + document.documentElement.scrollTop : 0 ;
    msgObj.setAttribute('id','msgDiv');
    msgObj.setAttribute('align','center');
    msgObj.style.position = 'absolute';
    msgObj.style.border='0';
    msgObj.style.left = LeftPosition + 'px';
    msgObj.style.top  = TopPosition + 'px';
    msgObj.style.width = _msgw + 'px';
    msgObj.style.height = _msgh + 'px';
    msgObj.style.textAlign = 'center';
    msgObj.style.zIndex = '10001';
    msgObj.innerHTML= _str;
    document.body.appendChild(msgObj);
};
function close_div(){
    //document.documentElement.style.overflow='auto';
    document.body.removeChild($('bgDiv'));
    document.body.removeChild($('msgDiv'));
};


function do_alert( msg ){
    var _height = document.documentElement.clientHeight||document.body.clientHeight;
    var _top = (_height) ? (_height - 39)/2 + document.documentElement.scrollTop : 0;
    var msgObj=document.createElement('div');
    msgObj.setAttribute('id', 'msgInfo');
    msgObj.setAttribute('align', 'center');
    msgObj.style.position = 'absolute';
    msgObj.style.top = _top + 'px';
    msgObj.style.left = '0';
    msgObj.style.width = '100%';
    msgObj.style.height = '33px';
    msgObj.style.zIndex = '999';
    msgObj.innerHTML = '<span id="alert">'+ msg +'</span>';
    document.body.appendChild(msgObj);
};

function close_alert(){
    document.body.removeChild($('msgInfo'));
};


function Trim(){
	return this.replace(/\s+$|^\s+/g,"");
}
String.prototype.Trim=Trim;

function getObjValues(id){
	if(getObjects(id).value!=undefined)
		return getObjects(id).value.Trim();
	else
		return "";
}
function getObjects(id) { 	
	if (document.getElementById) { 
		return document.getElementById(id); 
	} else if (document.all) { 
		return document.all[id]; 
	} else if (document.layers) { 
		return document.layers[id]; 
	} 
}


function createXMLHttpRequest(){
       	if (window.XMLHttpRequest) {//wwww.mkxk.com
		XMLHttpReq=new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {//IE 浏览器
	     try {
			    XMLHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
	     } catch (e) {
		        try{
					XMLHttpReq=new ActiveXObject("Micrsost.XMLHTTP");
				} catch(e){}
	     }
        }
}
var cache = new Array();
function getHttpObject() {
    var objType = false;
    try {
        objType = new ActiveXObject('Msxml2.XMLHTTP');
    } catch(e) {
        try {
            objType = new ActiveXObject('Microsoft.XMLHTTP');
        } catch(e) {
            objType = new XMLHttpRequest();
        }
    }
    return objType;
}

function getlogin(){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET", ""+web_url+"skin/skin_05/Ajax_Login.asp", true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
         if (theHttpRequest.status == 200) {
           document.getElementById("userinfo").innerHTML = unescape(theHttpRequest.responseText);
           } else {
           document.getElementById("userinfo").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}

function getdoHits(_id){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET", ""+web_url+"skin/skin_05/Ajax.asp?action=good_bad&id="+ _id, true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
         if (theHttpRequest.status == 200) {
           document.getElementById("doHits").innerHTML = unescape(theHttpRequest.responseText);
           } else {
           document.getElementById("doHits").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}

function up_down(_id, _do){
	 createXMLHttpRequest();
	 XMLHttpReq.open("GET", ""+web_url+"skin/skin_05/Ajax.asp?action=doHits&id="+ _id +"&dowhat="+ _do,true);
	 XMLHttpReq.onreadystatechange= function(){
		if(XMLHttpReq.readyState == 4){
			if(XMLHttpReq.status == 200){
	           	                 if(XMLHttpReq.responseText == "Err_145"){
	           	                 do_alert('您24小时内已顶（踩）过此舞曲！'); setTimeout('close_alert()', 2000);
		                 }
                                             getdoHits(_id);
			}else alert("网络链接失败");
		}
	}
	 XMLHttpReq.send(null);
	}

function sendRequest(){
         createXMLHttpRequest();
	 XMLHttpReq.open("POST", ""+web_url+"skin/skin_05/Ajax_Login.asp",true);
	 XMLHttpReq.onreadystatechange= processResponse;
	 XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	 XMLHttpReq.send("name=" + escape(getObjValues("username")) + "&pwd=" +escape(getObjValues("password"))  + "&slogin=" + escape(getObjValues("slogin")));
        }

function goutRequest(){
	 createXMLHttpRequest();
	 XMLHttpReq.open("GET", ""+web_url+"skin/skin_05/Ajax_Login.asp?Ylmv_Com=logout",true);
	 XMLHttpReq.onreadystatechange= processResponse;
	 XMLHttpReq.send(null);  
	}

function processResponse() {
	 if (XMLHttpReq.readyState==4){
	 if(XMLHttpReq.status==200){
	 var msg=XMLHttpReq.responseText;
	           if(msg == "Err_100"){
	           do_alert('用户名不允许为空！'); setTimeout('close_alert()', 3000);
	           } else if(msg == "Err_101"){
	           do_alert('用户名非法！'); setTimeout('close_alert()', 3000);
	           } else if(msg == "Err_102"){
	           do_alert('密码不允许为空！'); setTimeout('close_alert()', 3000);
	           } else if(msg == "Err_103"){
	           do_alert('用户名或密码错误，请重试！'); setTimeout('close_alert()', 3000);
	           } else if(msg == "Err_104"){
	           do_alert('评论内容最少2个字符！'); setTimeout('close_alert()', 2000);
	           } else if(msg == "Err_105"){
	           do_alert('发表评论成功'); setTimeout('close_alert()', 1000);
	           document.getElementById("CBody").innerHTML = '';
	           } else if(msg == "Err_106"){
	           alert('对不起，请 60 秒后再发表评论！'); return false;
	           } else {
	           document.getElementById("userinfo").innerHTML =unescape(msg);
	           }
	 } else {
           do_alert('您请求的页面出现异常错误！'); setTimeout('close_alert()', 5000);
	        }
         }
   }

//////////////////////////////////////////////////////////////////////////////////

