$(function(){
	// add images to "h2 tags"
	$('h2').append('<img src="imgs/icon.png" alt=""/>');
	// add rounded corners
	$('div.rounded').append('<div class="c-tl"><\/div><div class="c-tr"><\/div><div class="c-bl"><\/div><div class="c-br"><\/div>');
});

/*
Clear default form value script- By Ada Shimar (ada@chalktv.com)
*/

function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
		thefield.value = ""
} 

/************
*Function:		addClass
*Description: 	adds a class to the specified element.
*Args:
*	(HTML Element)ele: the element to add the specific class to.
*	(string)clss: the name of the class to add.
************/
function addClass(ele,clss){
	if(!ele.className.match(new RegExp("\\b ?"+clss+"\\b")))
		ele.className += ' '+clss;
}

/************
*Function:		removeClass
*Description: 	removes a class from the specified element.
*Args:
*	(HTML Element)ele: the element to add the specific class to.
*	(string)clss: the name of the class to remove.
************/
function removeClass(ele,clss){
	ele.className = ele.className.replace(new RegExp("\\b ?"+clss+"\\b"),"");
}
var lastActive = null;
function clicked(clickedOn){
	//remove the class from the last one clicked.
	if(lastActive) removeClass(lastActive, 'active');
	//add the class to the one clicked.
	addClass(clickedOn, 'active');
	//set lastActive to the current clicked
	lastActive = clickedOn;
}
