                           
//<script>
var tempSavingClassName = new Array();
function disableInputField(fieldname){
  var object = document.getElementById(fieldname);
  if(object)
  {
    if(object.className != '') tempSavingClassName[fieldname] = object.className;
    object.className = "disabled";
    object.disabled = true;
  }
}

function enableInputField(fieldname){
  var object = document.getElementById(fieldname);
  var tmpClassName = tempSavingClassName[fieldname];
  if(object)   
  {
    if(tmpClassName){
      object.className = tmpClassName;
    }else{
      object.className = '';
    }    
    object.disabled = false;  
  }
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function selectRow(object){
  if (object.className != 'moduleRowSelected') object.className = 'moduleRowSelected';
  else if (object.className == 'moduleRowSelected') object.className = 'moduleRow';
}

function checkBox(object) {
  document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
}

function ahref(link){
  window.location.href = link;
}

function resize(x) {
  var i;
  i=x;
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+140-i);
  self.focus();
}

function popupWindow(url, width , height) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+width+',height='+height+',screenX=150,screenY=150,top=150,left=150');
}

function popupScrolWindow(url, width , height) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',screenX=150,screenY=150,top=150,left=150');
}

var submitter = null;
function submitFunction() {
  submitter = 1;
}

//MS3 Compatibility
function pageLinkPrompt(url,val,current,max)
{
  if (page = parseInt(prompt("Enter a page number between 1 and "+max,val)))
    if ( page == current)
      return false;
    else if (page > max)
      return formSubmit('',url+'&page='+max);
    else if (page < 1)
      return formSubmit('',url+'&page=1');
    else
      return formSubmit('',url+'&page='+page);
  else
    return false;
}

function formSubmit(form,action,target)
{
  //alert('form.name = '+form.name+' form.action = '+action+' form.target = '+target);
  if (action != null && action != '')
    form.action = action;
  if (target != null && target != '') {
    form.target = target;
    popup(form.action,form.target);
  }
  
  if ((form == null || form == '' || form == 'undefined') && action != null & action != '')
    document.location.href = action;
  else
    form.submit();
  return false;
}

popups = new Array();

function popup(url,name,args)
{
  if (url == null || url == '')
    exit;
  if (name == null || name == '')
    name = '_popup';
  if (args == null || args == '') {
    var height = 400;
    var width  = 600;
    var top    = (screen.height) ? (screen.height-height)/2 : 0;
    var left   = (screen.width) ? (screen.width-width)/2 : 0;
    var args = 'toolbar=0,status,location=0,scrollbars,resizable,width='+width+',height='+height+',top='+top+',left='+left;
  }
  
  if ( typeof( popups[name] ) != "object" ) {
    popups[name] = window.open(url,name,args);
    if (!popups[name].opener)
      popups[name].opener = self;
  } else {
    if (!popups[name].closed) {
      popups[name].location.href = url;
    } else {
      popups[name] = window.open(url, name,args);
      if (!popups[name].opener)
        popups[name].opener = self;
    }
  }

  if (window.focus)
    popups[name].focus();
  return false;
}


function hoverIE(menu) {
  var MENU = document.getElementById(menu); 
  
  if(LI = getFirstElementWithTagname(MENU,'UL')){
    LI = LI.firstChild;
    do {
      LI.onmouseover=displayMenuDropDown; LI.onmouseout=hideMenuDropDown;
      LI = LI.nextSibling;
    }    
    while(LI);
  }
}

function getFirstElementWithTagname(OBJ, TAG) {  
  ELEMENTS = OBJ.getElementsByTagName(TAG);
  if(ELEMENTS[0]) return ELEMENTS[0];
  else return false;
}

function displayMenuDropDown() {            
 if(A = getFirstElementWithTagname(this, 'A')){
  A.className = 'active'; 
 }
  if(UL = getFirstElementWithTagname(this, 'UL')){
    UL.style.display = "block";
  }
}
function hideMenuDropDown() {
 if(A = getFirstElementWithTagname(this, 'A')){
  A.className = null; 
 }
  if(UL = getFirstElementWithTagname(this, 'UL')){
    UL.style.display = "none";
  }
}
  
