/*
 * firstChild lastChild
*/

$(document).ready(function() {
     $('#left_sidebar ul li:first-child').addClass('firstChild');
	 $('#relatedList ul li:first-child').addClass('firstChild');
	 $('#relatedList ul li:last-child').addClass('lastChild');
/*
     $('a.external').click(function(){
         window.open(this.href);
         return false;
     });
*/
});


/*
 * smartRollover.js
*/

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);
}


/*
 * check_all
*/
    $(function(){
        $(".chk_all").click(function(){
            $('.chkbox').attr('checked', $(this).attr('checked'));
			$('.chk_all').attr('checked', $(this).attr('checked'));
        });
    });


/*
 * input submitRollOver
*/
/***************************************
URI: http://blog.lunatic-code.net/
Description:
Version: 1.0
Author: mick
Author URI: http://blog.lunatic-code.net/
***************************************/

function btnConform(){
	var inputs = document.getElementsByTagName("input");
	for( var i=0,j=inputs.length; i<j; i++){
		var btn = inputs[i];
		if(btn.getAttribute("class") == "input_btn tipped"){
			btn.onmouseover = function(){
				this.style.backgroundPosition = 'left -25px';
				return false;
			}
			btn.onmouseout = function(){
				this.style.backgroundPosition = 'left top';
				return false;
			}
		}
		if(btn.getAttribute("className") == "input_btn tipped"){
			btn.onmouseover = function(){
				this.style.backgroundPosition = 'left -25px';
				return false;
			}
			btn.onmouseout = function(){
				this.style.backgroundPosition = 'left top';
				return false;
			}
		}
	}
}

window.onload = btnConform;

