﻿2// YinzCN at_Gmail.com
// PHPnow.org
// 使用 Notepad++ 编辑


function loadjs(js){document.write('<script type="text/javascript" src="' + js + '"></'+'script>');}
loadjs('/jquery-1.2.6.min.js');


var latest_v = "1.5.6";


// 简化函数
function w(s){document.write(s+"\n");}


var kw = ['广告','我要找工作','PHPnow','MySQL','空间','hosting','MySQL','asp','ajax','java','AdSense','Linux','外包','找工作','虚拟主机管理系统','虚拟主机','主机','虚拟'];


// Links
function Links(){
  $(document).ready(function(){
    ready();
  });
  w('<a href="index.html">首页</a>');
  w('| <a href="download.html">下载</a>');
  w('| <a href="docs.html">文档</a>');
  w('| <a href="http://forum.phpnow.org"><span style="color: #ee0000;">论坛</span></a>');
  w('| <a href="links.html">资源</a>');
  w('| <a href="about.html">关于</a>');
}


function showNews(){

  function news(title, body){
    this.title = title;
    this.body = body;
  }

  var News = [];
  var i = 0;

  News[i++] = new news('2009-06-11', '<span style="color:#ee0000;">PHPnow-1.5.4.zip</span><br />\
  MD5:<br />0822518c00571f3d+<br />c3996765dd0a9acf');

  for(var i in News) {
    w('<div class="news">');
    w('<span>'+News[i].title+'</span><br />');
    w('<div class="div_1">');
    w(News[i].body);
    w('</div>');
    w('<br />');
    w('</div>');
  }
}


// 显示右则栏
function Right(){
w('<form method="get" action="http://www.google.com/custom"><div>');
w('<img src="http://www.google.com/logos/Logo_25wht.gif" alt="Google" /><br />');
w('<input type="hidden" name="domains" value="PHPnow.org" />');
w('<label for="sbi" style="display: none">Enter your search terms</label>');
w('<input type="text" name="q" size="28" maxlength="255" value="'+kw[Math.round(Math.random()*(kw.length-1))]+'" id="sbi" />');

w('<div style="padding : 5px 0px 5px 0px;">');
w('<input type="radio" name="sitesearch" value="" checked="checked" id="ss0" />');
w('<label for="ss0" title="Search the Web">Web</label>');
w('<input type="radio" name="sitesearch" value="PHPnow.org" id="ss1" />');
w('<label for="ss1" title="Search PHPnow.org">PHPnow.org</label>');
w('<label for="sbb" style="display: none">Submit search form</label>');
w('</div>');

w('<input type="submit" name="sa" value="Google 搜索" id="sbb" />');
w('<input type="hidden" name="client" value="pub-7697793590906217" />');
w('<input type="hidden" name="forid" value="1" />');
w('<input type="hidden" name="ie" value="UTF-8" />');
w('<input type="hidden" name="oe" value="UTF-8" />');
w('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1" />');
w('<input type="hidden" name="hl" value="zh-cn" />');
w('</div></form>');

w('<br />');

w('<b><span style="color: #008000;">Download / 快速下载</span></b>');
w('<div class="line_2"></div>');
w('最新版本:<br />');
w('PHPnow '+latest_v+' 发布！<br />');
w('<a href="http://downloads.sourceforge.net/phpnow/PHPnow-'+latest_v+'.zip">PHPnow-'+latest_v+'.zip</a><br />');
w('<a href="download.html">更多...</a><br />');

w('<br />');
w('<br />');

w('<b><span style="color: #008000;">News \\ 最新布告</span></b>');
w('<div class="line_2"></div>');


showNews();


w('<br />');

w('<b><span style="color: #008000;">Thanks / 感谢</span></b>');
w('<div class="line_2"></div>');
w('<a href="http://www.kcvg.cn/">可惜危机</a> <span style="color : #888888;">(合作伙伴)</span><br />');
w('<a href="http://emlog.net/">emlog 博客</a> <span style="color : #888888;"></span><br />');
w('<a href="http://www.freedomedu.cn/">自由教程网</a> <span style="color : #888888;"></span><br />');
w('...');
w('<br />');

w('<br />');
w('<br />');

w('<b><span style="color: #008000;">Contact \\ 联系</span></b>');
w('<div class="line_2"></div>');
w('<a href="mailto:YinzCN#Gmail.com"><img src="images/mail.png" alt="" /></a><br />');
w('<br />');
w('QQ群 : 50011039 (D 组)<br />');
w('<a href="http://forum.phpnow.org"><span style="color: #ee0000;">PHPnow 论坛</span></a><br />');
w('[ <a href="http://www.discuz.net/thread-542115-1-1.html">在 Discuz 回复提交帖子</a> ]<br />');
w('[ <a href="http://www.phpchina.com/bbs/thread-31055-1-1.html">在 PHPChina 上的帖子</a> ]<br />');

w('<br />');
w('<br />');

w('<b><span style="color: #008000;">Standard / 遵循 W3C 标准</span></b>');
w('<div class="line_2"></div>');
w('<a href="http://validator.w3.org/check?uri=referer"><img');
w('    style="width:88px;height:31px"');
w('    src="images/valid-xhtml10-blue.png"');
w('    alt="Valid XHTML 1.0 Transitional" /></a>');
w('<br />');
w('<br />');
w('<a href="http://jigsaw.w3.org/css-validator/check/referer"><img');
w('    style="width:88px;height:31px"');
w('    src="images/valid-css.png"');
w('    alt="Valid CSS!" /></a>');
}


