﻿// JScript File
function AddOption(SelectObject,newTextOption)
{
    var elementOptionNew = document.createElement('option');
    elementOptionNew.text = newTextOption;
    elementOptionNew.value = newTextOption;
    try { 
        SelectObject.add(elementOptionNew, null); // standards compliant; doesn't work in IE
    } 
    catch(ex) 
    { 
        SelectObject.add(elementOptionNew); // IE only
    }
}

function TestPrint()
{
var isPrint = getp("print");

if(isPrint =="yes")
{
 setActiveStyleSheet('impress');
 window.print();        
}
}

function getp(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function setActiveStyleSheet(title) 
{
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}