/* function mycarousel_initCallback(carousel) {
    jQuery('#slideshow ul.navigation li a').bind('click', function() {
    
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        
        jQuery("#slideshow ul.navigation li a").removeClass('active');
        jQuery(this).addClass('active');
        
        return false;
    });

    jQuery('.my-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

jQuery(document).ready(function() {
    jQuery("ul#pics").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null,
        auto: 2,
        wrap: "last"
    });
    
});

*/

function in_array (needle, haystack, argStrict) {
    var key = '', strict = !!argStrict;

    if (strict) {
        for (key in haystack) {
            if (haystack[key] === needle) {
                return true;
            }
        }
    } else {
        for (key in haystack) {
            if (haystack[key] == needle) {
                return true;
            }
        }
    }

    return false;
}

function show_message(message){
    var divMessage = jQuery('<div></div>')
    
    divMessage
        .css({
            'background' : '#ccffcc',
            'color'      : '#000000',
            'padding'    : '3px 10px 3px 10px',
            'z-index'    : 8000,
            'margin'     : '0 auto',
            'position'   : 'fixed',
            'top'        : 30,
            'width'      : '969px',
            'border'     : '4px solid #00cc00',
            'cursor'     : 'pointer',
            '-webkit-border-radius' : '4px',
            '-moz-border-radius'    : '4px',
        })
        .click(function(){
            var el = jQuery(this);
            el.fadeOut(500, function(){
                el.remove();
            })
        })
        .html('<span class="closeMessages"><a href="#">click to dismiss</a></span>\
	           <p></p>\
                <p>'+ message +'</p>')
        .appendTo("#page_container");
    
    
}

function show_message_index(message){
    var divMessage = jQuery('<div></div>')
    
    divMessage
        .css({
            'background' : '#ccffcc',
            'color'      : '#000000',
            'padding'    : '3px 10px 3px 10px',
            'z-index'    : 8000,
            'margin'     : '0 auto',
            'position'   : 'fixed',
            'top'        : 30,
            'width'      : '969px',
            'border'     : '4px solid #00cc00',
            'cursor'     : 'pointer',
            '-webkit-border-radius' : '4px',
            '-moz-border-radius'    : '4px',
        })
        .click(function(){
            var el = jQuery(this);
            el.fadeOut(500, function(){
                el.remove();
            })
        })
        .html('<span class="closeMessages"><a href="#">click to dismiss</a></span>\
	           <p></p>\
                <p>'+ message +'</p>')
        .appendTo("#wrap");
    
    
}


function editPageShow() {
		$('div#customise_editpanel').slideToggle("fast");
		return false;
	}

$(document).ready(function(){

	
	
	//initialize some things
	$(".info").hide();
	$("#register-form").hide();
	$("#forgot-form").hide();
	$('.member-signin').show();
	$("#social-network-box").fadeIn();
	$('.lost-password').show();

	//hide the login.. show the register box
	/*$('.become-member').click(function() {
		$('.member-signin').show();
		$('.become-member').hide();
		$('#home-search').hide();
		$('#login-form').hide();
		$('#forgot-form').hide();
		$('#register-form').fadeIn();
		return false;
	});*/
	//hide the login.. show the forgot password box
	/*$('.lost-password').click(function() {
		$('#login-form').hide(); 
		$('#register-form').hide();
		$('#forgot-form').fadeIn();
		return false;
	});
	//hide the register.. show the login
	$('.member-signin').click(function() {
		$('.member-signin').show();
		$('#forgot-form').hide();
		$('.become-member').hide();
		$('#home-search').fadeIn();
		$('#login-form').fadeIn(); 
		$('#register-form').hide();
		return false;
	});*/
    $('.lost-password').click(function() {
		$('#login-form').hide(); 
		$('#register-form').hide();
		$('#forgot-form').show();
		return false;
	});
    	$('.member-signin').click(function() { 
    	   $('#login-form').show();
		   $('#forgot-form').hide();
           return false;
    	});
	//when click on an app.. show the info and change the style
    $("ul.why li a").click(function() {
    	var thisID = $(this).attr('id')
    	
    	$("ul.why li a").removeClass('isactive');
    	$(this).addClass('isactive');
    	
    	$(".info:visible").hide();
    	
    	$("#"+thisID+"-box").fadeIn();
    	    	
    	return false;
    });  
      
     /*
    //register form stuff
    //when user clicks input.. empty it
    $('input').focus(function() {
    	var whatClass = $(this).attr('class');
    	var theValue = $(this).attr('value');
    	var theAlt = $(this).attr('alt');    	
    		
    	if(whatClass == theValue || theAlt == theValue) {
    	
	    	$(this).val("");
	    	$(this).css({
	    		'color' : '#000'
	    	});
	    }
    });
    //when user clicks outside.. put it back
    $('input').blur(function() {
    	var whatClass = $(this).attr('class');
    	var theValue = $(this).attr('value');
    	var theAlt = $(this).attr('alt'); 
    	
    	if(theValue == "") {
    		if(!theAlt) {
	    		$(this).val(whatClass);
	    	} else {
	    		$(this).val(theAlt);
	    	}
	    	
	    	$(this).css({
	    		'color' : '#D1D1D1'
	    	});
    	}
    });*/
    
    
    
 
	
    
});






























