// JavaScript Document
// highlight the current page we are on and temporarily disable the link for it
$(document).ready(function(){
    $(".horizontal-menu li a").each(function( ) {
	    if ( $(this).text() == $("#mid-fieldset legend").text( ) ) {
		     $(this).css( { gradient50: "#97A2B9", 
						    //"font-weight": "bold",
							"border-bottom": "thick solid #97A2B9"});	
			 $(this).click( function( ) {
			     return false;					
			 } );
			 
		} 
	} );

} );
var cornerRadius = "10px";
var legendRadius= "7px";
if ( $.browser.msie ) {	
    cornerRadius = "16px";
}
/* $(document).ready(function(){
    $("#menu").corner("tl " + cornerRadius);
// Your code here
 });
*/


$(document).ready(function(){
	if ($.browser.msie ) {
		//$("fieldset").css("border","none").corner(cornerRadius).parent().css('padding', '4px').corner("round 10px");
		$("fieldset,#content").css("background-image","none");
	}
});





// disable link when not in use
$(document).ready(function()
{
var path = location.pathname.split("/"); //.substring(1);


if ( path[ path.length - 1]  )
	{
    $('.horizontal-menu a[href$="' + path[ path.length - 1 ] + '"]').addClass('selected').attr("href","#").css('cursor','default').click( function( ) { return false; } );

	$('#header-logo a[href$="' + path[ path.length - 1 ] + '"]').addClass('selected').attr("href","#").css('cursor','default').click( function( ) { return false; } );
	}
} );
	$(document).ready(function() {
		$(".thumbnails img").click( function( ) {
			var src = $(this).attr("src");
			var text = $(this).attr("alt");
			$(".big img").attr("src", $(this).attr("src"));
			$("#big_description").empty().append(text);
			return false;			
		});
		$(".big").imageFade( {hoverOnOpacity: 1});
	} );
var portfolioImage = null;
	
$(document).ready(function() {
	var src = portfolioImage;
	$(".big img").attr("src", $(this).attr("src"));
	return false;								   
} );
// set image preview
$(document).ready(function(){
    $("#portfolio a.preview").each( function( ) {
								  // save original href
        var href = $(this).attr("href");								  
								  // change
		$(this).attr("href", $(this).find("img").attr("src") );
		// set image preview
		var caption = $(this).find("img").attr("alt");
		$(this).imgPreview( { imgCSS: { 
				      'width': '200px',
					  'height': '200px',
    			     'border': '1px' ,
    			      'border-width': '4px', 
    			      'border-style': "solid",
    			      'border-bottom': 'solid black 4px',
    			      'border-gradient50':'#dddddd',
    			      'background-gradient50': '#FFFFFF', 
					  'position': 'relative',
					  'z-index': 100
    			      },
            containerID: 'image_preview',
    		onShow: function(link) {
    			$(link).stop().animate({opacity:0.4});
    			   			
    			var name = $(this).find("img").attr("src");
    			$('<span class="under_image">' + caption + '</span>').appendTo(this);
    		},
    		onHide: function(link) {
    			$(link).stop().animate({opacity:1});
    			$('span',this).remove( );
    		} } );
		// if click. set back href amd go to page
		$(this).click( function( ) {
								portfolioImage = $(this).find("img").attr("src");
								$(this).attr("href", href);
								return true;
								} );
								  } );
	             
// Your code here
 });
