jQuery(document).ready(function($) {
	
DD_roundies.addRule('.posts_outer', 10, true);
DD_roundies.addRule('.primary #tabs', 10, true);		
DD_roundies.addRule('.paginator strong', 5, true);			
DD_roundies.addRule('.uluvpop', 5, true);	
DD_roundies.addRule('.post-category a', 5, true);	
DD_roundies.addRule('.catList li a', 5, true);	
		
						
function setupcolor() {
	//$("#postlink, .uluv, .uluvpop").colorbox({width:"430px", overlayClose:false, height:"80%", inline:false, iframe:true, href:"http://weluv.it/simple-login/", opacity:0.4});


	$(".editprofile").colorbox({width:"430px", overlayClose:false, height:"80%", inline:false, iframe:true, href:"http://weluv.it/profile/", opacity:0});

	$(".sociable a, .registernow, .editprofile, .friend-notice a").colorbox({width:"430px", height:"80%", inline:false, iframe:true, opacity:0.4});
	
	$("a.addguide, .allusers").colorbox({width:"300px", overlayClose:false, height:"80%", inline:false, iframe:true, opacity:0.4});

	$("a.imggal").colorbox({transition:"fade", height:"80%", opacity:0.4});

				
	$(".uploadpop").colorbox({width:"35%", height:"45%", inline:false, opacity:0.4, iframe:true, href:"http://weluv.it/upload/?gallery_id=<?php echo $gal; ?>"});
				 
	$('.sz-youtube-list ul li div a').colorbox({width:"600px", height:"75%", iframe:true, opacity:0.4});
	$('.twtr-widget a').colorbox({width:"75%", height:"75%", iframe:true, opacity:0.4});
	
	$('.mapshow, #bookbt').colorbox({width:"75%", height:"85%", opacity:0.4, iframe:true});
		$('.mapshow, #bookbt').colorbox({width:"90%", height:"85%", opacity:0.4, iframe:true});

	

	
}
	

function slideshow(x){
		$('#nav').html('images');
	$(x).cycle({ 
    			fx:     'fade', 
				speed:   1000,
    			timeout: 6000,
				cleartype:  1,
				fit: 1,
				    pager:      '#nav', 
    pagerEvent: 'mouseover',
    pauseOnPagerHover: true 
    			
				});
	
	}
function loadAjax(){
	$("#paginator a").click(function(){
		$('#loadc').hide();
		$('#loadc').html("<img src='http://weluv.it/wp-content/themes/weluv/images/ajax-loader.gif' alt='close' />");
		$('#loadc').fadeIn();
		$('#main').fadeOut(function(){
			$('#main').html("");
			
			});
		u = $(this).attr('href');
		
		// take Domain out
			baseU = u.slice(16)

		$('#content .col-left').load(u + " #content .col-left", function(response, status, xhr) {
			  if (status == "error") {
					var msg = "Sorry but there was an error: ";
					//e.parent().parent().after("<div id='error'>");
				//	$("#error").html(msg + xhr.status + " " + xhr.statusText);
				//alert(u)
				alert(msg + xhr.status + " " + xhr.statusText);
					//window.location= u;
			  }else{
					//Cufon.replace('h2', { fontFamily: 'Helvetica Rounded' });

				  	$('#loadc').fadeOut();
					$('#main').fadeIn();
				  
				  }
		
		})
		return false;
	})
	
}
setupcolor();
loadAjax()
slideshow('#slideshow')
//$('#addPlace').iframeAutoHeight({heightOffset: 40});
$('.scroll_bar').hover(function () {
     
    }, function () {
     loadAjax()
    });


})

