function clearMe(formfield, defaultValue) {
	if ((defaultValue == null) || (defaultValue == undefined))
		defaultValue = formfield.defaultValue;
	if (formfield.value == defaultValue)
		formfield.value = "";
}
function restoreMe(formfield, defaultValue) {
	if ((defaultValue == null) || (defaultValue == undefined))
		defaultValue = formfield.defaultValue;
	if (formfield.value.replace(/^\s+|\s+$/g, "") == "")
		formfield.value = defaultValue;
}
								
$(function() {

function handleTabSelect(event, tab) {
	 if (tab.index == 0) {
		 // tab 1 selected
		 $('img#imgTab1').attr({ src: "/library/images/tabs/products-1.gif" });
		 $('img#imgTab2').attr({ src: "/library/images/tabs/industries-0.gif" });
		 $('img#imgTab3').attr({ src: "/library/images/tabs/applications-0.gif" });
	 }

	 else if (tab.index == 1) {
		 // tab 2 selected
		 $('img#imgTab2').attr({ src: "/library/images/tabs/industries-1.gif" });
		 $('img#imgTab1').attr({ src: "/library/images/tabs/products-0.gif" });
		 $('img#imgTab3').attr({ src: "/library/images/tabs/applications-0.gif" });
	 }
	 
	 	 else if (tab.index == 2) {
		 // tab 3 selected
		 $('img#imgTab3').attr({ src: "/library/images/tabs/applications-1.gif" });
		 $('img#imgTab1').attr({ src: "/library/images/tabs/products-0.gif" });
		 $('img#imgTab2').attr({ src: "/library/images/tabs/industries-0.gif" });
	 }
}

 // Set Tab Constructor values & initialize tabs
 $('#tabs').tabs({ selected: '0', 
				 fx: { opacity: 'toggle', duration: 'fast' }, select: handleTabSelect });
});

$(function() {
    $('#s1').cycle({ 
		fx: 'fade',
        speed: 300
    });
    $('#goto1').click(function() { 
        $('#s1').cycle(0); 
        return false; 
    });
    $('#goto2').click(function() { 
        $('#s1').cycle(1); 
        return false; 
    });
	$('#goto3').click(function() { 
        $('#s1').cycle(2); 
        return false; 
    });
	$('#goto4').click(function() { 
        $('#s1').cycle(3); 
        return false; 
    });
});

$(function() {
	$(".swapImage img").hover(
		function() {
		this.src = this.src.replace("-0","-1");
		},
		function() {
		this.src = this.src.replace("-1","-0");
		}
	);
});

