 
<style>
    .textaa{
    top:161px!important;
    left:629px!important;
    position:absolute;
    background-color:#fff;
    z-index: 2000!important;
    }

</style>
<script type="text/javascript">
    $(document).ready(function(){
        $(".jqRate").live("click",function(){

           var starNo = $(this).attr("rateVal");
       //alert(starNo)    ;return false;
           $.ajax({
            url:  "<?php echo ConfigUrl::base(); ?>index/renderRate/",
            data: {
                product_id: <?php echo $this->listData[0]->nBusId;?>,
                starNo: starNo
            },
            success: function() {

               //$("#renderRate_"+starNo).text(ret);
                alert("You have successfully rated this product");
               window.location.reload();
               //$('.raterender')
               //$('.raterender').attr('disabled', true);
            }


        });
      });

    });
</script>
<?php
//print_r($_SESSION);
//echo $_SESSION['default_tmp_rate_flag_'.$this->listData[0]->nBusId];
//echo "ddddddd".$sessName = default_tmp_rate_flag_.$this->listData[0]->nBusId;
if($_SESSION['default_hit_'.$this->listData[0]->nBusId]=='Y'){
        $classToCall = 'jqNoRate';
        $cursorStyle = 'cursor: default';
    }else{
        $classToCall = 'jqRate';
        $cursorStyle = 'cursor: pointer';
        }
    $imagePath = '';

    if(file_exists(BASE_PATH.'uploads/image/'.$this->listData[0]->Image)==false)
    {
        $imagePath = ConfigUrl::root().'uploads/image/noimage.jpg';
    }
    else
    {
        $imagePath = ConfigUrl::root().'uploads/image/'.$this->listData[0]->Image;
    }


    if($this->listData[0]->Image=='')
    {
        $imagePath = ConfigUrl::root().'uploads/image/noimage.jpg';
        $this->listData[0]->Image='noimage.jpg';
    }

?>



<div id="divComm" class="textaa"></div>
<script type="text/javascript" src="<?php echo BASE_URL;?>public/js/library/swfobject.js"></script>

<?php if($this->listData[0]->Video!='')
   {
      $video= ConfigUrl::root().'uploads/video/'.$this->listData[0]->Video;
      $swf='AS3_Javascript';
      $showFlag =true;

   }
   else if($this->listData[0]->VideoURL!='')
   {
       $video=explode("=",$this->listData[0]->VideoURL);
       $video=$video[sizeof($video)-1];
       $swf='videoplayeryoutube';
        $showFlag =true;
   }
        ?>
<script src="<?php echo BASE_URL; ?>public/js/library/jRating.jquery.min.js" type="text/javascript"></script>
<script src="<?php echo BASE_URL; ?>public/js/library/jRating.jquery.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css"  href="<?php echo ConfigUrl::style();?>jRating.jquery.css" media="all" />

<script type="text/javascript" >



window.onload = function()
                {
                   sendTextToAS3();                   
                };

    var flashvars = {};


	function sendToAS3(elem){
		var Txt = elem.value;


		var flash =	document.getElementById("as3_js");

		flash.sendTextFromJS(Txt);

	//document.getElementById('sendToFlash').value = "";
	}
	function sendTextToAS3(){
	      // var Txt = document.getElementById('htmlText').value;
               flashvars.videoid = "<?php echo $video;?>";
               var params = {};
               params.allowfullscreen = "true";
	       var attributes = {};
	       attributes.id = "as3_js";
	       swfobject.embedSWF("<?php echo BASE_URL;?>uploads/<?php echo $swf; ?>.swf", "alt", "600", "329", "9.0.0", false, flashvars, params, attributes);

        }




         
        function showComment(e,id)
          {
            var posx =0;var posy=0;
              if (!e){var e = window.event;}
                if (e.pageX || e.pageY){
                    posx = e.pageX;
                    posy = e.pageY;
                }
                else if (e.clientX || e.clientY){
                    posx = e.clientX;
                    posy = e.clientY;
                }
               $('#divCommText'+id).css("top",posy+15);
               $('#divCommText'+id).css("left",posx);
               $('#divCommText'+id).fadeIn();
          }

