<?php
/**
 * @version        Somao_Search X1.0 9:23 2012-1-1 Somao $
 * @package        Somao_Search.Site
 * @copyright      Copyright (c) 2009 - 2012, Somao, Inc.
 * @license        http://www.somao123.com/
 * @link           http://www.somao.cc/
**/
require "global.php";
$rst=$db->get_one("select * from ve123_skin");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>搜猫皮肤设置</title>
<style type="text/css">
.themes{border:1px solid #000;}
#dixia {
	FONT-SIZE: 1.2em; MARGIN: 20em auto; WIDTH: 32em; TEXT-ALIGN: center
}
a:link {
	color: #0066FF;
}
a:visited {
	color: #0065FF;
}
a:hover {
	color: #FF3300;
}
a:active {
	color: #FF3000;
}
#Sright {padding-LEFT:10px;}
</style>
<SCRIPT type=text/javascript>
// JavaScript Document
<!--
var arrCSS=[<?php
	   $dir="templates";
       $dp = opendir($dir);
	   $aryRaw = array();
       while ($file = readdir($dp)) { 
	   $arrPath = explode ( ".",$file );
       $strPath = array_pop( $arrPath );
	   
               if ($file!='.' && $file!='..') {
				   $i++ ;
                   array_push( $aryRaw , $file);
                   $path = $dir ."/". $file;
                   if (is_dir($path)) {
  ?>
  ["<img src='/templates/<?php echo $file;?>/bg.jpg' width='160' height='80' class='themes' alt='搜猫皮肤'>","/templates/<?php echo $file;?>/css.css"],
  <?php
             }
          }  
       }
    closedir($dp);
  ?>""];
writeCookie("arrCSS",arrCSS);
// *** function to replace href="/" ***
function v(){
	return;
}
// *** Cookies ***
function writeCookie(name, value) { 
	exp = new Date(); 
	exp.setTime(exp.getTime() + (86400 * 1000 * 30));
	document.cookie = name + "=" + escape(value) + "; expires=" + exp.toGMTString() + "; path=/"; 
} 
function readCookie(name) { 
	var search; 
	search = name + "="; 
	offset = document.cookie.indexOf(search); 
	if (offset != -1) { 
		offset += search.length; 
		end = document.cookie.indexOf(";", offset); 
		if (end == -1){
			end = document.cookie.length;
		}
		return unescape(document.cookie.substring(offset, end)); 
	}else{
		return "";
	}
}
////////////////////////////////////
// StyleSheet
////////////////////////////////////
function writeCSS(){
  for(var i=1;i<arrCSS.length;i++){
    document.write('<link title="'+arrCSS[i][1]+'" href="'+arrCSS[i][1]+'" rel="stylesheet" disabled="true" type="text/css" />');
  }
    setStyleSheet(readCookie("stylesheet"));
}
function writeCSSLinks(){
  for(var i=0;i<arrCSS.length-1;i++){
    if(i>0) document.write('  ');
    document.write('<a href="javascript:v(/)" onclick="setStyleSheet(\''+arrCSS[i][1]+'\')">'+arrCSS[i][0]+'</a>');

  }
}
function setStyleSheet(strCSS){
  //alert(strCSS)
  var objs=document.getElementsByTagName("link");
  var intFound=0;
  for(var i=0;i<objs.length;i++){
    if(objs[i].type.indexOf("css")>-1&&objs[i].title){
      objs[i].disabled = true;
      if(objs[i].title==strCSS) intFound=i;
    }
  }
  objs[intFound].disabled = false;
  writeCookie("stylesheet",objs[intFound].title);
  
}
writeCSS();
setStyleSheet(readCookie("stylesheet"));

//-->
</SCRIPT>
<script language="JavaScript">
function killErrors() {
return true;
}
window.onerror = killErrors;
</script>
</head>
<body><a href="../"><span class="fumin_msg STYLE3" style="float:right;padding-right:10px;padding-top:2px">返回首页</a></span>
<div class="topNav"></div>
<div class="blank4"></div>
<div class="skin">
     点击这里皮肤设置选项 
      <div id="Sright">
         <script type="text/javascript">writeCSSLinks();</script>
     </div>
</div>
<div class="blank4"></div>
<div class="newsbody">
     <div class="coleft">
          <div class="clear"></div>
     </div>
     <div class="cocenter">
	      <div class="cconter"></div>    
     <div class="clear"></div>
     </div>
     <div class="coright">
          <div class="clear"></div>
     </div>
<div class="clear"></div>     
</div>
<div class="blank4"></div>
<div class="footer"></div>
<DIV id=dixia><A 
href="../">搜猫搜索默认首页</A> - <A 
href="/">返回首页</A></DIV>
</DIV>
</body>
</html>