var WRInitTime=(new Date()).getTime();

if(document.location.protocol!='https:')
   document.write(unescape("%3Cscript src='http://s.clicktale.net/WRb.js' type='text/javascript'%3E%3C/script%3E"));


vkDom.onLoad(
    function()
    {      

      var div = document.createElement('div');
      div.id = "ClickTaleDiv";
      div.style.display = 'none';

      vkDom.el('global').appendChild(div);

      if(typeof ClickTale=='function') ClickTale(34494,0.0337,"www");
	  
	  //add facebook share on property pages
	  if (vkDom.hasClass(document.body,'template-property'))
	  {
		var content = vkDom.el('content');
		var blocks = content.getElementsByTagName('div');
		if (!blocks.length) return;
		var columns = blocks[0].getElementsByTagName('div');
		if (!columns.length) return;
		var information = columns[0].getElementsByTagName('div');
		if (!information.length) return;
		var features = information[0].getElementsByTagName('div');
		if (features.length<2) return;
		var lastFeature = information[features.length - 1];
		
		var newNode = document.createElement('div');
			newNode.style.clear = 'both';
			newNode.style.position = 'relative';
			newNode.style.top = '30px';
			newNode.style.textAlign = 'center';
			newNode.innerHTML = '<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a>';
		
		   script = document.createElement('script');
		   script.id = 'facebookShareScript';
		   script.type = 'text/javascript';
		   script.src = "http://static.ak.fbcdn.net/connect.php/js/FB.Share";		   
		
		//information[0].insertBefore( newNode, lastFeature.nextSibling );
		lastFeature.appendChild(newNode);
		lastFeature.appendChild(script);
		
	  }

    }
);