
/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

globalUrlVar = '';

function ajaxpage(url, containerid){
 if(url.indexOf('?') == -1){
 	ajax = '?ajax=1'	
 }else{
 	ajax = '&ajax=1'
} 
 jQuery('#' + containerid).load(url + ajax);
}

function loadSite(){
    currentUrl = window.location.href;
    var temp = new Array();
    temp = currentUrl.split('#');
    if(temp.length == 2){
        temp = temp[1].split('=');
        ajaxpage(temp[1] + '.html', temp[0]);  
    }
}

function hasUrlChanged(){
    if (globalUrlVar != window.location.toString()){
        loadSite();
    }
    globalUrlVar = window.location.toString();    
}

//moj dodatak koji provjerava dali u linku postoji ajax...
$(document).ready(function() {
       loadSite();
       setInterval('hasUrlChanged()', 100 );
});