﻿//活动专题通用头部
//  要注意不要在样式里面定义body的宽度




/////////////////////////////////////////////////////////////////
////历史专题，专题对应的数据列表
/////////////////////////////////////////////////////////////////
var adData=new Array()
var thisID;
adData["20070918Help_shop"]={
	url:"http://www.f123.com/home/ad/20070918Help_shop/",
	title:"中国摄影市场网——网上开店指南"
};
adData["20070918_sx"]={
	url:"http://www.f123.com/home/ad/20070918_sx/",
	title:"赶快加盟F123免费抢占黄金旺铺"
};
adData["20071207"]={
	url:"http://www.f123.com/home/ad/20071207/",
	title:"苏州首届国际婚纱摄影器材博览会"
};
adData["20080101"]={
	url:"http://www.f123.com/News/Detaile.aspx?id=5462",
	title:"首届杭州闲置摄影器材·影楼用品交易会"
};
adData["20080131"]={
	url:"http://www.f123.com/home/ad/20080131/",
	title:"08顶级时尚婚纱礼服预览"
};
adData["20080226"]={
	url:"http://www.f123.com/home/ad/20080226/",
	title:"第十三界中国·上海国际婚纱摄影器材展"
};
adData["20080401"]={
	url:"http://www.f123.com/home/ad/20080401/",
	title:"f123全国影楼巡礼--杭州"
};
adData["20080408"]={
	url:"http://www.f123.com/home/ad/20080408/",
	title:"f123商铺全面升级"
};
adData["20080415"]={
	url:"http://www.f123.com/home/ad/20080415/",
	title:"第四届广州婚博会"
};
adData["20080421"]={
	url:"http://www.f123.com/home/ad/20080421/",
	title:"F123全国影楼巡礼-广州篇"
};
adData["20080429"]={
	url:"http://www.f123.com/home/ad/20080429/",
	title:"第十四届中国－上海国际婚纱摄影器材展览会"
};
adData["20080514"]={
	url:"http://www.f123.com/home/ad/20080514/",
	title:"第二届国际婚纱婚庆摄影器材博览会"
};
adData["20080605"]={
	url:"http://www.f123.com/home/ad/20080605/",
	title:"2008中国·苏州大展"
};

//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////



/////////////////
//          //调用专题引用下面两个文件就行了，不过必须保证这两个<script>之前没有其他<script>，如果要引用其他<script>，必须放到这两个<script>后面。
//          <script language="javascript" src="http://www.f123.com/Include/Js/jquery.js"><\/script>
//          <script language="javascript" src="http://www.f123.com/home/AD/index/adxml.js"  ztID="专题ID"><\/script>
//                                                              专题ID是指当前页面专题所对应的ID，所有的只用改这一个就行了 
//
//
//
//                  比如在 苏州首届国际婚纱摄影器材博览会 这个专题页面引用通用头部，则在<head></head之间插入以下代码>
//                  <script language="javascript" src="http://www.f123.com/Include/Js/jquery.js"><\/script>
//					<script language="javascript" src="http://www.f123.com/home/AD/index/adxml.js"  ztID="20071207"><\/script>
//////////////////