function hideComment(id)
          {
            $('#divCommText'+id).fadeOut("slow");
          }

          function loadComment(e,id,btn)
          { 
              var posx =0;var posy=0;

              if(btn==1)
              {
                  var loadAction ='loadComments';
              }
              else
              {
                  var loadAction ='loadInquiry';
              }

              if (!e){var e = window.event;}
                if (e.pageX || e.pageY){
                    posx = e.pageX;
                    posy = e.pageY;
                }
                else if (e.clientX || e.clientY){
                    posx = e.clientX;
                    posy = e.clientY;
                }
              $('#divComm').fadeIn("slow");
              $('#divComm').css("top",posy+20);
              $('#divComm').css("left",posx-480);

              
              $('#divComm').load('<?php echo ConfigUrl::base('default')?>index/'+loadAction+'/'+id, function() {
               });
          }
          
function load(btn){

                 if(btn==1)
                 {
                  var loadAction ='insertComments';

                  var name      =   $("#txtName").val();
                  var email    =    $("#txtEmail").val();
                  var comment    =  $("#txtComment").val();
                  var id        =   $("#xid").val();
                 }
                 else
                 {
                   var loadAction ='insertInquiry';

                  var name      =   $("#xtxtName").val();
                  var email    =    $("#xtxtEmail").val();
                  var comment    =  $("#xtxtInquiry").val();
                  var id        =   $("#xid").val();
                 }


                  

                 // var re = /^[a-zA-Z0-9\.]+@[A-Za-z0-9]+\.[a-zA-Z]{1,3}$/;
                 var re =  /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    
      


                  if(comment=="" || id=="" || name=="")
                  {
                      $("#divCommReq").html("Please Enter All Fields");
                  }
                  else
                  {


                  if(re.test(email)==true)
                  {


                  var data 	= 'id='+id+'&comment='+comment+'&email='+email+'&name='+name;

                // location.href="<?php echo ConfigUrl::base(); ?>index/"+loadAction+"/";

                  $.ajax({
                        url: "<?php echo ConfigUrl::base(); ?>index/"+loadAction+"/",
                        type: "POST",
                        data: data,
                        cache: false,
                        success: function (html) {
                                if (html==1) {

                                    

                                    $("#divComm").fadeOut("slow");

                                    alert('Successfully Posted!');

                                    $("#divCommVal").html(comm);

                                    

                                    if(status==1)$("#divStatusVal").html("Approved");
                                    else $("#divStatusVal").html("Not Approved");

                                    /*$("#cat"+id).hide("slow");
                                    $("#catVal"+id).html(cat);
                                    $("#catVal"+id).show("slow");*/
                                    $("#jq_messagerow").show();
                                    $("#commMsg").html('Comment updated Successfully');
                                    $("#commMsg").fadeIn("Slow");
//                                    setTimeout(function() {$("#commMsg").fadeOut("slow");$("#commMsg").html('')},2000);
                                    $("#jq_messagerow").hide(2005);
                                    return false;
                                }
                                if (html==2)
                                    $("#divCommReq").html("Please Enter Comment");

                                else alert('Sorry, unexpected error. Please try again later.'+html);
                        }
                        });

                        }
                        else
                        {
                         $("#divCommReq").html("Invalid Email Address");
                        }
                    }

                    

          }

      </script>
    

<div class="inner_rightpanel">

  
	
	

<div class="content_area_div">

<div class="content_area">

<div class="details_page">
<div class="category_lisings">
 <div class="brd-crms"><ul>
			<li><a href="<?php echo BASE_URL;?>index/listing">Home</a> </li>
			<?php 
			if($this->catName != '')
				echo '<li> &raquo; <a href="'.BASE_URL.'index/listing/'.$this->listData[0]->nParentCatId .'">'.$this->catName.'</a> </li>';
			if($this->subCatName != '')
				echo '<li> &raquo; <a href="'.BASE_URL.'index/listing/'.$this->listData[0]->nParentCatId.'/'.$this->listData[0]->nCatid.'">'.$this->subCatName.'</a> </li>';
			?>
		</ul>
		<div class="clear"></div>
	</div></div>
	
    <input type="hidden" id="xid" name="xid" value="<?php echo $this->listData[0]->nBusId?>">
    