// 显示单个 Logo
function logo(u, img, alt){
w('<a href="'+u+'"><img');
w('src="images/'+img+'"');
w('alt="'+alt+'" /></a>');
}


// 全部 Logo
function Logos(){
logo('http://www.caiganinfo.com/','logo_caigan.gif','菜杆资讯园，是一个以提供会员最新软件资讯、下载为主体，兼容其它特色栏目的综合性交流论坛！');
logo('http://gophp5.org','goPHP5-080x26.png','Support GoPHP5.org');
logo('http://www.php.net','btn_php.gif','Powered by PHP');
logo('http://www.mysql.com','powered-by-mysql-88x31.png','Powered by MySQL');
logo('http://www.7-zip.org/zh-cn/','7zlogo01.png','7-Zip 简体中文');
logo('http://notepad-plus.sourceforge.net/','npp_logo.png','Powered by Notepad++');
}


// 广告代码
function GG_AD(slot){
w('<script type="text/javascript">');
w('google_ad_client = "pub-7697793590906217";');
w('google_ad_slot = "'+slot+'";');
w('google_ad_width = 468;');
w('google_ad_height = 60;');
w('</script>');
w('<script type="text/javascript"');
w('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
w('</script>');
}


// 广告代码
function AD_t(){
w('<script type="text/JavaScript">');
w('var alimama_pid="mm_10068823_157647_177894";');
w('var alimama_titlecolor="96c02e";');
w('var alimama_descolor ="000000";');
w('var alimama_bgcolor="FFFFFF";');
w('var alimama_bordercolor="E6E6E6";');
w('var alimama_linkcolor="008000";');
w('var alimama_sizecode="12";');
w('var alimama_width=468;');
w('var alimama_height=60;');
w('var alimama_type=2;');
w('</script>');
w('<script src="http://p.alimama.com/inf.js" type="text/javascript"></script>');
}


// 广告代码
function AD_1(){
GG_AD("2123828084");
}


// 广告代码
function AD_b(){
w('<script type="text/JavaScript">');
w('var alimama_pid="mm_10068823_157647_181821";');
w('var alimama_titlecolor="96c02e";');
w('var alimama_descolor ="000000";');
w('var alimama_bgcolor="FFFFFF";');
w('var alimama_bordercolor="E6E6E6";');
w('var alimama_linkcolor="008000";');
w('var alimama_sizecode="12";');
w('var alimama_width=468;');
w('var alimama_height=62;');
w('var alimama_type=2;');
w('</script>');
w('<script src="http://p.alimama.com/inf.js" type=text/javascript>');
w('</script>');
}


function ready(){
  $('.bottom_r b').click(function(){debug();});
}

function debug(){
  if(!$('#js_info').length) $('<div id="js_info">debug mode</div>').prependTo('.bottom_r');
  debug_update();
}

function debug_update(){
  var o = document.getElementsByTagName('head');
  $('#js_info').html(o_dump(o[0]));
}

function o_dump(obj){ 
  var strT = '';  
  //if(!obj) return false;  
  //if(!obj.length) return false;  
  for(var i in obj)
  {  
     if(typeof(obj[i]) == "function") strT = strT.concat('<br />'+obj[i]);
     else strT = strT.concat('<br />'+typeof(obj[i])+': '+i+' = '+obj[i]);
  }  
  return strT;   
}

