var dp_extramodules = [];
var dp_alsointerested = [];


window.addEvent('domready', function() {
	var footerProducts = $('footer-content-right').children;
	if (footerProducts){
	for(var i=0; i<footerProducts.length; i++){ 
		var className = footerProducts[i].className;
		if (className.indexOf('websites')>=0){
			footerProducts[i].style.height = $('footer-content-right').offsetHeight+'px';
		}
	}
	}
		
	/*temp solution*/
	/*var children = document.getElementsByClassName('website-form');
	if (children){
		for (var c=0; c<children.length; c++){
			if (children[c].offsetHeight<180){
				children[c].style.height = 180+'px';
			} 	
		}
	}*/
})

function addAlsoInterested(checkbox, id, title){ 
	var c=0;
	var found=0;
	var objlength = dp_alsointerested.length;
	if(checkbox.checked==true){ 
		for(c=0; c<objlength; c++){
			if (dp_alsointerested[c]['id']==id){
				found = 1;
			}
		}
		if (!found){ 
			dp_alsointerested[objlength] = ['id','title'];
			dp_alsointerested[objlength]['id'] = id;
			dp_alsointerested[objlength]['title'] = title;
		}
	}else {  
		for(c=0; c<objlength; c++){
			if (dp_alsointerested[c]['id']==id){
				found = 1;
				break
			}
		}
		if (found){
			dp_alsointerested.splice(c, 1);
		}
	}	
	return true;
}


function addExtraModules(checkbox, id, title){   
	var c=0;
	var found=0;
	var objlength = dp_extramodules.length;
	if(checkbox.checked==true){ 
		for(c=0; c<objlength; c++){
			if (dp_extramodules[c]['id']==id){
				found = 1;
			}
		}
		if (!found){ 
			dp_extramodules[objlength] = ['id','title'];
			dp_extramodules[objlength]['id'] = id;
			dp_extramodules[objlength]['title'] = title;
		}
	}else {  
		for(c=0; c<objlength; c++){
			if (dp_extramodules[c]['id']==id){
				found = 1;
				break
			}
		}
		if (found){
			dp_extramodules.splice(c, 1);
		}
	}	
	return true;
}



function selectionHTML(){  
	if ($('alsointerested_selection')){
		$('alsointerested_selection').innerHTML = '';
		var lg = ((dp_alsointerested.length)*1)-1;		
		for(var c=lg; c>=0; c--){  
			if (dp_alsointerested[c]['title']){
				$('alsointerested_selection').innerHTML += '<li>'+dp_alsointerested[c]['title']+'</li>';
			}
		}
	}
	
	if ($('extramodules_selection')){ 
		$('extramodules_selection').innerHTML = '';
		var lg = ((dp_extramodules.length)*1)-1;		
		for(var c=lg; c>=0; c--){  
			if (dp_extramodules[c]['title']){
				$('extramodules_selection').innerHTML += '<li>'+dp_extramodules[c]['title']+'</li>';
			}
		}
	}
}



