// JavaScript Document
$(document).ready(function() {						   
			$('input[type="text"]').addClass("idleField");
       		$('input[type="text"]').focus(function() {
       			$(this).removeClass("idleField").addClass("focusField");
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
			
    		$('input[type="text"]').blur(function() {
    			$(this).removeClass("focusField").addClass("idleField");
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
    		
    		
    		$("#cforms2form").submit(function() {
    			if ($("#Name").val() == "Your Name"){
    				$('#Name').val('');
    			}
    			if ($("#Company").val() == "Company Name"){
    				$('#Company').val('');
    			}
    			if ($("#Message").val() == "Please enter your enquiry"){
    				$('#Message').val('');
    			}
    			if ($("#Tel").val() == "Telephone"){
    				$('#Tel').val('');
    			}  
    			if ($("#Address").val() == "Your Address"){
    				$('#Address').val('');
    			}      			    			    			    			
      
    		});
			
			jQuery('div.newsItemWrapper:last').addClass('lastNewsItem');
			jQuery('div.newsItemWrapper:first').addClass('firstNewsItem');
			jQuery('.latestNewsSidePanel:last').addClass('no-bottom-border');

			
		});		
		
// Bookmark Function

$(document).ready(function(){
	// add a "rel" attrib if Opera 7+
	if(window.opera) {
		if ($("a.jqbookmark").attr("rel") != ""){ // don't overwrite the rel attrib if already set
			$("a.jqbookmark").attr("rel","sidebar");
		}
	}

	$("a.jqbookmark").click(function(event){
		event.preventDefault(); // prevent the anchor tag from sending the user off to the link
		var url = this.href;
		var title = this.title;

		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title);
		} else if(window.opera) { // Opera 7+
			return false; // do nothing - the rel="sidebar" should do the trick
		} else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)
			 alert('Unfortunately, this browser does not support the requested action,'
			 + ' please bookmark this page manually.');
		}

	});
});



function slideshow() {
            // create the image rotator
            setInterval("rotateImages()", 5000);
        };
    

    function rotateImages() {
        var oCurPhoto = $('#photoShow div.current');
        var oNxtPhoto = oCurPhoto.next();
        if (oNxtPhoto.length == 0)
            oNxtPhoto = $('#photoShow div:first');

        oCurPhoto.removeClass('current').addClass('previous').animate({opacity:0},2000);
        oNxtPhoto.css({ opacity: 0.0 }).addClass('current').animate({ opacity: 1.0 }, 2000,
            function() {
                oCurPhoto.removeClass('previous');
            });
    }

