function popup(a,b,c, windowName, options) {
    var en = (b == 0) ? 300 : ((b < 200) ? 200 : ((b > 1000) ? 1000 : b));
    var boy = (c == 0) ? 400 : ((c < 200) ? 200 : ((c > 1000) ? 1000 : c));

	var w='_blank';

	if (windowName != null)
       w=windowName;
	
	if (options == null)
		options = "left=30,top=30,scrollbars=yes,resizable=yes,status=no,menubar=yes,toolbar=no,location=no";
	   
    var yeni=window.open(a, w, options+",width="+en+",height="+boy);

   if(navigator.appName == "Microsoft Internet Explorer" &&
       parseInt(navigator.appVersion) >= 4) {
       yeni.focus();
   } else {
      if(navigator.appName != "Microsoft Internet Explorer")
      yeni.focus(); }
}


/*
==================================================================
Browser Version
==================================================================
*/
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
	var agt = navigator.userAgent.toLowerCase();
	
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
	
//------------------------------------------------------------------
function CCA(CB){
    if (CB.checked)
       hL(CB);
    else
       dL(CB);
}
function hL(E){
     if (is_ie5_5up)
       while (E.tagName!="TR") E=E.parentElement;
     else
       while (E.tagName!="TR") E=E.parentNode;
     E.className = "highlightedrow";
}
function dL(E){
    if (is_ie5_5up)
       while (E.tagName!="TR") E=E.parentElement;
    else
       while (E.tagName!="TR") E=E.parentNode;
    E.className = "";
}
//------------------------------------------------------------------



/*
==================================================================
Printing functions
==================================================================
*/

function hndlBeforePrint() {

	try {
		if (typeof(pageLevelBeforePrint) == 'function')
			pageLevelBeforePrint();
	} catch(e) {}

}

function hndlAfterPrint() {

	try {
		if (typeof(pageLevelAfterPrint) == 'function')
			pageLevelAfterPrint();
	} catch(e) {}

}

var intNumberofAlreadyHiddenElements = 0 ;
var ArrayofHiddenElementNames = new Array();

//------------------------------------------------------------------------------
function ElementwasHiddenBeforePrint(Elementname) {

	for (var i=0;i < intNumberofAlreadyHiddenElements;i++){
	    if ( ArrayofHiddenElementNames[i] == Elementname)
	       return ( true );
	} /* for */

	return (false);
}
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
function HideUnPrintableElemets() {
      intNumberofAlreadyHiddenElements = 0 ;

      var coll = document.all;

      if (coll!=null) {
         for (var i=0; i<coll.length; i++) {
            if ( coll[i].printable != null ) {
                if ( coll[i].printable == "0" ) {
                   if ( coll[i].name != null && coll[i].name != '' ) {
                      // if this element is already hidden from the browser make note of it
                      // so that when it is time to show elements, this element is not shown.
                      if ( coll[i].style.display == 'none' ) {
                         ArrayofHiddenElementNames[intNumberofAlreadyHiddenElements] = coll[i].name ;
                         intNumberofAlreadyHiddenElements++;
                      }
                   }

                   coll[i].style.display='none';
                }
            }
        } /* for */
     } /* if */

} /* function HideUnPrintableElemets() */
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
function ShowUnPrintableElemets() {

      var coll = document.all;

      if (coll!=null) {
        for (i=0; i<coll.length; i++) {
            if ( coll[i].printable != null) {
                if ( coll[i].printable == "0" ) {
                   if ( coll[i].name != null && coll[i].name != '' ) {
                      // show this element only if this element was not already hidden from the browser
                      if ( ! ElementwasHiddenBeforePrint(coll[i].name) ) {
                         coll[i].style.display='';
                      }
                   }
                   else
                      coll[i].style.display='';
                } /* if */
             } /* if */
        } /* for */
    } /* if */

} /* function ShowUnPrintableElemets() */
//------------------------------------------------------------------------------




/*
==================================================================
Validation functions
==================================================================
*/
var defaultEmptyOK = false;
var decimalPointDelimiter = ".";

// Returns true if character c is a digit 
// (0 .. 9).
function isDigit (c) {  
	return ((c >= "0") && (c <= "9"))
}

// Check whether string s is empty.
function isEmpty(s) {   
	return ((s == null) || (s.length == 0))
}

// isFloat (STRING s [, BOOLEAN emptyOK])
// 
// True if string s is an unsigned floating point (real) number. 
//
// Also returns true for unsigned integers. If you wish
// to distinguish between integers and floating point numbers,
// first call isInteger, then call isFloat.
//
// Does not accept exponential notation.
function isFloat (s)  {   
	var i;
    var seenDecimalPoint = false;

    if (isEmpty(s)) 
       if (isFloat.arguments.length == 1) 
	   	   return defaultEmptyOK;
       else 
	   	   return (isFloat.arguments[1] == true);

    if (s == decimalPointDelimiter) return false;

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++) {   
        // Check that current character is number.
        var c = s.charAt(i);
		
		if ( (c=='-' || c=='+') && i == 0)
			; //Sign is ok
        else if ((c == decimalPointDelimiter) && !seenDecimalPoint) 
			seenDecimalPoint = true;
        else if (!isDigit(c)) 
			return false;
    }

    // All characters are numbers.
    return true;
}




/*
==================================================================
Visual functions
==================================================================
*/
var glVObj=null;
function blink_Input_Element(o) {
	glVObj = o;
	glVObj.style.backgroundColor = 'gray';
	window.setTimeout("glVObj.style.backgroundColor = '';", 1000);
}


/*
==================================================================
Misc. Math functions
==================================================================
*/
function generateRandomNumber(maxnumber) {
	var generatornum;
	var r;
	generatornum=Math.random();
	var r=Math.round(generatornum*maxnumber);
	return (r);
}



/*
==================================================================
String manipulation functions
==================================================================
*/
function LTrim(str) {
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str) {
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      var i = s.length - 1;
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
      s = s.substring(0, i+1);
   }

   return s;
}

function Trim(str) {
   return RTrim(LTrim(str));
}

function callOnLoad() {
	try {
		if (typeof(pageLevelLoad) == 'function')
			pageLevelLoad();
	} catch(e) {}
}


//----------------------------------------------------------------------------
//ReplaceString function
function replaceString(s, s1, s2) {
	var t = s;
	if (s1=='') {
		return (t);
	}

	var k = t.toUpperCase().indexOf(s1.toUpperCase(), 0);
	var i = 0;
	while (k >= 0 && i < 100) {
		t = t.substring(0, k) + s2 + t.substring(k+s1.length, t.length);

		k = t.toUpperCase().indexOf(s1.toUpperCase(), k+s2.length);
		i++;
	}
	return (t);
}

//------------------------------------------------------------------------------
//Replacing * with stars
function formatTitle(o, size, color) {

    if (o == null || !is_ie5_5up) return;

	if (size==null)
	   size = "11";
	if (color==null)
	   color = '';
	var rStr = "*";
//	var sLoc = "<img src=\"/Media/Images/SiteImages/" + color + "star" + size + ".gif\" border=0px >";
var sLoc = "<span style=\"font-family:webdings;\" >&#152;</span>";

	var s = o.innerHTML;
	o.innerHTML = replaceString(s, rStr, sLoc);
}

//------------------------------------------------------------------------------