<!--
		

	//opens a window and centers it
	function openWin(sPage,w,h,scrollbars,status,resize,title){
		var winL = (screen.width - w) / 2;
		var winT = (screen.height - h) / 2;
		
		var myWin = window.open(sPage,'','height=' + h + ',width=' + w + ',left=' + winL + ',top=' + winT + ',status=' + status + ',scrollbars=' + scrollbars + ',resizable=' + resize);

		return myWin;
	}

	//set the focus of a control
	function setFocus(ctl){
		ctl.focus();
	}


    //Get a parameter from a query string
    function getURLParam(strParamName){
        var strReturn = "";
        var strHref = window.location.href;
        if ( strHref.indexOf("?") > -1 ){
            var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
            var aQueryString = strQueryString.split("&");
            for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
                if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
                    var aParam = aQueryString[iParam].split("=");
                    strReturn = aParam[1];
                    break;
                }
            }
        }
        return unescape(strReturn);
    } 

    //get a uri of a url
    function getURL(uri) {
             uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
             uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
             uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
             uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
             pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
             pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
             uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
             uri.file = uri.page;
             if (uri.ext != '') uri.file += '.' + uri.ext;
             if (uri.file == '') uri.page = 'index';
             uri.args = location.search.substr(1).split("?");

             return uri;
    }

    //get just the page name
    function getPageName(uri){
        var uri = new Object();
        getURL(uri);
        
        return uri.page;
    }
    
    //save page to the browsers Favorites
    function favoris() 
    {
        var url = this.location;
        var txt = document.title;

        if ( navigator.appName != 'Microsoft Internet Explorer' )
        { 
            window.sidebar.addPanel(txt,url,""); 
        }else { 
            window.external.AddFavorite(url,txt); 
        } 
    }
    

    /* COOKIE FUNCTIONS************************************** */

    // Module Set Cookie (string, string, int)
    function setCookie(c_name,value,expiredays){
	    var exdate=new Date();
	    exdate.setDate(exdate.getDate()+expiredays);
	    document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    }

    // Module Get Cookie (string)
    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 false;
    }
    /* END COOKIE FUNCTIONS******************************** */
    
    


    /* CHANGE FONT SIZE FUNCTIONS************************** */
    var min=8;
    var max=18;

    function increaseFontSize() {
        bigger('p');
        bigger('li')
    }
    function decreaseFontSize() {
        smaller('p');
        smaller('li');
    }
    
    function bigger(tag){
       var p = document.getElementsByTagName(tag);
       for(i=0;i<p.length;i++) {
          if(p[i].style.fontSize) {
             var s = parseInt(p[i].style.fontSize.replace("px",""));
          } else {
             var s = 12;
          }
          if(s!=max) {
             s += 1;
          }
          p[i].style.fontSize = s+"px";
       }
          setCookie("cr_fontSize", s, 5);          
       
    }
    function smaller(tag){
       var p = document.getElementsByTagName(tag);
       for(i=0;i<p.length;i++) {
          if(p[i].style.fontSize) {
             var s = parseInt(p[i].style.fontSize.replace("px",""));
          } else {
             var s = 12;
          }
          if(s!=min) {
             s -= 1;
          }
          p[i].style.fontSize = s+"px";
       }   
          setCookie("cr_fontSize", s, 5);          
    }
    /* END CHANGE FONT SIZE FUNCTIONS*********************** */


    /* LAYERS */
      function showOrHide(eId, thisImg, state, cookieName) {
	      if (e = document.getElementById(eId)) {
	      
		      if (state == null) {
			      state = e.style.display == 'none';
			      //e.style.display = (state ? '' : 'none');
			  }
		      
		      //...except for this, probably a better way of doing this, but it works at any rate...
	          if (state == true){				
    		      if (thisImg != null){
			          document.getElementById(thisImg).src="../images/collapse.jpg";
                  }
	              e.style.display = '';
	          }
	          if (state == false){
    		      if (thisImg != null){
			          document.getElementById(thisImg).src="../images/expand.jpg";
                  }
		          e.style.display = 'none';
	          }
              		      
		      if (cookieName == null){
		        cookieName = eId;
		      }
		      
		      setCookie(cookieName, state,365);
	      }
      }

//-->