<?php if($this->listData[0]->Image=="")
{
    ?>
<div  class="details_wrap2">

<div class="product_details_div_wrp2">
<h2><?php echo $this->listData[0]->Title; ?></h2>
<p><?php echo $this->listData[0]->Description; ?></p>

<div class="details_controlls_wrp2">

<div class="details_cntr_btns">

<ul>
<li><a href="#" onclick="loadComment(event,'<?php echo $this->listData[0]->nBusId?>',2);">Inquire</a></li>
<?php if(PRODUCT_COMMENT_MODE=="Y") {?>
<li><a href="#" onclick="loadComment(event,'<?php echo $this->listData[0]->nBusId?>',1);">Comment</a></li>
<?php } ?>
</ul>
<div class="clear"></div>
</div>

 <?php if(PRODUCT_RATE_MODE=="Y") {
     
 $productRating = $this->productRating;


     
     ?>

 <!--<div class="rating_div" style="width:200px;">
    <div class="left">Rating &nbsp;:&nbsp;</div>
    <div class="exemple">
        <?php //?>
        <div class="exemple3" id="18_<?php echo $this->listData[0]->nBusId;?>?>"></div>
    </div>
    <div class="clear"></div>
</div>-->
 <div class="rate_div" >
        <div class="left"><strong> Rating &nbsp;:&nbsp;</strong></div>
        <?php for($i=1;$i<=5;$i++) { ?>

            <?php if($i <= $this->productRating ) {
                $image = "star_on.png";
            } else {?>
            <?php $image = "star_off.png"; ?>
             <?php } ?>

        <span  class="renderRate <?php echo $classToCall?>" style="<?php echo $cursorStyle;?>;" id="renderRate_"<?php echo $i;?> rateVal="<?php echo $i;?>" ><img src="<?php echo ConfigUrl::images('default').$image;?>"  /></span>

            <?php } ?>
    </div>
    <?php } ?>
<div class="date_div">
    Posted On :<?php echo date("m/d/Y",strtotime($this->listData[0]->dPostDate)); ?> &nbsp;
<div class="clear"></div>
</div>


<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<div class="clear"></div>
</div>
<?php } else{
    ?>
<div class="details_wrap1">
<div class="pic_div">
    <img src="<?php echo $imagePath;?>" height="302px" width="302px">
<div class="clear"></div>
</div>

<div class="product_details_div">
<h2 style="float:left "><?php echo $this->listData[0]->Title; ?></h2>
<div style="overflow:hidden; float:right">
	<div class="date_div">
		Posted On :<?php echo date("m/d/Y",strtotime($this->listData[0]->dPostDate)); ?> &nbsp;
		<div class="clear"></div>
	</div>
	<div>
		<?php if(PRODUCT_RATE_MODE=="Y") {
			  $productRating = $this->productRating;
			  if ($productRating>0){ ?>
					<!--<div class="rating_<?php echo $productRating; ?> rating-top" id="tmprate"></div>-->
		
		
		<?php }
		}?>
	</div>
</div>
	<div class="clear"></div>
	<p class="desc"><?php echo $this->listData[0]->Description; ?></p>

<div class="clear"></div>

<div class="details_controlls" style="padding:15px 0;">

<div class="details_cntr_btns">
<?php
//echo $this->userId;
if($this->userId == $this->listData[0]->nUserId){?>
<?php
}else{?>
    <ul>
    <li><a  class="" href="#" onclick="loadComment(event,'<?php echo $this->listData[0]->nBusId?>',2);">Inquire</a></li>
    <?php if(PRODUCT_COMMENT_MODE=="Y") {?>
    <li><a href="#" onclick="loadComment(event,'<?php echo $this->listData[0]->nBusId?>',1);">Comment</a></li>
    <?php } ?>
    </ul>
<?php
}?>


</div>

<div class="details_ratings_date lft">
     <?php if(PRODUCT_RATE_MODE=="Y") {
      $productRating = $this->productRating;
      if ($productRating>0){ ?>
 			<!--<div class="rating_<?php echo $productRating; ?>" id="tmprate"></div>-->


<?php }
?>

<!--<div class="rating_div" style="width:200px;">
    <div class="left"><strong class="rate-nw">Rating : </strong></div>  <div class="exemple">
	<div class="exemple3" id="18_<?php echo $this->listData[0]->nBusId;?>?>"></div>
</div>-->
        <div class="rate_div" >
        <div class="left"><strong> Rating &nbsp;:&nbsp;</strong></div>
        <?php for($i=1;$i<=5;$i++) { ?>

            <?php if($i <= $this->productRating ) {
                $image = "star_on.png";
            } else {?>
            <?php $image = "star_off.png"; ?>
             <?php } ?>

        <span  class="renderRate <?php echo $classToCall?>" style="<?php echo $cursorStyle;?>;" id="renderRate_"<?php echo $i;?> rateVal="<?php echo $i;?>" ><img src="<?php echo ConfigUrl::images('business').$image;?>"  /></span>

            <?php } ?>
    </div>

<div class="clear"></div>
</div>
    <?php } ?>

<!--div class="date_div">
Date :<?php echo date("m/d/Y",strtotime($this->listData[0]->dPostDate)); ?> &nbsp;
<div class="clear"></div>
</div-->


<div class="clear"></div>
</div>



<div class="clear"></div>
</div>

<div class="clear"></div>
</div>


<div class="clear"></div>
</div>

<?php
}
?>
<div class="watch_video" >
<?php
$map_flag = false;
if(trim($this->listData[0]->Zipcode) <> ''){
    $location = trim($this->listData[0]->Zipcode);
    $map_flag = true;
}
elseif(trim($this->listData[0]->Address) <> ''){
    $location = trim($this->listData[0]->Address);
    $map_flag = true;
}

