/*
* 2011 POOEL PROJECTS - Pooel-WA 
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to info@pooel.it so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Pooel-WA to newer
* versions in the future. If you wish to customize Pooel-WA for your
* needs please refer to http://www.pooel.it for more information.
*
*  @author Pooel <info@pooel.it>
*  @copyright  2007-2011 Pooel
*  @version  Release: 1.0
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/
// CHANGE HASH IN PAGE

    if ("onhashchange" in window) { // event supported?
         window.onhashchange = function () {
        
            changeHashInPage();
            
        }
    }
    else { // event not supported:
     var storedHash = window.location.hash;
            window.setInterval(function () {
                if (window.location.hash != storedHash) {
                storedHash = window.location.hash;
                changeHashInPage();
            
            }
        }, 100);
    }

     
     window.onload = function (){
               if(varJS['changeHash']=='true')changeHashInPage();
          }
              
     function changeHashInPage(){
          
              //alert('Hash url changed! '+ window.location.hash)
              var REQfunI = window.location.hash.replace('#','');
          
              REQfun = REQfunI.split('&');
              var c = REQfun.length;
          
              
              for (i=0;i<c;i++){
          
                    REQf = REQfun[i].split('=');
                    RF_name = REQf[0];
                    RF_var = REQf[1];
                    //alert( 'key='+RF_name+' value'+RF_var );
                    
                    if(RF_name=='p'){
                         if(varJS['facebook']=='true')
                         textRequestGet('index.php?ajax=yes&facebook=true&fblike='+varJS['fbLike']+'&seo_page='+RF_var,varJS['AjaxLoadPage'],null);
                         else
                         textRequestGet('index.php?ajax=yes&seo_page='+RF_var,varJS['AjaxLoadPage'],null);
                         
                         sCL(RF_var);
                    }
                    else if(RF_name=='f'){
                        strFunc = RF_var.replace('[','(');
                        strFunc = RF_var.replace(']',')');
                        strFunc = RF_var.replace('%A3','\'');
                        strFunc = RF_var.replace(/\£/gi,'\'');
                       // alert(strFunc+';');
                        eval(strFunc+';');
                        //sCL(RF_name);
                    }
              }
              
     }
          
     function sCL(obj){
          
              var list = document.getElementById('list_btn_nav').childNodes;
              var c = document.getElementById('list_btn_nav').childNodes.length;
              for(i=0; i<c; i++){
                  if(list[i].attributes['class'])list[i].attributes['class'].value = '';
              }
              var Iobj = document.getElementById('btn_nav_'+obj);
              Iobj.setAttribute('class','active');
              
     }
