<?php
define('IN_SYS',TRUE);
require './config.php';
require './setup.php';
require './lib/system_SqlIn.php';
$conn = new dbo();
$maxType = 0;
?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $siteTitle;?></title>
<meta name="description" content="<?php echo $siteDescription;?>" />
<meta name="keywords" content="<?php echo $siteKeywords;?>" />
<meta name="author" content="<?php echo $siteAuthor;?>" />
<link rel="stylesheet" href="temp/css/style.css" type="text/css"/>
<script src="temp/js/jquery-1.7.2.js" type="text/javascript"></script>
<script src="temp/js/jquery.SuperSlide.2.1.js" type="text/javascript"></script>
<script type="text/javascript" src="temp/js/1141.js"></script>
<script type="text/javascript" src="temp/js/zzsc.js"></script>
<script type="text/javascript" src="temp/js/public.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
</head>

<body>
<!--头部header层-->
<? require_once('./public_header.php');?>
<div class="products clear">
	<div class="commonWidth">
    	<div class="productsTitle">Products Display<h3>产品<span>展示</span></h3></div>
    	<div class="slider">
            <ul>
         <?php
        $conn->query("select id,title,pic,jumpUrl from ".DB_TablePre."content where type in (".GetSqlSuper(3,'category').") and pic != '' order by adate desc limit 0,8");
        while($rs = $conn->fetch_array()){
					$title = KillWord($rs['title'],30);
					if($rs['jumpUrl']!=''){
						$alink = $rs['jumpUrl'];
					}else{
						$alink = "./productsDetail.php?aid=".$rs['id'];
					}
					$pic = $rs['pic'];
    			?>
                <li>
                    <a href="<?=$alink?>"><img width="260" height="200" alt="<?=$title?>" src="<?=$pic?>"/>
                        <span><?=$title?></span>
                    </a>                    
                </li>
  		 <? }  ?> 
            </ul>
        </div>
        <a href="<?=Jqlib::linkinfo(3,'page.php')?>" class="more">+</a>
    </div>
</div>
<!--products end-->
<div class="advertise">
	<div class="commonWidth">
    	<div class="advertiseLeft fl">唯有定制  方显情真<br/><span>Only the custom show the true love</span></div>
        <div class="advertiseRight fr">           
			<form action="./search.php" method="get" onsubmit="return check_s(this);" name="FormSearch">
                <input name="keyword"  class="searchTxt" placeholder="请输入搜索内容" onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='请输入搜索内容';" onFocus="this.select()" onClick="if(this.value=='请输入搜索内容')this.value=''" />
                <input type="button" value=" " class="searchBtn" id="jq_search_btn"/>
            </form>
            
        </div> 
    </div>
</div>
<!--advertise end-->
<div class="aboutus">
	<div class="commonWidth">
    	<div class="aboutusTitle">About Us<h3>关于<span>我们</span></h3></div>
        <div class="aboutusLeft fl">
            <img src="temp/images/aboutus.jpg" alt="aboutus"/>
        </div>
        <div class="aboutusRight fr">
        	<h4><?=$companyName?></h4><br/>
            <?=info(1)?><br/>
			<a href="page.php?cid=10" class="fr">查 看 更 多</a>
        </div>
    </div>
</div>
<!--aboutus end-->
<div class="products clear">
	<div class="commonWidth">
    	<div class="productsTitle">PROJECTS DISPLAY<h3>项目<span>展示</span></h3></div>
    	<div class="slider">
            <ul>
         <?php
        $conn->query("select id,title,pic,jumpUrl from ".DB_TablePre."content where type in (".GetSqlSuper(38,'category').") and pic != '' order by adate desc limit 0,8");
        while($rs = $conn->fetch_array()){
					$title = KillWord($rs['title'],30);
					if($rs['jumpUrl']!=''){
						$alink = $rs['jumpUrl'];
					}else{
						$alink = "./view.php?aid=".$rs['id'];
					}
					$pic = $rs['pic'];
    			?>
                <li>
                    <a href="<?=$alink?>"><img width="260" height="200" alt="<?=$title?>" src="<?=$pic?>"/>
                        <span><?=$title?></span>
                    </a>                    
                </li>
  		 <? }  ?> 
            </ul>
        </div>
        <a href="<?=Jqlib::linkinfo(38,'page.php')?>" class="more">+</a>
    </div>
</div>
<!--products end-->
<div class="advertise2">
	<div class="commonWidth">
    	<div class="advertise2Left fl">专业专注&nbsp;&nbsp;用心服务<br/><span>为您打造不一样的旅游服务</span></div>
        <div class="advertise2Right fr">服务咨询热线<br/><span><?=$shareCode?></span></div> 
    </div>
