

jQuery(function(){
	var strP = '<div class="popUp"></div>';
	var popUp = jQuery(strP);
	var scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
	var scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
	var winHeight = jQuery(window).height();
	var winWidth = jQuery(window).width();
	var popUpHeight = jQuery('#personalTravel').height();
	var popUpWidth = jQuery('#personalTravel').width();
	jQuery(".reviewDetail a.down").bind("click",function(e){
	
		var jQueryclicked = jQuery(e.target); 
        var Uid=jQueryclicked.attr("userId");
         GetUserProfile(Uid);

		jQuery('#personalTravel').css({
			position:'absolute',
			left:jQuery(e.target).offset().left + 'px',
			top:jQuery(e.target).offset().top + 18 +'px'
		}).slideDown(200).find('.closeBtn').bind('click',function(){
				jQuery('#personalTravel').slideUp(200);	
			}).end().find('.sendMsg').bind('click',function(e){
					jQuery('#personalTravel').hide();
					popUp.css({
            		width: scrollWidth + 'px',
            		height: scrollHeight + 'px',
					opacity:0.5
        }).appendTo('body').show(300);
					jQuery('#sendMessage').css({
					top: winHeight / 2 - popUpHeight / 2 + 'px',
            		left: winWidth / 2 - popUpWidth / 2 + 'px'				  
					}).show(200).find('.closeBtn, .cancelBtn').bind('click',function(){
						jQuery('#sendMessage').hide(300);
						popUp.hide(300);
					});
				});
	});
});
	function TimeRank(){
       var d, s = "";
       d = new Date();
       s += Math.random() * 99999 + d.getHours() + d.getMinutes() + d.getSeconds() + d.getMilliseconds();
       return(s);
    }
	
function GetUserProfile(Uid)
	{
	   //
	   jQuery.ajax({
        url:'/destguides/AjaxNew/GetMemberProfile.ashx',
        type: 'GET',
        dataType:"text",
          data:"Uid="+Uid + "&p="+ TimeRank(),
        timeout: 10000,
        error: function(data){
           
        document.getElementById("personalInfo").innerHTML="<img src=\"http://images3.ctrip.com/Community/images/loading.gif\"  alt=\"\"/>";  
           
            },
        success: function(data){
                  document.getElementById("personalInfo").innerHTML=data;
              }
          }
       );
	  //
      
	}

function RetWebPath()
{
    var PathUrl="";
    var sHref= location.href;
    
     if(sHref.toLowerCase().indexOf("http://destguides.dev.sh.ctriptravel.com")>-1)
     {
        PathUrl="destguides";
        
     }
     if(sHref.toLowerCase().indexOf("http://destguides.test.sh.ctriptravel.com")>-1)
     {
         PathUrl="destguides";
     }
     if(sHref.toLowerCase().indexOf("http://destguides.uat.sh.ctriptravel.com")>-1)
     {
         PathUrl="destguides";
     }
    
     return PathUrl;
}
	
