﻿
/* start slider */

/* end slider */

/*-------------------------- change iframe --------------------------*/
function loadIframe(iframeName, url) {
    if ( window.frames[iframeName] ) {
        window.frames[iframeName].location = url;   
        return false;
    }
    return true;
}

/*-------------------------- OPEN WINDOW --------------------------*/

   function openPopupWin(ThePage,TheWinName,TheHeight,TheWidth) 
   { 
   LeftPosition = (screen.width) ? (screen.width-TheWidth)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-TheHeight)/2 : 0;
       myWin = window.open(ThePage,TheWinName,"status=no,scrollbars=no,resizable=no,menubar=no,statusbar=no,width=" + TheWidth +",height=" + TheHeight+",top=" +TopPosition+",left="+LeftPosition+"");
       myWin.focus();
   }

/*-------------------------- chnage classname --------------------------*/

 function setClassName(objId, className) {
         var newObject = document.getElementById(objId)
newObject.setAttribute('className', className);// for IE
newObject.setAttribute('class', className);// for others (these are both needed)
}

/*-------------------------- layer hider --------------------------*/

function hideLayer(lId) {

var layer = document.getElementById(lId);
layer.style.display = 'none';

}


/*-------------------------- tab switchewr --------------------------*/  
function showSwitch(sId, captionlayer, oncaption, offcaption)
{
      var d = document.getElementsByTagName("div");
      var listItem = document.getElementsByTagName("li");
    
    //get all the elements 
      for (var i=0; i<d.length; i++)
      { 
      //checck to see if the id is a number
      //we have given the names of the div as numbers
         if(!isNaN(d[i].getAttribute("id")))
            {
            
           //check to make sure that the div has an actual id attribute
               if(d[i].getAttribute("id") !="" && d[i].getAttribute("id") !=null)
               {  
               //hide or display it by style
                        if (d[i].getAttribute("id") != sId)
                         {
                           d[i].style.display = 'none';
                         } 
                         else
                         {
                           d[i].style.display = 'block';
                         }               
                }
             }       
     }
}

//scroller layer code

function verScroll(dir, spd, loop) {
loop = true;
direction = "up";
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval("document.getElementById('contentLayer').style");
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
      }
   }
}
direction = dir;
speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
if (direction == "dn") {
page.top = (y_pos - (speed));
} else {
if (direction == "up" && y_pos < 10) {
page.top = (y_pos + (speed));
} else {
if (direction == "top") {
page.top = 10;
      }
   }
}
scrolltimer = setTimeout("verScroll(direction,speed)", 1);
   }
}
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}