</div>
<!--advertise2-->
<div class="news">
	<div class="commonWidth">
        <div class="newsTitle">News<h3>新闻<span>资讯</span></h3></div>
        <div class="newsLeft fl">
        	<ul>
			<?
            $conn->query("select id,type,title,adate,jumpUrl from site_content where type in(2) and isRecommend='0' order by adate desc limit 7");
			while($rs = $conn->fetch_array()){
				$date = FormatTime(1,$rs["adate"]);
				$title = KillWord($rs['title'],20);
				if($rs['jumpUrl']!=''){
					$alink = $rs['jumpUrl'];
				}else{
					$alink = "./view.php?aid=".$rs['id'];
				}
			?>
            	<li><a href="<?=$alink?>"><?=$title?></a><span><?=$date?></span></li>
               <?
				}
			   ?>
           </ul>
        </div>
        <?
		   $i=0;
           $conn->query("select id,type,title,adate,jumpUrl,pic from site_content where type in(2) and pic !='' and isRecommend='1'  order by adate desc limit 7");
			while($rs = $conn->fetch_array()){
				$date = FormatTime(1,$rs["adate"]);
				$title = KillWord($rs['title'],20);
				if($rs['jumpUrl']!=''){
					$alink = $rs['jumpUrl'];
				}else{
					$alink = "./view.php?aid=".$rs['id'];
				}
				if($i==0){
					$text_style = 'style="opacity: 1;"';
					$pic_style = 'class="selected"';
				}else{
					$text_style = 'style="opacity: 1; display: none;"';
					$pic_style = '';
				}
				$img = $rs['pic'];
				$text     .= '<a href="'.$alink.'" '.$text_style.' target="_blank">'.$title.'</a>';
				$pic_text .= '<li ><a '.$pic_style.'><img src="'.$img.'" alt=""/><span class="mask"></span></a></li>';
				$picbig   .= '<a href="#" class="J-pic-node"><img src="'.$img.'"  alt="" width="555" height="290"/></a>';
				$i++;
			}
		?>
        <div class="newsRight fr">
			<div id="bd" class="gclearfix">
                <div class="slide" id="Slide">
                    <div class="slide-hd">
                        <h2 class="title">
                            <?=$text?>
                        </h2>
                        
                        <div class="thumb" id="slidePagination">
                            <ul class="gclearfix">
                                <?=$pic_text?>
                            </ul>
                        </div>
                        <div class="slide-hd-bg"></div>
                    </div>
                    <div class="slide-bd" id="slideWrapper">
                        <div class="pic-list">
                        <?=$picbig?>
                    </div>
                </div>
                    <div class="slide-btn">
                        <a href="" class="prev">上一页
                            <!--[if IE 6]>
                                <div>
                                    <span class="arrow"></span>
                                    <span class="mask"></span>
                                </div>
                            <![endif]-->
                        </a>
                        
                        <a href="" class="next">下一页
                            <!--[if IE 6]>
                                <div>
                                    <span class="arrow"></span>
                                    <span class="mask"></span>
                                </div>
                            <![endif]-->
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--news end-->
<div class="contactus clear">
	<div class="commonWidth">
    	<div class="contactusTitle">Contact Us<h3>联系<span>我们</span></h3></div>
        <!--百度地图容器-->
  		<div style="width:1200px;height:440px;border:#ccc solid 1px;" id="dituContent"></div>
    </div>
</div>
<!--contactus end-->
<? require_once('./public_footer.php');?>
<script>
	//控制左右按钮显示【banner滚动处】 
		jQuery(".fullSlide").hover(function(){ jQuery(this).find(".prev,.next").stop(true,true).fadeTo("show",0.5) },function(){ jQuery(this).find(".prev,.next").fadeOut() });

		//调用SuperSlide 
		jQuery(".fullSlide").slide({ titCell:".hd ul", mainCell:".bd ul", effect:"fold",  autoPlay:true, autoPage:true, trigger:"click",
			startFun:function(i){
				var curLi = jQuery(".fullSlide .bd li").eq(i); /* 当前大图的li */
				if( !!curLi.attr("_src") ){
					curLi.css("background-image",curLi.attr("_src")).removeAttr("_src") /* 将_src地址赋予li背景，然后删除_src */
				}
			}
		});		
</script>
<script>
$(document).ready(function(){

	$(".slider").imgscroll({
		speed: 40,    //图片滚动速度
		amount: 0,    //图片滚动过渡时间
		width: 1,     //图片滚动步数
		dir: "left"   // "left" 或 "up" 向左或向上滚动
	});
	
});


