﻿//淡化图片
function high(which2){
theobject=which2
if (window.downlighting) clearInterval(downlighting)
highlighting=setInterval("highlightit(theobject)",50)
}

function low(which2){
clearInterval(highlighting)
theobject=which2
downlighting=setInterval("downlightit(theobject)",50)
}

function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}

function downlightit(cur2){
if (cur2.filters.alpha.opacity>40)
cur2.filters.alpha.opacity-=20  //修改滑鼠移開圖示後的亮度，數字越小就越亮
else if (window.downlightit)
clearInterval(downlighting)
}
//Tab1
window.onerror = function(){return true;};
var tag_memory="";
var tag_memory_name="";
function change_tag(id) {
    if (tag_memory!="") {
        document.getElementById(tag_memory).style.fontWeight="100";
        document.getElementById(tag_memory).style.cursor = "hand";
        document.getElementById(tag_memory).style.background="url('../App_Themes/CCAP/Images/sidebar_bc.jpg')";
        document.getElementById(tag_memory).style.borderBottom="solid 0px;";
    }
    tag_memory=id;
    document.getElementById(id).style.fontWeight="100";
    document.getElementById(id).style.cursor = "default";
    document.getElementById(id).style.background="url('../App_Themes/CCAP/Images/btn_select.gif')";
    document.getElementById(id).style.borderBottom="solid 0px;";
    var tag_content_name="tag_content"+id.substr((id.length-1),1);
    if (tag_memory_name!="") {
        document.getElementById(tag_memory_name).style.display="none";
    }
    tag_memory_name=tag_content_name;
    document.getElementById(tag_content_name).style.display="";
}
//Tab2
window.onerror = function(){return true;};
var tags_memory="";
var tags_memory_name="";
function change_tags(id) {
    if (tags_memory!="") {
        document.getElementById(tags_memory).style.fontWeight="100";
        document.getElementById(tags_memory).style.cursor = "hand";
        document.getElementById(tags_memory).style.background="url('../App_Themes/CCAP/Images/sidebar_bc.jpg')";
        document.getElementById(tags_memory).style.borderBottom="solid 0px;";
    }
    tags_memory=id;
    document.getElementById(id).style.fontWeight="100";
    document.getElementById(id).style.cursor = "default";
    document.getElementById(id).style.background="url('../App_Themes/CCAP/Images/btn_select.gif')";
    document.getElementById(id).style.borderBottom="solid 0px;";
    var tags_content_name="tags_content"+id.substr((id.length-1),1);
    if (tags_memory_name!="") {
        document.getElementById(tags_memory_name).style.display="none";
    }
    tags_memory_name=tags_content_name;
    document.getElementById(tags_content_name).style.display="";
}
//判断字符长度
function CountText(source) 
{ 
    var currentValueLength; 
    var maxLength; 
    var objSource = document.getElementById(source); 
     
    if (null != objSource) 
    { 
        maxLength = objSource.limit; 
        currentValueLength = objSource.value.length; 
        var objCounter = document.all.LabelTextCounter; 
        if (null != objCounter)   
        { 
            var counterValue = maxLength - currentValueLength; 
            if (0 <= counterValue) 
            { 
                objCounter.innerHTML =  counterValue ; 
            } 
            else 
            { 
                objCounter.innerHTML = 0; 
                objSource.value = objSource.value.substring(0, maxLength); 
            } 
        }   
    }  
} 
// 公告滚动条
var tc;
window.onload=function(){
	var o=document.getElementById('ctl00_Pages_infozone');hscroll(o);
	window.setInterval(function(){window.clearTimeout(tc);o.firstChild.style.marginLeft='0px';scrollup(o,16,0);},5000);
}
function scrollup(o,d,c){
	if(d==c){
		var t=o.firstChild.cloneNode(true);
		o.removeChild(o.firstChild);o.appendChild(t);
		t.style.marginTop=o.firstChild.style.marginTop='0px';
		hscroll(o);
	}
	else{
		ch=false;var s=3,c=c+s,l=(c>=d?c-d:0);
		o.firstChild.style.marginTop=-c+l+'px';
		window.setTimeout(function(){scrollup(o,d,c-l)},50);
	}
}

function hscroll(o){
	var w1=o.firstChild.offsetWidth,w2=o.offsetWidth;
	if(w1<=w2)return;
	tc=window.setTimeout(function(){hs(o,w1-w2,0,w1-w2)},3500);
}

