function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function wscRun (link, force) {
       var wsc = getCookie('wscDirect');

       if (link == null)
              link = '/webcreator';

       if ((wsc == 1 || force == 1) && window.name != 'theWizard') {
              var left = (screen.width / 2) - 505;
              var top = (screen.height / 2) - 312;
              var wnd=window.open(link, 'theWizard', 'menubar=no, resizable=no, scrollbars=no, status=no, width=1010, height=625, top='+top+', left='+left); 
              
              if (wnd == null) {
                     var info = document.getElementById ('popupInfoFail');
                     if (info) info.style.display = 'block';
                     info = document.getElementById ('popupInfoOK');
                     if (info) info.style.display = 'none';
                     return false;
              }
                     
              var info = document.getElementById ('popupInfoOK');
              if (info) info.style.display = 'block';
              info = document.getElementById ('popupInfoFail');
              if (info) info.style.display       = 'none';

              wnd.focus();
              
              return false;
       }
       
       else {
              window.location = link;
       }
       
       return;
}

function $ (e) {
       if (typeof(e) != 'string') return e;
       if (document.getElementById) e = document.getElementById(e);
       else if (document.all) e = document.all[e];
       else e = null;
       return e;
}

function chng (id, imgNames) {
       
       var i;
       for (i=1; i<=5; i++) {
              if (id == i) {
                     $('link'+i).src = "/gfx/default/"+imgNames[i-1]+"_on.gif";
                     $('box'+i).style.display = 'block';
              }
              
              else {
                     $('link'+i).src = "/gfx/default/"+imgNames[i-1]+"_off.gif";
                     $('box'+i).style.display = 'none';                            
              }
       }
       
       return false;
}       

//  $Id: default.js 9633 2007-09-30 16:48:57Z sokol $