//图片滚动 调用方法 imgscroll({speed: 30,amount: 1,dir: "up"});
$.fn.imgscroll = function(o){
	var defaults = {
		speed: 40,
		amount: 0,
		width: 1,
		dir: "left"
	};
	o = $.extend(defaults, o);
	
	return this.each(function(){
		var _li = $("li", this);
		_li.parent().parent().css({overflow: "hidden", position: "relative"}); //div
		_li.parent().css({margin: "0", padding: "0", overflow: "hidden", position: "relative", "list-style": "none"}); //ul
		_li.css({position: "relative", overflow: "hidden"}); //li
		if(o.dir == "left") _li.css({float: "left"});
		
		//初始大小
		var _li_size = 0;
		for(var i=0; i<_li.size(); i++)
			_li_size += o.dir == "left" ? _li.eq(i).outerWidth(true) : _li.eq(i).outerHeight(true);
		
		//循环所需要的元素
		if(o.dir == "left") _li.parent().css({width: (_li_size*3)+"px"});
		_li.parent().empty().append(_li.clone()).append(_li.clone()).append(_li.clone());
		_li = $("li", this);

		//滚动
		var _li_scroll = 0;
		function goto(){
			_li_scroll += o.width;
			if(_li_scroll > _li_size)
			{
				_li_scroll = 0;
				_li.parent().css(o.dir == "left" ? { left : -_li_scroll } : { top : -_li_scroll });
				_li_scroll += o.width;
			}
				_li.parent().animate(o.dir == "left" ? { left : -_li_scroll } : { top : -_li_scroll }, o.amount);
		}
		
		//开始
		var move = setInterval(function(){ goto(); }, o.speed);
		_li.parent().hover(function(){
			clearInterval(move);
		},function(){
			clearInterval(move);
			move = setInterval(function(){ goto(); }, o.speed);
		});
	});
};
</script>
<script type="text/javascript">
    //创建和初始化地图函数：
    function initMap(){
        createMap();//创建地图
        setMapEvent();//设置地图事件
        addMapControl();//向地图添加控件
        addMarker();//向地图中添加marker
    }
    
    //创建地图函数：
    function createMap(){
        var map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图
        var point = new BMap.Point(114.332249,30.536002);//定义一个中心点坐标
        map.centerAndZoom(point,18);//设定地图的中心点和坐标并将地图显示在地图容器中
        window.map = map;//将map变量存储在全局
    }
    
    //地图事件设置函数：
    function setMapEvent(){
        map.enableDragging();//启用地图拖拽事件，默认启用(可不写)
        map.enableScrollWheelZoom();//启用地图滚轮放大缩小
        map.enableDoubleClickZoom();//启用鼠标双击放大，默认启用(可不写)
        map.enableKeyboard();//启用键盘上下左右键移动地图
    }
    
    //地图控件添加函数：
    function addMapControl(){
        //向地图中添加缩放控件
	var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
	map.addControl(ctrl_nav);
        //向地图中添加缩略图控件
	var ctrl_ove = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1});
	map.addControl(ctrl_ove);
        //向地图中添加比例尺控件
	var ctrl_sca = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
	map.addControl(ctrl_sca);
    }
    
    //标注点数组
    var markerArr = [{title:"伟鹏大厦",content:"地址：湖北省武汉市紫阳东路77号伟鹏大厦17楼",point:"114.332101|30.536507",isOpen:1,icon:{w:23,h:25,l:46,t:21,x:9,lb:12}}
		 ];
    //创建marker
    function addMarker(){
        for(var i=0;i<markerArr.length;i++){
            var json = markerArr[i];
            var p0 = json.point.split("|")[0];
            var p1 = json.point.split("|")[1];
            var point = new BMap.Point(p0,p1);
			var iconImg = createIcon(json.icon);
            var marker = new BMap.Marker(point,{icon:iconImg});
			var iw = createInfoWindow(i);
			var label = new BMap.Label(json.title,{"offset":new BMap.Size(json.icon.lb-json.icon.x+10,-20)});
			marker.setLabel(label);
            map.addOverlay(marker);
            label.setStyle({
                        borderColor:"#808080",
                        color:"#333",
                        cursor:"pointer"
            });
			
			(function(){
				var index = i;
				var _iw = createInfoWindow(i);
				var _marker = marker;
				_marker.addEventListener("click",function(){
				    this.openInfoWindow(_iw);
			    });
			    _iw.addEventListener("open",function(){
				    _marker.getLabel().hide();
			    })
			    _iw.addEventListener("close",function(){
				    _marker.getLabel().show();
			    })
				label.addEventListener("click",function(){
				    _marker.openInfoWindow(_iw);
			    })
				if(!!json.isOpen){
					label.hide();
					_marker.openInfoWindow(_iw);
				}
			})()
        }
    }
    //创建InfoWindow
    function createInfoWindow(i){
        var json = markerArr[i];
        var iw = new BMap.InfoWindow("<b class='iw_poi_title' title='" + json.title + "'>" + json.title + "</b><div class='iw_poi_content'>"+json.content+"</div>");
        return iw;
    }
    //创建一个Icon
    function createIcon(json){
        var icon = new BMap.Icon("http://app.baidu.com/map/images/us_mk_icon.png", new BMap.Size(json.w,json.h),{imageOffset: new BMap.Size(-json.l,-json.t),infoWindowOffset:new BMap.Size(json.lb+5,1),offset:new BMap.Size(json.x,json.h)})
        return icon;
    }
    
    initMap();//创建和初始化地图
</script>
</body>
</html>
