



$(document).ready(function(){
    var albumphoto		=	$("img.albumphoto").attr('src');
   $("img.albumphoto").mousedown(function(event) {
        switch (event.which) {
            case 1:
                return false;
            break;
            case 2:
                return false;
            break;
            case 3:
			$.post('scr/inc/albumphoto.php',{albumphoto:albumphoto});                
            break;
            default:
                return false;
        }

    });
});


    
            
            
            
            




(function($) {
	$.extend({ 
		uiLock: function(content){
			if(content=='undefined') content		=	'';
			$('<div></div>').attr('id', 'uiLockId').css({
				'position': 'absolute',
				'top': 0,
				'left': 0,
				'z-index': 1000,
				'opacity': 0.0,
				'width':'100%',
				'height':'100%',
				'color':'white',
				'background-color':'black'
			}).html(content).appendTo('body');
		},
		uiUnlock: function(){
			$('#uiLockId').remove();
		}
	});
})(jQuery);
$(document).ready(function() {
    $('input[type=submit]').click(function(){
        //$.uiLock('some html and <a href="#" onclick="$.uiUnlock();">unlock</a>');
        $.uiLock('&nbsp;');
    });
});










/* go to url */
function buttonsgo(val){
	window.location		=	val;
}

$(document).ready(function(){
    $("a.externlink").attr('target', '_blank');
	//$("input").attr('autocomplete', 'off');
}); 

/* delete confirmation */
function deleteConfirm(val){
	var answer		=	confirm(val)
	if (answer){
		return true;
	}
	else{
		return false;
	};
}

/******************************/
$(document).ready(function() {
    $("a.fancyboxImage").fancybox({
        'overlayOpacity'	:	0.8,
        'overlayColor'		:	'#000',
        'zoomSpeedIn'		:	500,
        'zoomSpeedOut'		:	500,
        'type'				:	'image'
    });
});
$(document).ready(function() {
	$("a.fancyboxGooglemap").fancybox({
		'overlayOpacity'	:	0.8,
		'overlayColor'		:	'#000',
		'zoomSpeedIn'		:	500,
		'zoomSpeedOut'		:	500,
        
		'autoScale'			:	'false',
        'hideOnContentClick':	false,
        'width'				:	600,
        'height'			:	600,
        'type'				:	'iframe'
	});
});
$(document).ready(function() {
    $("a.fancyboxiframe").fancybox({
        'overlayOpacity'	:	0.8,
        'overlayColor'		:	'#000',
        'zoomSpeedIn'		:	300, 
        'zoomSpeedOut'		:	300,
        
		'autoScale'			:	'false',
        'hideOnContentClick':	false,
        'width'				:	800,
        'height'			:	500,
        'type'				:	'iframe'
    });
});
/**************** CHANGE STYLES ****************/
function changestyle(val){
	$(document).ready(function() {
			$("link[rel=stylesheet]").attr({href : "scr/css/"+val+".php"});
			//$('#changestyles').fadeOut("slow").load('dynphotos.php').fadeIn("slow");
			//$('#changestyle').load('scr/inc/changestyle.php');
			$.post(
				'scr/inc/changestyle.php',
				{selected_style:val},
				function(data){ $("#changestyle_back").html( data ); }
			);
	});
}
/**************** CHANGE ONLINE-STATUS ********/
function onlinestatus(val){
	$(document).ready(function() {
			$.post(
				'scr/inc/onlinestatus.php',
				{selected_status:val},
				function(data){ $("#onlinestatus").html( data ); }
			);
			togglediv('onlinestatus_links');
	});
}



/**************** TOGGLE DIVS ****************/
function togglediv(val){
	//$('#'+val).toggle('slow');
	$(document).ready(function() {
		if ($('#'+val).is(":hidden")){
			$('#'+val).slideDown("normal");
			$('#'+val+'_img').attr({src : "scr/img/ico/chevron.png"});
		} 
		else {
			$('#'+val).slideUp("normal");
			$('#'+val+'_img').attr({src : "scr/img/ico/chevron-expand.png"});
		}
	});
}
function toggledivfast(val){
	//$('#'+val).toggle('slow');
	$(document).ready(function() {
		if ($('#'+val).is(":hidden")){
			$('#'+val).show();
			$('#'+val+'_img').attr({src : "scr/img/ico/chevron.png"});
		} 
		else {
			$('#'+val).hide();
			$('#'+val+'_img').attr({src : "scr/img/ico/chevron-expand.png"});
		}
	});
}
function hidediv(val){
	$(document).ready(function() {
		if ($('#'+val).is(":visible")){
			$('#'+val).slideUp();
		}
	});
}
function showdiv(val){
	$(document).ready(function() {
		if ($('#'+val).is(":hidden")){
			$('#'+val).slideDown();
		} 
	});
}






function highlight(field) {
	field.focus();
  	field.select();
}



/************** Characters Counter - Limit *********/
function limitChars(textid, limit, infodiv){
	var text		=	$('#'+textid).val();	
	var textlength		=	text.length;
	if(textlength > limit){
		//$('#' + infodiv).html('You cannot write more then '+limit+' characters!');
		$('#' + infodiv).html(((limit - textlength)+1));
		$('#'+textid).val(text.substr(0,limit));return false;
	}
	else{
		//$('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.');return true;
		$('#' + infodiv).html((limit - textlength));return true;
	}
}
