

$dom.onload(
    function(){
        
        if (parent!=self){
            var p=$dom.element('<p>'),
                h1=$dom.element('<h1>');

            var parentUrl=p && p.getContent(),
                ip=h1 && h1.getContent(),
                myUrl=self.location.href,
                action=myUrl.replace(/\/[^\/]*$/,'');
            
		
            //-- record URL    
            if (action && parentUrl && ip){

                $http.load(
                    {
                        url:action+'/record.php',
                        method:'post',
                        data:'location='+parentUrl.urlencode()+'&ip='+ip.urlencode(),
                        headers:{
                            'Content-type':'application/x-www-form-urlencoded'
                        },
                        onload:function(response){
                            //alert('response '+(response && response.text));
                        },
                        onerror:function(e){
                            //Object.reportError(e);
                        }
                    }
                );
            }
            /**/
        }

    }
);