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

function toggleClass2(eventObject) {
	if (element.hasClass('active')) {
		alert('active');
		$(this).removeClass('active');
	}
	else {
		alert('inactive');
		element.addClass('active');
	}		
}
var projects = Array();
$(window).load(function() {
	
	$('.project').each(function(i) {
		projects[i] = i;
		var activeItem = i
	    $(this).hover(
	      function () {
	        $(this).toggleClass('hover');
	      }, 
	      function () {
	        $(this).toggleClass('hover');
	      }
	    );
	    $(this).click(
	    	function() {
	    		$(this).addClass('active');
	    		$(this).find('.info').slideDown("fast");
	    		for (j=0;j<projects.length;j++) {
	    			
	    			if (j != activeItem) {
	    				$('#project' + (j+1)).find('.info').slideUp("fast");
	    				$('#project' + (j+1)).removeClass('active');
	    			}
	    		}	
	    	}
	    );
	});
	$('.project .more').each(function(i, item) {
		var id = '#' + $(item).attr('id').replace('_more', '');
	    $(this).hover(
	  	      function () {
	  	        $(id).toggleClass('activehover');
	  	      }, 
	  	      function () {
	  	        $(id).toggleClass('activehover');
	  	      }
	  	 );		
	}); 
});





function getQueryString(qArray) {
    var temp = "";
    $.each(qArray, function(index, item) {
        if (item != undefined) {
            if (temp != "") {
                temp += ':';
            }
            temp += item;
        }
    });      
    return temp;        
}







