$(document).ready(function(){
						   
	// Clear field value when clicked
	$(".has_default_value").focus(function (){
		if ( $(this).val() == $(this).attr("title") ) { 
			$(this).val("");
		}
	});
	$(".has_default_value").blur(function (){ 
		if ( $(this).val() == "" ) {
			$(this).val($(this).attr("title"));
		}
    });

    $('.colorbox a, a.colorbox').colorbox({
        current: "{current} of {total}",
        initialHeight: '150px',
        initialWidth: '150px',
        maxHeight: '95%',
        maxWidth: '95%',
        opacity: 0.25,
        speed: 250,
        transition: "elastic"
    });	

	// Rollovers
	$(".rollover").hover(function(){
		this.src = this.src.replace("_off","_on");
	},
	function(){
		this.src = this.src.replace("_on","_off");
	});
	$(".rollover").each(function(){
		rollover_src = $(this).attr("src");
		rollover_activate = rollover_src.replace(/_off/gi, "_on");
		$("<img>").attr("src", rollover_activate);
	});

	// Hide/Reveal
	$(".divdrop").hide();

	$(".dropme").toggle(
	function() {
	    $(".divdrop").removeClass("hidden").slideUp("slow");
	    $(this).next(".divdrop").removeClass("hidden").slideDown("slow");
	},
	function() {
	    $(this).next(".divdrop").removeClass("hidden").slideUp("fast");
	});

	$(".divOpen").slideDown("slow");

});


function ProductBoxShow(divID) {

    document.getElementById("prdDescription1").style.display = "none";
    document.getElementById("prdDescription2").style.display = "none";
    document.getElementById("prdDescription3").style.display = "none";
    document.getElementById("prdDescription4").style.display = "none";

    document.getElementById("productDscImg1").src = "/images/prodtab/colours_off.jpg";
    document.getElementById("productDscImg2").src = "/images/prodtab/accessories_off.jpg";
    document.getElementById("productDscImg3").src = "/images/prodtab/associatedproducts_off.jpg";
    document.getElementById("productDscImg4").src = "/images/prodtab/description_off.jpg";

    document.getElementById("prdDescription" + divID).style.display = "";

    if (divID == "1")
        document.getElementById("productDscImg1").src = "/images/prodtab/colours_on.jpg";
    if (divID == "2")
        document.getElementById("productDscImg2").src = "/images/prodtab/accessories_on.jpg";
    if (divID == "3")
        document.getElementById("productDscImg3").src = "/images/prodtab/associatedproducts_on.jpg";
    if (divID == "4")
        document.getElementById("productDscImg4").src = "/images/prodtab/description_on.jpg";

    var productDscImg4 = document.getElementById("productDscImg" + divID);

}

function ClearMe(obj) {

    if (obj.value == "Search")
        obj.value = "";
}
function ResetMe(obj) {

    if (obj.value == "")
        obj.value = "Search";
}