if($this->isValidZip > 0){
    ?>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
      var geocoder;
      var map;

      var disp_address = '<?php echo trim($this->listData[0]->Address); ?>';

      function initialize() {
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(-34.397, 150.644);
        var mapOptions = {
          zoom: 12,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
        codeAddress();
      }

      function codeAddress() {
        var address = '<?php echo $location; ?>';
        geocoder.geocode( { 'address': address}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
            map.setCenter(results[0].geometry.location);
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });

            var infoWindow = new google.maps.InfoWindow();
            var html='<b><u>Address</u></b><br />'+disp_address;
            google.maps.event.addListener(marker, 'click', function() {
                infoWindow.setContent(html);
                infoWindow.open(map, marker);
            });
          }
        });
      }      
    </script>
    <div id="map_canvas" style="width:350px; height:320px; margin: 20px 10px 20px 0; float: left"></div>
    <script type="text/javascript">
        initialize();
    </script>
    <?php
}
if($showFlag){
?>

<div class="videosz" style="float:left">
    <h4>&nbsp;</h4>
<div class="clear"></div>



<!--------VIDEO PLAYER------------>




<div class="js"  >

</div>

<div class="as3" style="float:left">
	<div id="alt"></div>
</div>



<!--------VIDEO PLAYER------------>

</div>



<?php }?>
    
    <div class="clear"></div>
    <?php
    $tableArray = array('nBusId','nUserId','nCatid','dPostDate','nStatus','nFeatured','Title','Description','Image','Video','VideoURL','Zipcode','Address','Country','maxSearches');
      $fileExt    = array('txt','doc','pdf','xls');
    ?>
</div>
    <div class="clear">
        <table border="0" class="table-details" cellspacing="1" cellpadding="0">
            <?php //if($this->listData[0]->Address<>""){ ?>
            <!--<tr><td width="30%"><b>Address</b></td><td><?php echo $this->listData[0]->Address; ?></td></tr>-->
            <?php //} ?>
            
            <?php
                
            foreach($this->listData[0] as $product => $val )
                    {
//                /echo $this->fieldtype[$product];
                        if(!in_array($product,$tableArray))
                        {//echopre($product);
                            if($val<>"")
                            {
                                if($this->listingFields[$product]!=''){
                                    $valFile = explode('.',$val);
                                    if(in_array($valFile[sizeof($valFile)-1],$fileExt))
                                        echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td><a href="'.ConfigUrl::root().'uploads/doc/'.$val.'" target="_blank">Download</a></td></tr>';
                                    else{
                                        if($this->fieldtype[$product]=='1'){
                                           $link_type    =   explode(':',$val);
                                           if($link_type[0]=='http' OR $link_type[0]=='https' ){
                                                $url_link   =$val;
                                            }
                                            else{
                                                $url_link   ='http://'.$val;
                                            }
                                            echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td><a href="'.$url_link.'" target="_blank">'.$url_link.'</a></td></tr>';
                                        }
                                        else{
                                            echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td>'.$val.'</td></tr>';
                                        }
                                    }
                                }
                            }
                        }
                        else{
                            if($val<>"")
                            {
                              $tbl_array=array('Zipcode','Address','Country');
                              if(in_array($product,$tbl_array)){
                                //echo '<tr><td width="50%"><b>'.$product.'</b></td><td>'.$val.'</td></tr>'; 
                                 if($this->fieldtype[$product]=='1'){
                                    $link_type    =   explode(':',$val);
                                           if($link_type[0]=='http' OR $link_type[0]=='https' ){
                                                $url_link   =$val;
                                            }
                                            else{
                                                $url_link   ='http://'.$val;
                                            }
                                            echo '<tr><td width="50%"><b>'.$product.'</b></td><td><a href="'.$url_link.'" target="_blank">'.$url_link.'</a></td></tr>';
                                }
                                else{
                                    if($product=='Country'){
                                        global $countries;
                                        echo '<tr><td width="50%"><b>'.$product.'</b></td><td>'.$countries[US].'</td></tr>';
                                    }
                                    else{
                                         echo '<tr><td width="50%"><b>'.$product.'</b></td><td>'.$val.'</td></tr>';
                                    }
                                   
                                }
                              }
                            }
                        }
                    }
                    //$tableArray = array('nBusId','nUserId','nCatid','dPostDate','nStatus','nFeatured','Title','Description','Image','Video','VideoURL','Zipcode','Address','Country','maxSearches');
             ?>
           <?php //if($this->listData[0]->Country) { ?>
                <!--<tr><td width="50%"><b>Country</b></td><td><?php echo $this->listData[0]->Country; ?></td></tr>-->
            <?php //} ?>

        </table>
    </div>
