$(document).ready(function(){


$('#belt-box').append('<li id="top-searchform"><form method="get" action="http://www.mland-cms.net/mt/mt-search.cgi"><input title="サイト内検索" type="text" id="search" class="ti" name="search" value="" /><input type="hidden" name="IncludeBlogs" value="1" /><input type="hidden" name="limit" value="20" /><input type="submit" accesskey="4" id="search-btn" value="検索" /></form></li>');

$('#search')
    .blur(function(){
      var $$=$(this);
      if($$.val()=='' || $$.val()==$$.attr('title')){
        $$.css('color', '#999')
          .val($$.attr('title'));
      }
    })
    .focus(function(){
      var $$=$(this);
      if($$.val()==$$.attr('title')){
        $(this).css('color', '#000')
               .val('');
      }
    })
    .parents('form:first').submit(function(){
      var $$=$('#search');
      if($$.val()==$$.attr('title')){
        $$.triggerHandler('focus');
      }
    }).end()
    .blur();
var Newwin = function(){

	this.blank = function(){
		if(!document.getElementsByTagName){
			return;
		}

		var cnt;
		var anchors	= document.getElementsByTagName("a");
		var anchor;

		cnt = anchors.length;
		for(var y = 0; y < cnt; y++){
			anchor = anchors[y];
			if(
			anchor.getAttribute("href")&&
			!anchor.getAttribute("target")&&
			anchor.getAttribute("href",2).indexOf("http://www.mland-cms.net/",0) == -1&&
			anchor.getAttribute("href",2).indexOf("http://",0)>-1)

 {
				anchor.target = "_blank";
			}
		}
	}
}
window.onload = new Newwin().blank;

});
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


function addBookmark(title,url) { 
    if (window.sidebar) { 
        window.sidebar.addPanel(title, url,""); 
    } else if( document.all ) { 
        window.external.AddFavorite( url, title); 
    } else if( window.opera && window.print ) { 
        return true; 
    } 
}

