﻿// JScript 文件
                  

function SetCookie(name,value){
//写cookies
    expires=new Date();
    expires.setTime(expires.getTime()+(86400*365));
    document.cookie=name+"="+value+"; expires="+expires.toGMTString()+"; path=/";
}


function getCookie(Name) {
//获取cookies
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         end = document.cookie.indexOf(";", offset) 
         if (end == -1) 
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      } 
   }
   return 1;
}


function deletecookie(cName){
//删除cookies
        var   d   =   new   Date(2000,1,1); 
		document.cookie=cName+"=; expires="+d.toGMTString()+"; path=/";
} 

function fEvent(sType,oInput,oInputValue){
		switch (sType){
			case "focus" :
				oInput.isfocus = true;
				oInput.style.backgroundColor='#FFFFD8';
				if(oInput.value == oInputValue)
				{
				    oInput.value = "";
				}
				
			case "mouseover" :
				oInput.style.borderColor = '#99E300';
				break;
			case "blur" :
				oInput.isfocus = false;
				oInput.style.backgroundColor="";
				if(oInput.value == "")
				{
				    oInput.value = oInputValue;
				}
			case "mouseout" :
				if(!oInput.isfocus){
					oInput.style.borderColor='#A1BCA3';
				}
				break;
		}
	}
	
	
	
function bookmark(){
    var title=document.title
    var url=document.location.href
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if( window.opera && window.print ){
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();}
    else if( document.all ) window.external.AddFavorite( url, title);
}