var isMSIE=(/MSIE/i.test(navigator.userAgent))?true:false;

var imgTrans = 'GIF89a\1\0\1\0\200[...]\1\0;'; // A transparent GIF for IE

function moveBG (elementID, moveX, moveY) {
	document.getElementById(elementID).style.backgroundPosition=  " " + moveY + "px " + moveX + "px ";
}

function getStyleClass (className) {
//getStyleClass('first').style.backgroundColor = 'yellow';
	for (var s = 0; s < document.styleSheets.length; s++) {
		if(document.styleSheets[s].rules) {
			for (var r = 0; r < document.styleSheets[s].rules.length; r++) {
				if (document.styleSheets[s].rules[r].selectorText == '.' + className) {
					return document.styleSheets[s].rules[r];
				}
			}
		} else if (document.styleSheets[s].cssRules) {
			for (var r = 0; r < document.styleSheets[s].cssRules.length; r++) {
				if (document.styleSheets[s].cssRules[r].selectorText == '.' + className)
					return document.styleSheets[s].cssRules[r];
			}
		}
	}
	return null; // not an acceptable return
}

function toggleOpen (classToToggle) {
	//$("dl#catagories dd").css({display:"none"}); // jQuery selector to hide the others
	$("dl#catagories dd").slideUp("fast"); // jQuery selector to hide the others
	$("dl#catagories dd."+classToToggle).slideDown("fast");
	
// 	var theItem = getStyleClass(classToToggle);
// 	if (theItem.style.display == "none") {
// 		theItem.style.display = "block";
// 	} else {
// 		theItem.style.display = "none";
// 	}
}


function isdefined (variable) {
    return ((typeof(variable) == "undefined")?false:true);
}

//$("div.contentToChange p.firstparagraph:hidden").slideDown("slow");
//$("div.contentToChange p.firstparagraph:visible").slideUp("slow");

//$("#myID\\.entry\\[1\\]").css("border","3px solid red")

$(function(){
    $('input').keydown(function(e){
        if (e.keyCode == 13) {
            $(this).parents('form').submit();
            return false;
        }
    });
});

