var min=9;
var max=13;
function enlargeFont()
{
   var p = document.getElementsByTagName('*');
   for(i=0;i<p.length;i++)
   {
      if(p[i].style.fontSize)
      {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      }
      else
      {
         var s = 11;
      }
      if(s!=max)
      {
         s += 1;
      }
      p[i].style.fontSize = s+"px";
      z = p[i].getElementsByTagName('a');
      
      if(z)
      {
               for(j=0;j<z.length;j++)
               {
                              z[j].style.fontSize = s+"px";
                              break;
               }
      }
      
   }
   return false;
}

function reduceFont()
{
   var p = document.getElementsByTagName('*');
   for(i=0;i<p.length;i++)
   {
      if(p[i].style.fontSize)
      {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      }
      else
      {
         var s = 11;
      }
      if(s!=min)
      {
         s -= 1;
      }
      p[i].style.fontSize = s+"px";
      z = p[i].getElementsByTagName('a');
      
      if(z)
      {
               for(j=0;j<z.length;j++)
               {
                              z[j].style.fontSize = s+"px";
                              break;
               }
      }
      
   }
   return false;
}

function makeFontDefault()
{
   var p = document.getElementsByTagName('*');
   for(i=0;i<p.length;i++)
   {
                 var s = 11;
      p[i].style.fontSize = s+"px";
      z = p[i].getElementsByTagName('a');
      
      if(z)
      {
               for(j=0;j<z.length;j++)
               {
                              z[j].style.fontSize = s+"px";
                              break;
               }
      }
      
   }
   return false;
}


function setHomepage()
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage(document.location.href);
 
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
            {  
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
            }  
         catch(e)  
         {  
            alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
         }
    }
	//alert(document.title +" + "+document.location.href);
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
	//alert(prefs);
    prefs.setCharPref('browser.startup.homepage',document.location.href);
	//window.sidebar.addPanel(document.title,document.location.href,'')
 }
 else
 {
    alert('Press ctrl+D to bookmark after you click Ok');

 }
}
function CreateBookmarkLink() {

 title = document.title; //window.document.title;
 //alert(document.title +" + "+ window.document.title);
  // Blogger - Replace with <$BlogItemTitle$>
  // MovableType - Replace with <$MTEntryTitle$>

 url = document.location.href;
  // Blogger - Replace with <$BlogItemPermalinkURL$>
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

      if (window.sidebar) { // Mozilla Firefox Bookmark
            window.sidebar.addPanel(title, url,"");
      } else if( window.external ) { // IE Favorite
            window.external.AddFavorite( url, title); }
      else if(window.opera && window.print) { // Opera Hotlist
            return true; }
      else
         {
            alert('Press ctrl+D to bookmark after you click Ok');

         }
 }








//***************************************************************

 

function setvalues(repName,txtValues)
{

DOMCall (txtValues).value = '';

var i = 0;
var str1 = '_';
var str2 = '$';
var strValues='';

var  ctrlName = repName + '_ctl0' + i + '_ctl00';
var curItem = DOMCall(ctrlName);

    if(curItem == null )
    {
        ctrlName = repName + '_ctl0' + i + '_txt';
        curItem = DOMCall(ctrlName);
    }

while (curItem != null)
{
    if(curItem.type == 'text')
    {
        strValues = strValues + curItem.value + ',';
        
        i +=1;
        ctrlName = repName + '_ctl0' + i + '_ctl00';
        curItem = DOMCall(ctrlName);

        if(curItem == null )
        {
            ctrlName = repName  + '_ctl0' + i + '_txt';
            curItem = DOMCall(ctrlName);
        }
    }
    else
    { 
        var j = 0;

        var childName = ctrlName + '_' + j;
        var childItem = DOMCall(childName);

        while (childItem != null)
        {
            if (childItem.checked == true) 
            {
               strValues = strValues  + 1 + ','         
            }
            else
            {
              strValues = strValues  + 0 + ',' 
            }  

            j+=1;

            childName = ctrlName + '_' + j;
            childItem = DOMCall(childName);  
        }

        i +=1;
        ctrlName = repName + '_ctl0' + i + '_ctl00';
        curItem = DOMCall(ctrlName);

        if(curItem == null )
        {
            ctrlName = repName + '_ctl0' + i + '_txt';
            curItem = DOMCall(ctrlName);
        }
    }

   }
   
   DOMCall (txtValues).value = strValues;
}

//function to use whatever DOM Object
//the users browser has
function DOMCall(name) 
{
//Checks the DOM features available
if (document.layers) //checks document.layers
return document.layers[name];
else if (document.all) //checks document.all
return document.all[name];
else if (document.getElementById) //checks getElementById
return document.getElementById(name);
}