var topHead =		"<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"	+"\n"+
		"  <tr>"	+"\n"+
		"    <td width=\"120\" height=\"43\" align=\"center\" background=\"/home/ad/index/images/top_bg.gif\"><a href=\"http://www.f123.com/\"><img src=\"/home/ad/index/images/zt_logo.gif\" alt=\"F123中国摄影市场网\" width=\"103\" height=\"35\" border=\"0\" /></a></td>"	+"\n"+
		"    <td background=\"/home/ad/index/images/top_bg.gif\"><table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" background=\"/home/ad/index/images/top_title_bg_mid.gif\">"	+"\n"+
		"      <tr>"	+"\n"+
		"        <td width=\"43\" height=\"12\"><img src=\"/home/ad/index/images/top_title_bg_left.gif\" width=\"12\" height=\"43\" /></td>"	+"\n"+
		"        <td width=\"70\"><img src=\"/home/ad/index/images/top_title.gif\" width=\"70\" height=\"43\" /></td>"	+"\n"+
		"        <td width=\"100%\"><table width=\"98%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"	+"\n"+
		"          <tr>"	+"\n"+
		"            <td width=\"50%\" align=\"left\" id=\"thisPageTitle\" style=\"font-size:12px;font-weight:bold; color:#F15500;\">&nbsp;</td>"	+"\n"+
		"            <td width=\"50%\" align=\"left\">"	+"\n"+
		"			  <select name=\"adDataSelect\" id=\"adDataSelect\" onchange=\"window.location.href=this.options[selectedIndex].value\"  style=\"width:200px;\" >"	+"\n"+
		"			  <option selected>&gt;&gt;查看其他热门活动</option>"	+"\n"+
		"			</select></td>"	+"\n"+
		"          </tr>"	+"\n"+
		"        </table></td>"	+"\n"+
		"        <td width=\"12\"><img src=\"/home/ad/index/images/top_title_bg_right.gif\" width=\"12\" height=\"43\" /></td>"	+"\n"+
		"      </tr>"	+"\n"+
		"    </table></td>"	+"\n"+
		"    <td width=\"310\" background=\"/home/ad/index/images/top_bg.gif\"><table width=\"303\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">"	+"\n"+
		"      <tr>"	+"\n"+
		"        <td width=\"101\" height=\"21\" style=\"background:url(/home/ad/index/images/btn.gif) no-repeat;padding-left:28px;\"><a href=\"#\" onClick=\"addfavorite();return false;\">收藏此页面</a></td>"	+"\n"+
		"        <td width=\"101\"  style=\"background:url(/home/ad/index/images/btn.gif) no-repeat;padding-left:28px;\"><a href=\"#\" onClick=\"copy(location.href);return false;\">推荐给朋友</a></td>"	+"\n"+
		"        <td width=\"101\" align=\"left\">"	+"\n"+
		"		<span style=\"POSITION: relative;\"><a href=\"#\" onmouseover=\"document.getElementById(\'popup_nav\').style.display=\'block\';\" "	+"\n"+
		"  onmouseout=\"document.getElementById(\'popup_nav\').style.display=\'none\';\">返回到?</a>"	+"\n"+
		"		<DIV id=\"popup_nav\" class=\"popup_nav\" style=\"top:12px;left:-15px;display:none;\" onmouseover=\"document.getElementById(\'popup_nav\').style.display=\'block\';\" onmouseout=\"document.getElementById(\'popup_nav\').style.display=\'none\';\">"	+"\n"+
		"			<table width=\"98\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"	+"\n"+
		"  <tr>"	+"\n"+
		"    <td width=\"94\" height=\"8\"><img src=\"/home/ad/index/images/promotion_hand_13.gif\" /></td>"	+"\n"+
		"  </tr>"	+"\n"+
		"  <tr>"	+"\n"+
		"    <td background=\"/home/ad/index/images/promotion_hand_20.gif\">"	+"\n"+
		"	<ul>"	+"\n"+
            "		<li id=\"nav_index\"><a href=\"http://www.f123.com/\" title=\"中国摄影市场网首页\">首页</a></li>" + "\n" +
            "		<li id=\"nav_product\"><a href=\"http://www.f123.com/search/list/\" title=\"摄影器材,影楼用品，婚庆服务，求职招聘，培训教育\">商品信息</a></li>" + "\n" +
            "		<li id=\"nav_shop\"><a href=\"http://www.f123.com/Search/Shop\" title=\"中国摄影市场网影楼大全\">商铺</a></li>" + "\n" +
            "		<li id=\"nav_new\"><a href=\"http://www.f123.com/News/\" title=\"摄影资讯\">资讯</a></li>" + "\n" +
            "		<li id=\"nav_baike\"><a href=\"http://baike.f123.com/\" title=\"摄影百科\">百科</a></li>" + "\n" +
            "		<li id=\"nav_yp\"><a href=\"http://huangye.f123.com/\" title=\"摄影黄页\">黄页</a></li>" + "\n" +
            "		<li id=\"nav_dh\"><a href=\"http://daohang.f123.com/\" title=\"摄影导航\">导航</a></li>" + "\n" +
            "		<li id=\"nav_help\"><a href=\"http://www.f123.com/Help\" title=\"网站帮助\">帮助</a></li>" + "\n" +
		"		</ul></td>"	+"\n"+
		"  </tr>"	+"\n"+
		"  <tr>"	+"\n"+
		"    <td height=\"3\"><img src=\"/home/ad/index/images/promotion_hand_21.gif\" /></td>"	+"\n"+
		"  </tr>"	+"\n"+
		"</table>"	+"\n"+
		""	+"\n"+
		"		</DIV>"	+"\n"+
		"		</span></td>"	+"\n"+
		"      </tr>"	+"\n"+
		"    </table></td>"	+"\n"+
		"  </tr>"	+"\n"+
		"</table>";



var yahoo =	"<div style=\"display:none;\"><img src=\"http://img.tongji.cn.yahoo.com/613299/ystat.gif\"><img src=\"http://img.tongji.cn.yahoo.com/474003/ystat.gif\"></div>";

topHead += yahoo;




$(document).ready(function(){ 
	var tID = document.getElementsByTagName("script")[1].getAttribute("ztID");
	if(!/\S{2,30}/.test(tID)){
		alert("请引用正确的专题ID");
		return;
	}else{
		//填充样式;
		AddCss();
		//填充导航
		$(document.body).prepend(topHead);			   
		//填充历史专题
		var adDataSelect=document.getElementById("adDataSelect");
		if(adDataSelect){
			for(var id in adData){
				if(id!=tID){
						var oOption = document.createElement("option");
						var oTxt = document.createTextNode(adData[id]["title"]);
						oOption.appendChild(oTxt);
						oOption.value = adData[id]["url"];
						adDataSelect.appendChild(oOption);
				}
			}
		}
		//填充专题标题
		var tDiv=document.getElementById("thisPageTitle");
		if(tDiv){
			tDiv.innerText=adData["20071207"]["title"];
		}	

		//添加yahoo统计
		//$(document.body).append(yahoo);	
	}
});

function AddCss(){
var l=document.createElement("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","http://www.f123.com/home/AD/index/index.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}














function addfavorite()
{
    if (document.all) {
    	window.external.addFavorite(location.href, "F123中国摄影市场网");
    }
    else if (window.sidebar) {
    	window.sidebar.addPanel("F123中国摄影市场网", location.href,"");
    }
}

function copy(meintext) {
  if (window.clipboardData) {
    window.clipboardData.setData("Text", meintext)
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="http://img.alimama.cn/images/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(meintext)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
  }
  alert('地址已经复制到您的剪贴板，您可以发送给您的朋友啦！');
}







