/*

	Class: SSAFrontendProjecten
		Initializes the SSA Projecten frontend page ...more to come
	
	
	Parameters:
		None
		
	Returns:
		Nothing
		
		
	Todo:


*/

function strpos (haystack, needle, offset) {
    var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}

var $j = jQuery.noConflict();

$j(document).ready(function()
{
	var coords = new Array();
	
	$items = [
	    $j("#wrapper .item.small"),
	    $j("#wrapper .item.medium_small"),
	    $j("#wrapper .item.medium_large"),
	    $j("#wrapper .item.large"),
	    $j("#frontend-filters, #frontend-search")
	];
	
	for (var a = 0, z = $items.length; a < z; ++a) {
		for (var b = 0, y = $items[a].length; b < y; ++b) {
			$item = $j($items[a][b]);
			
			var tmp_id = $item.attr('id');
			
			if(strpos(tmp_id, 'proj') === 0 || strpos(tmp_id, 'med') === 0 || strpos(tmp_id, 'logo') === 0) {
				$item.addClass("borderdered");
			}
			var position_height = ($item.offset().top + $item.height());
			coords[position_height] = position_height + 20;
		}
	}
	
	$('wrapper').setStyle({'height':coords.pop()+'px'});
});