function hs(o,d,c,p){
	c++;var t=(c>0?-c:c);o.firstChild.style.marginLeft=t+'px';
	if(c==d){if(d==0){tc=window.setTimeout(function(){hs(o,p,0,p)},2500);}else tc=window.setTimeout(function(){hs(o,0,-p,p)},3500);}
	else tc=window.setTimeout(function(){hs(o,d,c,p)},5);
}
// 图片滚动条
//var MarqueeSpeed = 10; 
//document.getElementById("Marquee2").innerHTML=document.getElementById("Marquee1").innerHTML   
//function   Marquee(){   
//if(document.getElementById("Container").scrollLeft>=document.getElementById("Marquee1").scrollWidth)   
//document.getElementById("Container").scrollLeft=0   
//else   
//document.getElementById("Container").scrollLeft++   
//}   
//var MyMar = window.setInterval(Marquee,MarqueeSpeed)   
//document.getElementById("Container").onmouseover=function()   {window.clearInterval(MyMar)}   
//document.getElementById("Container").onmouseout=function()   {MyMar = window.setInterval(Marquee,MarqueeSpeed)}   
//先制作向上滚动的效果：
//　　插入代码：
//<!-- 指向链接图片url -->
//<base href="http://www.it365cn.com";>
//<div id=demo style=overflow:hidden;height:150;width:90;background:#214984;color:#ffffff>
//<div id=demo1>
//<!-- 定义图片 -->
//<img src="images/logo_1.gif">
//<img src="images/logo/flashempire.gif">
//<img src="images/logo.gif">
//<img src="images/logo/5dmedia.gif">
//<img src="images/logo/macromedia.gif">
//<img src="images/logo/sucaiw.gif">
//<img src="images/logo/blueieda.gif">
//<img src="images/logo/htmlcn.gif">
//<img src="images/logo/fwcn.gif">
//</div>
//<div id=demo2></div>
//</div>

//<script>
//var speed=30
//demo2.innerHTML=demo1.innerHTML
//function Marquee(){
//if(demo2.offsetTop-demo.scrollTop<=0)
//demo.scrollTop-=demo1.offsetHeight
//else{
//demo.scrollTop++
//}
//}
//var MyMar=setInterval(Marquee,speed)
//demo.onmouseover=function() {clearInterval(MyMar)}
//demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
//</script>

//　　制作向下滚动的效果：
//　　将上面“制作向上滚动的效果”中的红色字体Js部分替换成：
//<script>
//var speed=30
//demo2.innerHTML=demo1.innerHTML
//demo.scrollTop=demo.scrollHeight
//function Marquee(){
//if(demo1.offsetTop-demo.scrollTop>=0)
//demo.scrollTop+=demo2.offsetHeight
//else{
//demo.scrollTop--
//}
//}
//var MyMar=setInterval(Marquee,speed)
//demo.onmouseover=function() {clearInterval(MyMar)}
//demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
//</script>

//　　制作向左滚动的效果：
//<base href="http://www.it365cn.com";>
//<div id=demo style=overflow:hidden;height:33;width:500;background:#214984;color:#ffffff>
//<table align=left cellpadding=0 cellspace=0 border=0>
//<tr>
//<td id=demo1 valign=top><img src="images/logo_1.gif"><img src="images/logo/flashempire.gif"><img src="images/logo.gif"><img src="images/logo/5dmedia.gif"><img src="images/logo/macromedia.gif"><img src="images/logo/sucaiw.gif"><img src="images/logo/blueieda.gif"><img src="images/logo/htmlcn.gif"><img src="images/logo/fwcn.gif">
//</td>
//<td id=demo2 valign=top></td>
//</tr>
//</table>
//</div>

//<script>
//var speed=30
//demo2.innerHTML=demo1.innerHTML
//function Marquee(){
//if(demo2.offsetWidth-demo.scrollLeft<=0)
//demo.scrollLeft-=demo1.offsetWidth
//else{
//demo.scrollLeft++
//}
//}
//var MyMar=setInterval(Marquee,speed)
//demo.onmouseover=function() {clearInterval(MyMar)}
//demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
//</script>

//　　制作向右滚动的效果：
//　　将上面“制作向左滚动的效果”中的红色字体Js部分替换成：
//<script>
//var speed=30
//demo2.innerHTML=demo1.innerHTML
//demo.scrollLeft=demo.scrollWidth
//function Marquee(){
//if(demo.scrollLeft<=0)
//demo.scrollLeft+=demo2.offsetWidth
//else{
//demo.scrollLeft--
//}
//}
//var MyMar=setInterval(Marquee,speed)
//demo.onmouseover=function() {clearInterval(MyMar)}
//demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
//</script>

