this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		//this.t = this.title;
		this.t = 'Click to enlarge';		
		//this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		//this.title = this.t;		
		this.t = 'Click to enlarge';		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};





this.tooltip2 = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip2").hover(function(e){											  
		//this.t = this.title;
		this.t = 'Click for more information';		
		//this.title = "";									  
		$("body").append("<p id='tooltip2'>"+ this.t +"</p>");
		$("#tooltip2")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		//this.title = this.t;		
		this.t = 'Click for more information';		
		$("#tooltip2").remove();
    });	
	$("a.tooltip2").mousemove(function(e){
		$("#tooltip2")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};






$(document).ready(function(){	

tooltip();
tooltip2();

$('.default-value').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});

$('#tab1').css({color:'#ffffff'});
$('#tab1').css({'background-color':'#009'});

$('#tab1').click( function() {	

$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$('.TabbedPanelsContent').hide();
$('#pane1').show();
$('#dpane1').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});

$('#tab2').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane2').show();
$('#dpane2').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});

$('#tab3').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane3').show();
$('#dpane3').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});

$('#tab4').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane4').show();
$('#dpane4').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});

$('#tab5').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane5').show();
$('#dpane5').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});

$('#tab6').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane6').show();
$('#dpane6').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});

$('#tab7').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane7').show();
$('#dpane7').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});


$('#tab8').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane8').show();
$('#dpane8').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});


$('#tab9').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane9').show();
$('#dpane9').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});



$('#tab10').click( function() {	
//if (iexp = 1) {window.location.href = str+'&ieshow=prod'};
//window.location.href = window.location.href;
$(".imageshow").hide();
$(".showtext").hide();
$(".showarray").hide();

$('.TabbedPanelsContent').hide();
$('#pane10').show();
$('#dpane10').show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$(this).css({color:'#ffffff'});
$(this).css({'background-color':'#009'});
});





$("a[rel=imagegroup]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
});






$(".showpic").click(function() {

//$(".Scrollbar-Down").hide();
$(".imageshow").show();
$(".showtext").hide();
$(".showarray").hide();

//$(".hidepic").show();

var thelink = $(this);
//alert ( thelink.attr('rel') );

var x = thelink.attr('id');
$("#text_" + x).show();
$("#picarray_" + x).show();


//return false;
//$("#text_" + x).toggle("fast");
//alert ( thelink.attr('id') );

// see if same thumb is being clicked
if ($(this).hasClass("active")) { return; }
var url = thelink.attr('rel');
	// calclulate large image's URL based on the thumbnail URL (flickr specific)
	//var url = $(this).attr("src").replace("_t", "");

	//var url = $(this).attr("src");
	//var url = $(this).attr("href");
	//var url = $(this.href);

// get handle to element that wraps the image and make it semi-transparent
	//var wrap = $("#image_wrap").fadeTo("medium", 0.5);
var wrap = $("#image_wrap").fadeTo("fast", 0.9);


// the large image from www.flickr.com
var img = new Image();


// call this function after it's loaded
img.onload = function() {
// make wrapper fully visible
wrap.fadeTo("fast", 1);
// change the image
wrap.find("img").attr("src", url);
};

// begin loading the image from www.flickr.com
img.src = url;
// activate item
//$(".sc_menu img").removeClass("active");
$(".showpic").removeClass("active");
$(this).addClass("active");
})

// when page loads simulate a "click" on the first image
//}).filter(":first").click();


$('.default-value').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});





var hash=location.hash;
if (hash){
//write a hidden form field with the value of hash
$('.TabbedPanelsContent').hide();
$('#pane'+hash.replace("#","")).show();
$('#dpane'+hash.replace("#","")).show();
$('.TabbedPanelsTab').css({color:'#009'});
$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
$('#tab'+hash.replace("#","")).css({color:'#ffffff'});
$('#tab'+hash.replace("#","")).css({'background-color':'#009'});
//alert(hash.replace("#",""))
}


//$('.TabbedPanelsContent').hide();
//$('#pane3').show();
//$('#dpane3').show();
//$('.TabbedPanelsTab').css({color:'#009'});
//$('.TabbedPanelsTab').css({'background-color':'#ffffff'});
//$(this).css({color:'#ffffff'});
//$(this).css({'background-color':'#009'});


});	//end document ready
