﻿//
// JScript 文件 
//
function CDC$(aControlID){
    return document.getElementById(aControlID);
}
function ShiftVisible(aObjName){
    var targetElement=CDC$(aObjName);
	if (targetElement.style.display == "none" || targetElement.style.display == "") {
		targetElement.style.display = "block";
	} else {
		targetElement.style.display = "none";
	} 
	return false;
}

function textOnOff(aObj){
    ShiftVisible(aObj+"_more");
    ShiftVisible(aObj+"_less");
	return false;
}
function ShiftCommentArea(aObj){
    ShiftVisible(aObj+"_content");
    ShiftVisible(aObj+"_hint");
	return false;
}
//通用的复制代码
var Clipboard=0;
function CopyUrl(){ 
    copyit(window.location.toString());
	alert("地址复制成功！");
    return false;
}
function Copycomment(){ 
    var reg=/(<BR>|<.*?>)/igm;
    var newLine = String.fromCharCode(13) +String.fromCharCode(10);
    copyit( word_title+ "\r\n" + CDC$("panel_comment").innerHTML.replace(reg, newLine) +"\r\n（"+web_title+"："+web_host+"）");
    CDC$("link_Copycomment").innerHTML="<span style=\"font-size:12px\"><font color=red>复制成功</font></span>"
    return false;
}
function GetClipboard(){  
	return Clipboard;
}
function copyit(textit) {
	Clipboard=textit;
	if (window.clipboardData) {
		window.clipboardData.setData("Text",textit);
	} else {
		var flashcopier = 'flashcopier';
		if(!CDC$(flashcopier)) {
			var divholder = document.createElement('div');
			divholder.id = flashcopier;
			document.body.appendChild(divholder);
		}
		CDC$(flashcopier).innerHTML = '';
		var divinfo = '<embed src="/images/_clipboard.swf" width="0" height="0" type="application/x-shockwave-flash" id="flashforcopy" name="flashforcopy"></embed>';
		CDC$(flashcopier).innerHTML = divinfo; 
	}
}
//通用的复制代码 结束 