// Innitiate Main Menu
/*var url = 'http://192.168.0.103/eBrandz/squido/index.php';
var images = 'http://192.168.0.103/eBrandz/squido/images';
var plugins  = 'http://192.168.0.103/eBrandz/squido/layout/plugins/';*/
var url = 'http://www.elistingz.com/index.php';
var images = 'http://www.elistingz.com/images';
var plugins  = 'http://www.elistingz.com/layout/plugins/';
$(document).ready(function() { 
	$('ul#menu').superfish();
        $('#search').focus(function(){
                if ( $(this).attr('value') == 'Search a Listing') {
                        $(this).css('color', '#555');
                        $(this).attr('value', '');
                }
        });
        $('#search').blur(function(){
                if ( $(this).attr('value') == '' ) {
                        $(this).attr('value', 'Search a Listing');
                        $(this).css('color', '#999');
                }
        });
        $('#searchbox').validate();
}); 

//Homepage boxes
function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
$(document).ready(function() {
	equalHeight($(".equalize"));
	equalHeight($(".equalize2"));
});


//News Scroller (Widget)
$(document).ready(function() {
 
 	$('.news-scroller').cycle({ 
	    fx: 'scrollVert',
		speed: 1000,
		rev: true,
		timeout: 4000,
		next: '.news-next', 
	    prev: '.news-previous'
	 });      
 
});

//Innititate Pretty Photo
$(document).ready(function(){
	$("a[rel^='lightbox']").prettyPhoto({theme:'light_rounded'});
});


//Portfolio thumbnail
$(document).ready(function(){

	$('.portfolio-box a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});

function ajax(id, type, loc, data, datatype){
                $.ajax({
				type: type,
				url: url + loc,
				data: data,
                                dataType: datatype,
                                beforeSend: function(){
                                    $(id).html('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;').addClass('busy');
                                },
                                success: function(data){
                                    $(id).removeClass().html(data);
                                }
			});
}

//Cufon text
Cufon.replace('h2, h3');


