809 lines
25 KiB
JavaScript
809 lines
25 KiB
JavaScript
function sizeOn(){
|
|
document.getElementById("head_main").style.height = "347px";
|
|
document.getElementById("footer_mainW").style.top = "727px";
|
|
}
|
|
function sizeOff(){
|
|
document.getElementById("head_main").style.height = "450px";
|
|
document.getElementById("footer_mainW").style.top = "830px";
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function ViewCss(css) {
|
|
document.write("\<link rel=\"stylesheet\" type=\"text/css\" href=\"" + css + "\">");
|
|
}
|
|
|
|
function SetSkin(Skin_Color){
|
|
setCookie( "skin_ck", Skin_Color , 1000);
|
|
self.location.reload()
|
|
}
|
|
|
|
function setCookie( name, value, expiredays )
|
|
{
|
|
var todayDate = new Date();
|
|
todayDate.setDate( todayDate.getDate() + expiredays );
|
|
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
|
|
}
|
|
|
|
function getCookie( name ){
|
|
var nameOfCookie = name + "=";
|
|
var x = 0;
|
|
while ( x <= document.cookie.length )
|
|
{
|
|
var y = (x+nameOfCookie.length);
|
|
if ( document.cookie.substring( x, y ) == nameOfCookie ) {
|
|
if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
|
|
endOfCookie = document.cookie.length;
|
|
return unescape( document.cookie.substring( y, endOfCookie ) );
|
|
}
|
|
|
|
x = document.cookie.indexOf( " ", x ) + 1;
|
|
|
|
if ( x == 0 ) break;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
|
|
//인풋박스 클릭시보더값 변경
|
|
function focus_on1_blue(str) {
|
|
(str).style.border='1px solid #006DD2';
|
|
(str).style.background='#ffffff';
|
|
}
|
|
function focus_on1_orange(str) {
|
|
(str).style.border='1px solid #F7883D';
|
|
(str).style.background='#ffffff';
|
|
}
|
|
function focus_on1_sky(str) {
|
|
(str).style.border='1px solid #38A8E7';
|
|
(str).style.background='#ffffff';
|
|
}
|
|
function focus_on1_green(str) {
|
|
(str).style.border='1px solid #07B91C';
|
|
(str).style.background='#ffffff';
|
|
}
|
|
function focus_on1_gray(str) {
|
|
(str).style.border='1px solid #8F8F8F';
|
|
(str).style.background='#ffffff';
|
|
}
|
|
|
|
function focus_off1(str) {
|
|
(str).style.border='1px solid #cdcdcd';
|
|
(str).style.background='#ffffff';
|
|
}
|
|
|
|
function focus_on2(str) {
|
|
(str).style.border='1px solid #8F8F8F';
|
|
(str).style.background='#F7F5F7';
|
|
}
|
|
|
|
function focus_off2(str) {
|
|
(str).style.border='1px solid #cdcdcd';
|
|
(str).style.background='#F7F5F7';
|
|
}
|
|
|
|
|
|
//2단계메뉴 펼침
|
|
function leftMenu(menuIdx){
|
|
for(i=1 ; i<=12 ; i++){
|
|
try{
|
|
objLayer = document.getElementById("leftSubMenu"+i);
|
|
// objImg = document.getElementById("leftMenuImg"+i);
|
|
|
|
if(i == menuIdx){
|
|
// objImg.src = objImg.src.replace(".gif", "_on.gif");
|
|
objLayer.style.display = "block";
|
|
}else{
|
|
// objImg.src = objImg.src.replace("_on.gif", ".gif");
|
|
objLayer.style.display = "none";
|
|
}
|
|
}catch(e){ }
|
|
}
|
|
}
|
|
|
|
//3단계메뉴 펼침
|
|
function leftMenuz(menuIdx){
|
|
for(i=1 ; i<=12 ; i++){
|
|
try{
|
|
objLayer = document.getElementById("leftSubMenuz"+i);
|
|
// objImg = document.getElementById("leftMenuImg"+i);
|
|
|
|
if(i == menuIdx){
|
|
// objImg.src = objImg.src.replace(".gif", "_on.gif");
|
|
objLayer.style.display = "block";
|
|
}else{
|
|
// objImg.src = objImg.src.replace("_on.gif", ".gif");
|
|
objLayer.style.display = "none";
|
|
}
|
|
}catch(e){ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//퀵 메뉴
|
|
QuickMenu = function(element, startPoint, endPoint) {
|
|
var STATICMENU = element;
|
|
var stmnScrollSpeed = 1;
|
|
var stmnTimer;
|
|
|
|
RefreshStaticMenu = function ()
|
|
{
|
|
var stmnStartPoint = parseInt(STATICMENU.style.top, 10);
|
|
var stmnEndPoint = parseInt(document.documentElement.scrollTop, 10)+endPoint;
|
|
var stmnRefreshTimer = 1;
|
|
|
|
if ( stmnStartPoint != stmnEndPoint ) {
|
|
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 17 );
|
|
STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + "px";
|
|
stmnRefreshTimer = stmnScrollSpeed;
|
|
}
|
|
stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
|
|
}
|
|
|
|
this.InitializeStaticMenu = function ()
|
|
{
|
|
STATICMENU.style.top = startPoint + "px";
|
|
RefreshStaticMenu();
|
|
}
|
|
}
|
|
|
|
|
|
//글자크기
|
|
function wdSetFontSize(a) {
|
|
var defaultFontSize = 1;//em
|
|
var minFontSize = 1;//em
|
|
var maxFontSize = 2;//em
|
|
try{
|
|
obj = document.getElementById("sub");
|
|
var objFontSize = obj.style.fontSize;
|
|
}catch(e){
|
|
obj = document.getElementById("wrapper_main");
|
|
var objFontSize = obj.style.fontSize;
|
|
}
|
|
if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
|
|
var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
|
|
if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 늘릴 수 없습니다."); }
|
|
else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 줄일 수 없습니다."); }
|
|
else { obj.style.fontSize = checkFontSize+"em"; }
|
|
// alert(checkFontSize);
|
|
}
|
|
function wdSetFontSize_main(a) {
|
|
var defaultFontSize = 1;//em
|
|
var minFontSize = 1;//em
|
|
var maxFontSize = 2;//em
|
|
obj = document.getElementById("wrapper_main");
|
|
var objFontSize = obj.style.fontSize;
|
|
if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
|
|
var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
|
|
if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 늘릴 수 없습니다."); }
|
|
else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 줄일 수 없습니다."); }
|
|
else { obj.style.fontSize = checkFontSize+"em"; }
|
|
// alert(checkFontSize);
|
|
}
|
|
|
|
//인쇄
|
|
var initBody;
|
|
function BeforePrint() {
|
|
initBody = document.body.innerHTML;
|
|
document.body.innerHTML = print_area.innerHTML;
|
|
}
|
|
|
|
function AfterPrint() {
|
|
document.body.innerHTML = initBody;
|
|
}
|
|
|
|
function ReportPrint() {
|
|
window.onbeforeprint = BeforePrint;
|
|
window.onafterprint = AfterPrint;
|
|
window.print();
|
|
}
|
|
|
|
|
|
|
|
//팝업존
|
|
function popupZone(){
|
|
for(i=1;i<=popupItemCount;i++){
|
|
if(popupZoneTmpVal!=1) {
|
|
popupZoneVal = popupZoneTmpVal;
|
|
popupZoneTmpVal = 1;
|
|
}
|
|
if(popupZoneVal == popupItemCount+1) popupZoneVal = 1;
|
|
if(popupZoneVal==0) popupZoneVal = 1;
|
|
id1 = "popnum"+i
|
|
id2 = "popBanner_"+i
|
|
if(popupZoneVal==i){
|
|
document.getElementById(id1).setAttribute('src',"/img/main/pop_m0"+i+"_on.gif");
|
|
document.getElementById(id2).style.display = "block";
|
|
}else{
|
|
document.getElementById(id1).setAttribute('src',"/img/main/pop_m0"+i+".gif");
|
|
document.getElementById(id2).style.display = "none";
|
|
}
|
|
}
|
|
|
|
popupZoneVal = popupZoneVal + 1;
|
|
autocontrolvar=setTimeout("popupZone()",4000);
|
|
}
|
|
|
|
function popupZoneStop(chk){
|
|
|
|
if(chk){
|
|
//alert("정지!!");
|
|
clearTimeout(autocontrolvar);
|
|
|
|
//obj.style.display="block";
|
|
}else{
|
|
clearTimeout(autocontrolvar);
|
|
popupZone();
|
|
}
|
|
}
|
|
|
|
function popupZoneStop2(chk){
|
|
|
|
if(chk == "p"){
|
|
clearTimeout(autocontrolvar);
|
|
document.getElementById("popzone_startz").style.display = "block";
|
|
document.getElementById("popzone_stopz").style.display = "none";
|
|
}else{
|
|
|
|
clearTimeout(autocontrolvar);
|
|
document.getElementById("popzone_startz").style.display = "none";
|
|
document.getElementById("popzone_stopz").style.display = "block";
|
|
|
|
popupZone();
|
|
}
|
|
}
|
|
|
|
function popupZoneMove(num){
|
|
for(i=1;i<=popupItemCount;i++){
|
|
id1 = "popnum"+i
|
|
id2 = "popBanner_"+i
|
|
if(num==i){
|
|
document.getElementById(id1).setAttribute('src',"/img/main/pop_m0"+i+"_on.gif");
|
|
document.getElementById(id2).style.display = "block";
|
|
}else{
|
|
document.getElementById(id1).setAttribute('src',"/img/main/pop_m0"+i+".gif");
|
|
document.getElementById(id2).style.display = "none";
|
|
}
|
|
}
|
|
popupZoneVal = num;
|
|
popupZoneTmpVal = num;
|
|
popupZoneStop(1);
|
|
}
|
|
|
|
|
|
function popupZoneShow(type){
|
|
if(type){
|
|
document.getElementById("spot_1").style.display = "none";
|
|
document.getElementById("spot_2").style.display = "";
|
|
}else{
|
|
document.getElementById("spot_1").style.display = "";
|
|
document.getElementById("spot_2").style.display = "none";
|
|
}
|
|
}
|
|
|
|
|
|
//주메뉴 펼침
|
|
function menuMouseOver(idx){
|
|
var objImage;
|
|
var objLayer;
|
|
var objLayer2;
|
|
|
|
for(i=1 ; i<=8 ; i++){
|
|
try{objImage = document.getElementById("menuimg"+i);}catch(err){objImage=null;}
|
|
try{objLayer = document.getElementById("menu"+i+"01");}catch(err){objLayer=null;}
|
|
try{objLayer2 = document.getElementById("menuz"+i+"01");}catch(err){objLayer=null;}
|
|
|
|
if(i == idx){
|
|
if(objImage){objImage.src = objImage.src.replace(i+".gif", i+"_on.gif");}
|
|
if(objLayer){objLayer.style.display = "block";}
|
|
if(objLayer2){objLayer2.style.display = "block";}
|
|
}else{
|
|
if(objImage){objImage.src = objImage.src.replace(i+"_on.gif", i+".gif");}
|
|
if(objLayer){objLayer.style.display = "none";}
|
|
if(objLayer2){objLayer2.style.display = "none";}
|
|
}
|
|
}
|
|
}
|
|
|
|
function submenuimgMouseOver(idx, subIdx){
|
|
objImage = document.getElementById("submenuimg"+idx+""+subIdx);
|
|
if(subIdx.length == 1) subIdx = "0"+subIdx;
|
|
objImage.src = objImage.src.replace("menu"+idx+subIdx+".", "menu"+idx+subIdx+"_on.");
|
|
}
|
|
|
|
function submenuimgMouseOut(idx, subIdx){
|
|
objImage = document.getElementById("submenuimg"+idx+""+subIdx);
|
|
if(subIdx.length == 1) subIdx = "0"+subIdx;
|
|
objImage.src = objImage.src.replace("menu"+idx+subIdx+"_on.", "menu"+idx+subIdx+".");
|
|
}
|
|
|
|
|
|
//전체메뉴펼침
|
|
function if_showhidden(zz) {
|
|
var obj = document.getElementById(zz);
|
|
if(obj.style.display == "none" || obj.style.display == "") {
|
|
obj.style.display = "block";
|
|
} else {
|
|
obj.style.display = "none";
|
|
}
|
|
}
|
|
|
|
|
|
//배너
|
|
var mtickerEl = new Array();
|
|
function initmTicker(mtickerContainer, mtickerContent, delay) {
|
|
mtickerEl[mtickerEl.length] = mtickerContainer;
|
|
var speed = 10;
|
|
var mtickerElsum = 1;
|
|
mtickerContainer.delay = delay/(speed/mtickerElsum);
|
|
mtickerContainer.moveOffset = mtickerContainer.offsetHeight;
|
|
mtickerContainer.count = 0;
|
|
mtickerContainer.mtickerOver = false;
|
|
mtickerContainer.cont = mtickerContent;
|
|
mtickerContainer.cont.currentHeight = 0;
|
|
mtickerContainer.move = setInterval("movemTicker()", speed);
|
|
for (i=0; i<mtickerEl.length; i++) {
|
|
mtickerEl[i].onmouseover = function() { this.mtickerOver=true; }
|
|
mtickerEl[i].onmouseout = function() { this.mtickerOver=false; }
|
|
}
|
|
}
|
|
function movemTicker() {
|
|
for (i=0; i<mtickerEl.length; i++) {
|
|
if (mtickerEl[i].cont.currentHeight % mtickerEl[i].moveOffset == 0 && mtickerEl[i].count < mtickerEl[i].delay) {
|
|
if(!mtickerEl[i].mtickerOver) mtickerEl[i].count++;
|
|
} else {
|
|
mtickerEl[i].count = 0;
|
|
mtickerEl[i].cont.currentHeight -= mtickerEl[i].moveOffset;
|
|
if (mtickerEl[i].cont.currentHeight % (mtickerEl[i].cont.offsetHeight) == 0) {
|
|
mtickerEl[i].cont.currentHeight = 0;
|
|
}
|
|
mtickerEl[i].cont.style.top = mtickerEl[i].cont.currentHeight + "px";
|
|
}
|
|
}
|
|
}
|
|
function prevmTicker(mtickerElnum) {
|
|
var mtickerElnum = mtickerElnum-1;
|
|
mtickerEl[mtickerElnum].count = 0;
|
|
mtickerEl[mtickerElnum].cont.currentHeight+= mtickerEl[mtickerElnum].moveOffset;
|
|
if (-mtickerEl[mtickerElnum].cont.currentHeight < 0) {
|
|
mtickerEl[mtickerElnum].cont.currentHeight = mtickerEl[mtickerElnum].moveOffset-mtickerEl[mtickerElnum].cont.offsetHeight;
|
|
}
|
|
mtickerEl[mtickerElnum].cont.style.top = mtickerEl[mtickerElnum].cont.currentHeight + "px";
|
|
}
|
|
function nextmTicker(mtickerElnum) {
|
|
var mtickerElnum = mtickerElnum-1;
|
|
mtickerEl[mtickerElnum].count = 0;
|
|
mtickerEl[mtickerElnum].cont.currentHeight-= mtickerEl[mtickerElnum].moveOffset;
|
|
if (-mtickerEl[mtickerElnum].cont.currentHeight >= mtickerEl[mtickerElnum].cont.offsetHeight) {
|
|
mtickerEl[mtickerElnum].cont.currentHeight = 0;
|
|
}
|
|
mtickerEl[mtickerElnum].cont.style.top = mtickerEl[mtickerElnum].cont.currentHeight + "px";
|
|
}
|
|
|
|
|
|
//메인 공지사항
|
|
function viewList(a){
|
|
for(var i=1;i<4;i++){
|
|
obj = document.getElementById("hlist"+i);
|
|
obj2 = document.getElementById("tab"+i);
|
|
if (i>1)
|
|
{
|
|
obj3 = document.getElementById("tab"+(i-1));
|
|
}
|
|
if(a==i){
|
|
obj.style.display = "block";
|
|
obj2.setAttribute("src","/img/main/notice_tit"+i+"_on.gif");
|
|
}else{
|
|
obj.style.display = "none";
|
|
obj2.setAttribute("src","/img/main/notice_tit"+i+".gif");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//메인 즐겨찾기
|
|
function viewList_b(a){
|
|
for(var i=1;i<4;i++){
|
|
obj = document.getElementById("hlist_b"+i);
|
|
obj2 = document.getElementById("tab_b"+i);
|
|
if (i>1)
|
|
{
|
|
obj3 = document.getElementById("tab_b"+(i-1));
|
|
}
|
|
if(a==i){
|
|
obj.style.display = "block";
|
|
obj2.setAttribute("src","/img/main/mark0"+i+"_on.gif");
|
|
}else{
|
|
obj.style.display = "none";
|
|
obj2.setAttribute("src","/img/main/mark0"+i+".gif");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//이미지롤링
|
|
|
|
// 해당 타겟의 이미지 변경
|
|
function oversubimg(id) {
|
|
document.getElementById(id).src = document.getElementById(id).src.replace("_off.gif", "_on.gif");
|
|
}
|
|
// 해당 타겟의 이미지 변경
|
|
function outsubimg(id) {
|
|
document.getElementById(id).src = document.getElementById(id).src.replace("_on.gif", "_off.gif");
|
|
}
|
|
|
|
|
|
|
|
//사이트링크
|
|
function rotatecontents(objectid){
|
|
|
|
this.pagingobject=null;
|
|
this.pagingstart='';
|
|
this.pagingdelimiter='/';
|
|
this.pagingend='';
|
|
this.rotatemethod=null;
|
|
this.maxzindex=1;
|
|
this.speed=5;
|
|
this.autoplay=true;
|
|
this.autoplaytime=10;
|
|
|
|
this.buttonobject=null;
|
|
this.buttontype='text';
|
|
this.buttononclassname='on';
|
|
this.buttononimagename='';
|
|
|
|
|
|
var object=document.getElementById(objectid);
|
|
var items=new Array(),itemsnum,titles=new Array();
|
|
var btns=new Array(),btnsmover=new Array(),btnsmout=new Array();
|
|
var speed,timer,nowno=0,canimove=true;
|
|
var isie=(navigator.userAgent.toLowerCase().indexOf('msie')!=-1)? true : false;
|
|
|
|
this.initialize=function(){
|
|
var isfirst=true,removeobjs=new Array(),childs=object.childNodes;
|
|
for(var i=0,j=-1,max=childs.length; i<max; i++){
|
|
if(childs[i].nodeType==1){
|
|
j++;
|
|
if(!isfirst) childs[i].style.display='none';
|
|
items.push(childs[i]);
|
|
if(this.rotatemethod=='overlap' || this.rotatemethod=='slide' || this.rotatemethod=='fadein' || this.rotatemethod=='vertical'){
|
|
speed=this.speed;
|
|
object.style.position='relative';
|
|
with(childs[i].style){
|
|
position='absolute';
|
|
left='0px';
|
|
top='0px';
|
|
width=object.offsetWidth+'px';
|
|
//2009-08-25
|
|
height=object.offsetHeight+'px';
|
|
|
|
}
|
|
if(this.rotatemethod=='fadein'){
|
|
setopacity(childs[i],(isfirst)? 100 : 0);
|
|
}
|
|
}
|
|
if(isfirst) isfirst=false;
|
|
}
|
|
}
|
|
itemsnum=items.length;
|
|
if(removeobjs[0]){
|
|
for(var i=0,max=removeobjs.length; i<max; i++) object.removeChild(removeobjs[i]);
|
|
}
|
|
|
|
if(this.pagingobject) this.pagingobject=document.getElementById(this.pagingobject);
|
|
this.settitlenpaging(nowno);
|
|
object.style.width=object.offsetWidth+'px';
|
|
//alert(object.style.width);
|
|
object.style.height=object.offsetHeight+'px';
|
|
object.style.overflow='hidden';
|
|
object.onmouseover =function(){
|
|
clearTimeout(eval(objectid).autoplaytimer);
|
|
}
|
|
object.onmouseout=function(){
|
|
eval(objectid).autoplayaction();
|
|
}
|
|
if(this.buttonobject){
|
|
this.buttonobject=document.getElementById(this.buttonobject);
|
|
var childs=this.buttonobject.childNodes;
|
|
for(var i=0,j=0,max=childs.length; i<max; i++){
|
|
if(childs[i].nodeType==1){
|
|
childs[i].myno=j;
|
|
if(childs[i].onmouseover) btnsmover.push(childs[i].onmouseover);
|
|
if(childs[i].onmouseout) btnsmout.push(childs[i].onmouseout);
|
|
btns.push(childs[i]);
|
|
j++;
|
|
}
|
|
}
|
|
if(items.length!=btns.length) this.buttonobject=null;
|
|
else this.setbtns();
|
|
}
|
|
this.autoplayaction();
|
|
}
|
|
|
|
this.settitlenpaging=function(no){
|
|
|
|
if(this.pagingobject) this.pagingobject.innerHTML=this.pagingstart+(no+1)+this.pagingdelimiter+itemsnum+this.pagingend;
|
|
}
|
|
|
|
this.setzindex=function(no){
|
|
for(var i=0; i<itemsnum; i++){
|
|
if(i==no){
|
|
items[i].style.zIndex=this.maxzindex+3;
|
|
items[i].style.display='';
|
|
}else if(i==nowno){
|
|
items[i].style.zIndex=this.maxzindex+2;
|
|
}else{
|
|
items[i].style.zIndex=this.maxzindex+1;
|
|
items[i].style.display='none';
|
|
}
|
|
}
|
|
}
|
|
|
|
this.setbtns=function(no){
|
|
if(!no && no!==0) no=nowno;
|
|
for(var i=0; i<itemsnum; i++){
|
|
if(i==no){
|
|
this.setbtnon(btns[i]);
|
|
btns[i].onmouseover=null;
|
|
btns[i].onmouseout=null;
|
|
}else{
|
|
this.setbtnoff(btns[i]);
|
|
btns[i].onmouseover=function(){
|
|
eval(objectid).setbtnon(this);
|
|
if(btnsmover[this.myno]) btnsmover[this.myno]();
|
|
}
|
|
btns[i].onmouseout=function(){
|
|
eval(objectid).setbtnoff(this);
|
|
if(btnsmout[this.myno]) btnsmout[this.myno]();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
this.setbtnon=function(target){
|
|
var classes,exist=false;
|
|
if(this.buttontype=='image'){
|
|
var btnimg=target.getElementsByTagName('img')[0];
|
|
var btnimgexp=btnimg.src.substring(btnimg.src.lastIndexOf('.'));
|
|
if(btnimg.src.indexOf(this.buttononimagename+btnimgexp)==-1) btnimg.src=btnimg.src.replace(btnimgexp,this.buttononimagename+btnimgexp);
|
|
}
|
|
classes=target.className.split(' ');
|
|
for(var i=0; i<classes.length; i++) if(classes[i]==this.buttononclassname) exist=true;
|
|
if(!exist) target.className=target.className+' '+this.buttononclassname;
|
|
}
|
|
|
|
this.setbtnoff=function(target){
|
|
var classes;
|
|
if(this.buttontype=='image'){
|
|
var btnimg=target.getElementsByTagName('img')[0];
|
|
var btnimgexp=btnimg.src.substring(btnimg.src.lastIndexOf('.'));
|
|
if(btnimg.src.indexOf(this.buttononimagename+btnimgexp)!=-1) btnimg.src=btnimg.src.replace(this.buttononimagename+btnimgexp,btnimgexp);
|
|
}
|
|
if(target.className.indexOf(this.buttononclassname)!=-1){
|
|
if(target.className.indexOf(' ')==-1) target.className=target.className.replace(this.buttononclassname,'');
|
|
else{
|
|
classes=target.className.split(' ');
|
|
for(var i=0; i<classes.length; i++) if(classes[i]==this.buttononclassname) classes[i]='';
|
|
target.className=classes.join(' ');
|
|
}
|
|
}
|
|
}
|
|
|
|
this.change=function(no){
|
|
no=no-1;
|
|
if(no!=nowno){
|
|
if(this.rotatemethod=='overlap') this.moveaction('overlap',no,(no<nowno)? 'prev' : 'next');
|
|
else if(this.rotatemethod=='slide') this.moveaction('slide',no,(no<nowno)? 'prev' : 'next');
|
|
else if(this.rotatemethod=='vertical') this.moveaction('vertical',no,(no<nowno)? 'prev' : 'next');
|
|
else if(this.rotatemethod=='fadein') this.fadeinaction(no);
|
|
else this.hideitem(no);
|
|
this.settitlenpaging(no);
|
|
if(this.buttonobject) this.setbtns(no);
|
|
}
|
|
}
|
|
|
|
this.stop = function() {
|
|
clearTimeout(eval(objectid).autoplaytimer);
|
|
this.hideitem;
|
|
};
|
|
|
|
this.play = function() {
|
|
if(!this.autoplay) return;
|
|
this.autoplaytimer=setTimeout(objectid+'.next()',this.autoplaytime*1000);
|
|
};
|
|
|
|
this.viewall = function() {
|
|
|
|
// var viewwrap = document.getElementById('banner_bot');
|
|
var banbtn = document.getElementById('lbtn');
|
|
// var banclose = document.getElementById('rbtn');
|
|
// var bbtn = document.getElementById('bbtn');
|
|
if (viewwrap.style.height == '' )
|
|
{ clearTimeout(eval(objectid).autoplaytimer);
|
|
// viewwrap.style.height = '175px';
|
|
// viewwrap.style.backgroundImage = 'url(/open_content/images/main/bg_banner_02.gif)';
|
|
var objList = document.getElementById(objectid);
|
|
var objListul = objList.getElementsByTagName('ul');
|
|
// objList.style.height = '75px';
|
|
// objList.style.paddingTop = '25px';
|
|
for (var i=0; i < objListul.length ; i++)
|
|
{
|
|
objListul[i].style.position = 'static';
|
|
objListul[i].style.display = 'block';
|
|
}
|
|
banbtn.style.display = 'none';
|
|
banclose.style.display = 'none';
|
|
// bbtn.style.display = 'block';
|
|
object.onmouseover = "null";
|
|
object.onmouseout = "null";
|
|
|
|
}else {
|
|
|
|
// viewwrap.style.height = '';
|
|
// viewwrap.style.backgroundImage = 'url(/open_content/images/main/bg_banner_01.gif)';
|
|
var objList = document.getElementById(objectid);
|
|
var objListul = objList.getElementsByTagName('ul');
|
|
// objList.style.height = '36px';
|
|
// objList.style.paddingTop = '0';
|
|
for (var i=0; i < objListul.length ; i++)
|
|
{
|
|
objListul[i].style.position = 'absolute';
|
|
objListul[i].style.display = '';
|
|
}
|
|
if(!this.autoplay) return;
|
|
this.autoplaytimer=setTimeout(objectid+'.next()',this.autoplaytime*1000);
|
|
banbtn.style.display = '';
|
|
banclose.style.display = 'block'
|
|
// bbtn.style.display = 'none';
|
|
}
|
|
};
|
|
|
|
this.prev=function(){
|
|
var prevno=(nowno==0)? itemsnum-1 : nowno-1;
|
|
if(this.rotatemethod=='overlap') this.moveaction('overlap',prevno,'prev');
|
|
else if(this.rotatemethod=='slide') this.moveaction('slide',prevno,'prev');
|
|
else if(this.rotatemethod=='vertical') this.moveaction('vertical',prevno,'prev');
|
|
else if(this.rotatemethod=='fadein') this.fadeinaction(prevno);
|
|
else this.hideitem(prevno);
|
|
this.settitlenpaging(prevno);
|
|
}
|
|
|
|
this.next=function(){
|
|
var nextno=(nowno==(itemsnum-1))? 0 : nowno+1;
|
|
if(this.rotatemethod=='overlap') this.moveaction('overlap',nextno,'next');
|
|
else if(this.rotatemethod=='slide') this.moveaction('slide',nextno,'next');
|
|
else if(this.rotatemethod=='vertical') this.moveaction('vertical',nextno,'next');
|
|
else if(this.rotatemethod=='fadein') this.fadeinaction(nextno);
|
|
else this.hideitem(nextno);
|
|
this.settitlenpaging(nextno);
|
|
if(this.buttonobject) this.setbtns(nextno);
|
|
}
|
|
|
|
this.autoplaytimer=null;
|
|
this.autoplayaction=function(){
|
|
if(!this.autoplay) return;
|
|
this.autoplaytimer=setTimeout(objectid+'.next()',this.autoplaytime*1000);
|
|
}
|
|
|
|
this.hideitem=function(no){
|
|
clearTimeout(this.autoplaytimer);
|
|
for(var i=0; i<itemsnum; i++) items[i].style.display=(i==no)? '' : 'none';
|
|
this.autoplayaction();
|
|
nowno=no;
|
|
}
|
|
|
|
var getleft=function(no){
|
|
return parseInt(items[no].style.left);
|
|
}
|
|
var setleft=function(no,value){
|
|
items[no].style.left=value+'px';
|
|
}
|
|
|
|
var gettop=function(no){
|
|
return parseInt(items[no].style.top);
|
|
}
|
|
var settop=function(no,value){
|
|
items[no].style.top=value+'px';
|
|
}
|
|
|
|
this.moveaction=function(method,no,direction){
|
|
clearTimeout(this.autoplaytimer);
|
|
if(canimove){
|
|
canimove=false;
|
|
|
|
if(method=='slide') setleft(no,(direction=='prev')? -(object.offsetWidth) : object.offsetWidth);
|
|
if(method=='vertical') settop(no,(direction=='prev')? -(object.offsetHeight) : object.offsetHeight);
|
|
|
|
this.setzindex(no);
|
|
var nowv,now,snow,to=0,mv=0;
|
|
var action=function(){
|
|
clearTimeout(timer);
|
|
now=getleft(no);
|
|
nowv=gettop(no);
|
|
|
|
if(method=='slide') snow=getleft(nowno);
|
|
if(method=='vertical') snow=gettop(nowno);
|
|
|
|
if(now!=to){
|
|
mv=(now-to)/speed;
|
|
setleft(no,(direction=='prev')? Math.ceil(now-mv) : Math.floor(now-mv));
|
|
if(method=='slide') setleft(nowno,(direction=='prev')? Math.ceil(snow-mv) : Math.floor(snow-mv));
|
|
setTimeout(action,10);
|
|
}else if (nowv!=to)
|
|
{
|
|
mv=(nowv-to)/speed;
|
|
settop(no,(direction=='prev')? Math.ceil(nowv-mv) : Math.floor(nowv-mv));
|
|
if(method=='vertical') settop(nowno,(direction=='prev')? Math.ceil(snow-mv) : Math.floor(snow-mv));
|
|
setTimeout(action,10);
|
|
}
|
|
else{
|
|
eval(objectid+'.autoplayaction()');
|
|
clearTimeout(timer);
|
|
canimove=true;
|
|
nowno=no;
|
|
}
|
|
}
|
|
action();
|
|
}
|
|
}
|
|
|
|
var getopacity=function(target){
|
|
return (isie)? parseInt(target.style.filter.match(/alpha\(opacity=([0-9]+)\)/)[1]) : target.style.opacity*100;
|
|
}
|
|
|
|
var setopacity=function(target,value){
|
|
if(isie) target.style.filter='alpha(opacity='+value+')';
|
|
else target.style.opacity=value/100;
|
|
}
|
|
|
|
this.fadeinaction=function(no){
|
|
clearTimeout(this.autoplaytimer);
|
|
if(canimove){
|
|
canimove=false;
|
|
setopacity(items[no],0);
|
|
this.setzindex(no);
|
|
var nowo,to=0;
|
|
var action=function(){
|
|
clearTimeout(timer);
|
|
nowo=getopacity(items[no]);
|
|
if(nowo!=100){
|
|
setopacity(items[no],Math.ceil(nowo+(100-nowo)/speed));
|
|
setTimeout(action,10);
|
|
}else{
|
|
eval(objectid+'.autoplayaction()');
|
|
clearTimeout(timer);
|
|
canimove=true;
|
|
nowno=no;
|
|
}
|
|
}
|
|
action();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function setSkin( obj ){
|
|
var num = obj.val();
|
|
setCookie("body_skin", "skin_c"+num, 365, "");
|
|
$("body").attr("id", "skin_c"+num);
|
|
}
|
|
|
|
function checkSkin(){
|
|
var skin = getCookie("body_skin");
|
|
|
|
if( skin != "" ){
|
|
$("body").attr("id", skin);
|
|
var num = skin.replace("skin_c", "");
|
|
$("#radio-1-"+num).attr("checked", true);
|
|
}
|
|
|
|
$("input:radio[name='skin_c']").click(function(){
|
|
setSkin( $(this) );
|
|
});
|
|
} |