﻿ function bookmarksite(title,url)
    {
        if (window.sidebar) // firefox
              window.sidebar.addPanel(title, url, "");
        else if(window.opera && window.print){ // opera
              var elem = document.createElement('a');
              elem.setAttribute('href',url);
              elem.setAttribute('title',title);
              elem.setAttribute('rel','sidebar');
              elem.click();
        } 
        else if(document.all)// ie
              window.external.AddFavorite(url, title);
        else
            alert("Press Ctl + D To Bookmark this Page.");
    }
function createCookie(name,value,days)
    {
       if (days)
       {
           var date = new Date();
           date.setTime(date.getTime()+(days*24*60*60*1000));
           var expires = "; expires="+date.toGMTString();
       }
       else var expires = "";
       //alert(name +" Cookie created is "+ value);
       document.cookie = name+"="+value+expires+"; path=/";
    }
//    function GetCookie(name) 
//    {  
//           var nameEQ = name + "=";
//           var ca = document.cookie.split(';');
//           for(var i=0;i < ca.length;i++)
//           {
//                   var c = ca[i];
//                   while (c.charAt(0)==' ') c = c.substring(1,c.length);
//                   if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
//           }
//           return null;
//    }
function setCookie(c_name,value)
    {
      document.cookie=c_name+ "=" +escape(value);
    }
    function getCookie(c_name)
    {
        if (document.cookie.length>0)
          {
          c_start=document.cookie.indexOf(c_name + "=");
          if (c_start!=-1)
            { 
            c_start=c_start + c_name.length+1; 
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
            return unescape(document.cookie.substring(c_start,c_end));
            } 
          }
        return "";
    }
    function SetActive(Id)
    {
        //alert(Id);
        var len=Id.length;
        //alert('len'+len);
        var ch=Id.substring(len-1);
       // alert('ch'+ch);
       //alert('div'+ch);
        document.getElementById('div'+ch).style.display='block';
        setCookie('div','div'+ch);
    }
	function OpenRecent()
	{
	    document.getElementById('div1').style.display='none';
	    var data = GetCookie("divID");
	    if(data!=null)
	    {
	        if(document.getElementById(data))
	            document.getElementById(data).style.display='';
	    }
        var setact=GetCookie("setcol");
        var collection ;
        
        if(document.getElementsByTagName('a'))
        {
            collection= document.getElementsByTagName('a');
            var output;
            for(var i=0;i<collection.length;i++)
            {
               //output= collection[i].getAttribute('id'); getattributeNode
              // if(collection[i].getAttribute('id')!=null)
               // alert(collection[i].getAttribute('id'));
               if(collection[i].getAttribute('id'))
               {
                    output= collection[i].getAttribute('id');
                    if(output!="")
                    {
                    //alert('output: ' + output);
                        if(output!=setact)
                         {
                            if(document.getElementById(output))
                                document.getElementById(output).style.fontWeight = '';
                         }
                         else
                         {
                           if(document.getElementById(setact))
                               document.getElementById(setact).style.fontWeight = 'bold'
                           // alert(document.getElementById(output).style.color);
                         }
                        //  document.getElementById(output).setAttribute('className','font-red');
                            //
                    }
                }
            }
        }
	}
createCookie("SResolution",screen.width + 'X' + screen.height);// JScript File
function SetDivActive(e)
{
    var items=document.getElementById('leftMenuDIV').getElementsByTagName('div');
    for(var i=0;i<items.length;i++)
    {
       items[i].className='inactive';
    }

    e.nextSibling.className='';
    
}
