﻿function bookmark(){
   var url = window.document.location;
   var title = window.document.title;
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}
function ActivateLeftMenuItem(id, itemOverCss, rightOverCss)
{
    var itembody = document.getElementById("leftmenuitem"+id);
    var itemcorner = document.getElementById("leftmenuitem_right"+id);
    if(itembody && itemcorner)
    {
      itembody.className = itemOverCss;
      itemcorner.className = rightOverCss;
    }
}
function DeactivateLeftMenuItem(id, itemSimpleCss, rightSimpleCss)
{
    var itembody = document.getElementById("leftmenuitem"+id);
    var itemcorner = document.getElementById("leftmenuitem_right"+id);
    if(itembody && itemcorner)
    {
      itembody.className = itemSimpleCss;
      itemcorner.className = rightSimpleCss;
    }
}
function ActivateMenuItem(id)
{
var itembody = document.getElementById("menuitem"+id);
var itemcorner = document.getElementById("menuitem_right"+id);
if(itembody && itemcorner)
{   
itembody.className = "menuitem_active";
itemcorner.className = "menuitem_right_active";
}
}
function DeactivateMenuItem(id)
{
var itembody = document.getElementById("menuitem"+id);
var itemcorner = document.getElementById("menuitem_right"+id);
if(itembody && itemcorner)
{   itembody.className = "menuitem";
itemcorner.className = "menuitem_right";
}
}

SetLoading = function(mc, te)
    {
     var el = mc;

     var bodySize = BodySize();

     el.style.height = bodySize.offsetHeight + 'px';
     el.style.width = bodySize.offsetWidth + 'px';
     if(document.getElementById("mIframe"))
     {
        document.getElementById("mIframe").style.height = bodySize.offsetHeight + 'px';
        document.getElementById("mIframe").style.width = bodySize.offsetWidth + 'px';
     }
     el.style.backgroundColor = '#DADADA';
     var spL = te;

     spL.style.top = Math.round((bodySize.height/2) + bodySize.top) + 'px';
     spL.style.left = Math.round((bodySize.width/2) + (bodySize.left - 20)) + 'px';
     
     if(typeof el.style.filter != 'undefined') el.style.filter = 'alpha(opacity=70)';
     else if(typeof el.style.MozOpacity != 'undefined') el.style.MozOpacity = '0.7';
     else if(typeof el.style.opacity != 'undefined') el.style.opacity = '0.7';
    };

    BodySize = function()
    {

     var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
     var dsocleft=document.all? iebody.scrollLeft : pageXOffset
     var dsoctop=document.all? iebody.scrollTop : pageYOffset
     var scrlBarLengthX = 0;
     var scrlBarLengthY = 0;
     if ( window.scrollMaxX ) scrlBarLengthX = window.scrollMaxX==0?0:15;
     if ( window.scrollMaxY ) scrlBarLengthY = window.scrollMaxY==0?0:15;
     var dsocwidth = window.innerWidth?(window.innerWidth - scrlBarLengthY):iebody.clientWidth;
     var dsocheight = window.innerHeight?(window.innerHeight - scrlBarLengthX):iebody.clientHeight;
     var retObj = new Object();
     retObj.height = dsocheight;
     retObj.width = dsocwidth;
     retObj.left = dsocleft;
     retObj.top = dsoctop;
     retObj.offsetWidth = (iebody.scrollWidth || iebody.offsetWidth) - 15;
     retObj.offsetHeight = (iebody.scrollHeight || iebody.offsetHeight) - 15;
     return retObj;
    };
function tellafriend()
{
    if(document.getElementById("Tellafriend"))
        SetLoading(document.getElementById("TellafriendMainConteiner"),document.getElementById("TellafriendWindow"));
        document.getElementById("Tellafriend").style.display="block";
}

ShowDialog = function (target,width,height,location,scrollbars,status,resizable,menubar,toolbar,directories)
{
 var lWidth = (width)?width:'auto'; //in pixels. The minimum value is 100.
 var lHeight = (height)?height:'auto'; //in pixels. The minimum value is 100
 var lLocation = (location)?location:0; //display the input field for entering URLs directly into the browser
 var lScrollbars = (scrollbars)?scrollbars:0; //display horizontal and vertical scroll bars
 var lStatus = (status)?status:0; //add a status bar at the bottom of the window
 var lResizable = (resizable)?resizable:0; //display resize handles at the corners of the window
 var lMenubar = (menubar)?menubar:0; //display the menu bar
 var lToolbar = (toolbar)?toolbar:0; //display the browser toolbar, making buttons such as Back, Forward, and Stop available
 var lDirectories = (directories)?directories:0; //Directory buttons

 var win = window.open(target,'_blank',
 'height='+height+
 ',width=' + width +
 ',location=' + lLocation +
 ',scrollbars=' + lScrollbars +
 ',status=' + lStatus +
 ',resizable=' + lResizable +
 ',menubar=' + lMenubar +
 ',toolbar=' + lToolbar +
 ',directories=' + lDirectories
 );
return;
}