function toggleAuto(target ) {
  if(typeof(target) == 'string')
    target = document.getElementById(target);   
                
  if (target.style.display == "none"){
    if(arguments[1]) display = arguments[1];
    else display = "block";      
   
    target.style.display = display;
  } else {
    target.style.display = "none";
  }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
    
function TT_GetContainer(contentid){
  var btc = document.getElementById(contentid); 
  if(!btc){   
    var tooltip,text,top,inner,bottom;           
    var h=document.createElement("div");
    h.id="btc";
    h.setAttribute("id",contentid);
    h.style.position="absolute";
    document.getElementsByTagName("body")[0].appendChild(h);
    btc = document.getElementById(contentid); 
    
    if(arguments[1]){
      tooltip=TT_CreateElement("div",arguments[1]);
    }else{
      tooltip=TT_CreateElement("div",'tooltip'); 
    }                                                
    top=TT_CreateElement("div","top");
    tooltip.appendChild(top); 
    inner=TT_CreateElement("div","inner");    
    tooltip.appendChild(inner);
    bottom=TT_CreateElement("div","bottom");
    tooltip.appendChild(bottom);
    TT_SetOpacity(tooltip);
    btc.appendChild(tooltip);
  }
  return btc;
}

function TT_UpdateContainer(contentid,text){
  var btc = TT_GetContainer(contentid);    
  var inner = btc.getElementsByTagName('div'); 
  for(var i=0; i<inner.length; i++){ 
    if(inner[i].className == 'inner'){
      inner[i].innerHTML = text;     
      break;
    }
  } 
  btc.style.display = 'block'; 
}

function TT_Show(obj,cssclass){
  var btc = TT_GetContainer('ttip',cssclass);
  
  if(!obj.ttip){
    
    text=unescape(obj.getAttribute("title"));
    if(text==null || text.length==0){
      text="";
    }
    obj.removeAttribute("title"); 

    img = obj.getElementsByTagName("img");
    for(i=0; i < img.length; i++){
      img[i].removeAttribute("alt");
      img[i].removeAttribute("title");
    } 
    obj.ttip = text;    
  }
          
  obj.onmousemove=TT_Locate;     
  TT_UpdateContainer('ttip',obj.ttip);
}

function TT_ShowSticky(id,text,y,x,cssclass){
  var btc = TT_GetContainer('ttipsticky_'+id,cssclass);  
  btc.style.top=y+"px";
  btc.style.left=x+"px";         
  TT_UpdateContainer('ttipsticky_'+id,text); 
}

function TT_UpdateSticky(id,text){ 
  TT_UpdateContainer('ttipsticky_'+id,text);
}

function TT_Hide(){
  var btc = TT_GetContainer('ttip');
  btc.style.display = 'none';
}

function TT_HideSticky(id){
  var btc = TT_GetContainer('ttipsticky_'+id);
  btc.style.display = 'none'; 
}

function TT_Locate(e){
  var posx=0,posy=0;
  if(e==null){
    e=window.event;   
  }
  if(e.pageX || e.pageY){
      posx=e.pageX; posy=e.pageY;
  }else if(e.clientX || e.clientY){
    if(document.documentElement.scrollTop){
        posx=e.clientX+document.documentElement.scrollLeft;
        posy=e.clientY+document.documentElement.scrollTop;
    }else{
        posx=e.clientX+document.body.scrollLeft;
        posy=e.clientY+document.body.scrollTop;
    }
  }
  var btc = TT_GetContainer('ttip');
  btc.style.top=(posy+10)+"px";
  btc.style.left=(posx-20)+"px";
}

function TT_SetOpacity(obj){
  obj.style.filter="alpha(opacity:95)";
  obj.style.KHTMLOpacity="0.95";
  obj.style.MozOpacity="0.95";
  obj.style.opacity="0.95";
}
    
function TT_CreateElement(t,c){
  var x=document.createElement(t);
  x.className=c;
  x.style.display="block";
  return(x);
}     

function findPosX(obj)
{
  var curleft = 0;
  if(obj.offsetParent)
      while(1) 
      {
        curleft += obj.offsetLeft;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.x)
      curleft += obj.x;
  return curleft;
}

function findPosY(obj)
{
  var curtop = 0;
  if(obj.offsetParent)
      while(1)
      {
        curtop += obj.offsetTop;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.y)
      curtop += obj.y;
  return curtop;
}     
//</script>