<!-- Details Comment Section Start -->
<?php if(PRODUCT_COMMENT_MODE=="Y") {?>
<div class="comment_section">
<h2>Comments</h2>
<ul>
<?php //print_r($this->productComment);
if(is_array($this->productComment))
	{
	if(count($this->productComment)>0)
	{
		foreach ($this->productComment as $comment)
		{
		?>
		
		<li>
		
		<div class="commet_list">
		<p><?php echo $comment->vComment; ?></p>
		<div class="commtz_by">
		<h5><span>Posted By </span>: <?php echo $comment->vName; ?></h5>
		<h6></h6>
		</div>
		
		<div class="clear"></div>
		</div>
		
		</li>
		<?php }
	}
	else{
		echo '<br /><b>No Comments Found !!!</b>';
	}
}
else{
	echo '<br /><b>No Comments Found !!!</b>';
}?>

</ul>



<div class="clear"></div>
</div>

<!-- Details Comment Section End -->


<!--  start paging..................................................... -->
         <?php if($this->pageCount > 1){  ?>

		 <div class="pagination">
           <ul>
            <li><a href="<?php echo ConfigUrl::base()?>index/pagelisting/<?php echo $this->alias;?>/1/" class="page_first" >First</a></li>
            <li><a class="page_prev" href="<?php echo ConfigUrl::base()?>index/pagelisting/<?php echo $this->alias?>/<?php if($this->page != 1) echo $this->page - 1; else echo $this->page; ?>/" >Previous</a></li>
            <li class="pageinfo"><div id="page-info">Page <strong><?php echo $this->page; ?></strong> / <?php echo $this->pageCount; ?></div></li>
            <li><a class="page_next" href="<?php echo ConfigUrl::base()?>index/pagelisting/<?php echo $this->alias?>/<?php if($this->pageCount != $this->page) echo  $this->page + 1; else echo $this->pageCount; ?>/" >Next</a></li>
            <li><a class="page_last" href="<?php echo ConfigUrl::base()?>index/pagelisting/<?php echo $this->alias?>/<?php echo $this->pageCount; ?>/" >Last</a></li>
            </ul>
		<div class="clear"></div>
		</div>
        <?php
        }
       
        
       ?>

<div class="clear"></div>
</div>
<?php } ?>




<div class="clear"></div>
</div>

</div>
<div class="clear"></div>
</div>



<div class="clear"></div>
</div>


  <script>



<?php
  if($this->tmp_rate_flag=='set')
  { ?>
  var customWidthForSelection= <?php echo $this->tmp_rate_count; ?>;
      customWidthForSelection = customWidthForSelection*23;
 <?php
  }
  else
  { ?>

              var customWidthForSelection=0;

 <?php
  }
 ?>
 

$(document).ready(function(){


			$('.exemple3').jRating({
				step:true,
				length : 5,                                
                                decimalLength : 0,
                                //showRateInfo : false,
                                bigStarsPath: '<?php echo ConfigUrl::images();?>stars.png',
                                smallStarsPath:'<?php echo ConfigUrl::images();?>small.png',
                                phpPath: '<?php echo ConfigUrl::base(); ?>index/saverate/'
			});

  <?php
  if($this->tmp_rate_flag=='set')
  { ?>
 $('.exemple3').unbind().css('cursor','default').addClass('jDisabled');
 <?php
  }
 ?>


		});


</script>
 
