
/**
 * @author mshresth
 */

function general_init(){
	var buckets = document.getElementsByTagName('div');
	var newEl = document.createElement('div');
	for (i = 0; i < buckets.length; i++) {
		if (buckets[i].className == 'bucket') {
			el = buckets[i];
			var pCount = 0;
			
			for(j = 0; j < el.childNodes.length; j++){
				newEl.appendChild(el.childNodes[j]);
				if (el.childNodes[j].tagName =='p'){
					pCount++;
				}
				if (pCount > 2){
					el.childNodes[j].innerHTML='';	
				}
				alert(pCount);
				
			}
			//buckets[i].appendChild(newEl);
			
		}
	}
}
function changeText(doc){
	if (doc.innerHTML == '+ Read More'){
		doc.innerHTML = '- Collapse';
	}else {
		doc.innerHTML = '+ Read More';
	}
}
function moveTo(container, element){
  Position.prepare();
  container_y = Position.cumulativeOffset($(container))[1]
  element_y = Position.cumulativeOffset($(element))[1]
  new Effect.Scroll(container, {x:0, y:(element_y-container_y)});
  return false;
}
function scrollDown(id){
	if (id == 'Agency Facts'){
		document.getElementById('footer').style.paddingBottom = '800px';	
	}
	else if (id == 'Clients'){
		document.getElementById('footer').style.paddingBottom = '400px';	
	}
	else {
		document.getElementById('footer').style.paddingBottom = '5px';	
	}
	
	
	new Effect.ScrollTo(id);
	
}
