// last updated by david 17/09/2010

$(document).ready(function(){
	
	// remove words in input box on focus
	$("input#f_email").focus(function() {  
        if (this.value == "Enter email address"){  
            this.value = '';  
        } 
    });
	
	// remove words in input box on focus
	$("input#f_keywords").focus(function() {  
        if (this.value == "Enter search terms"){  
            this.value = '';  
        } 
    });
	
	// validate subscribe_form form on keyup and submit
	$("#subscribe_form").validate({

		// rules for field names
		rules: {
			
			f_email: { required: true, email: true } // no comma on last var or IE cracks it
			
		}

	});
	
	// validate contact_form form on keyup and submit
	$("#contact_form").validate({

		// rules for field names
		rules: {
			
			f_name: "required", 
			f_company: "required", 
			f_phone: "required", 
			f_email: { required: true, email: true },
			f_enquiry: "required" // no comma on last var or IE cracks it
			
		}

	});
	
});

function LaunchPresentation(bChromeless, bResize, url)
    {
    var nWidth = screen.availWidth;
    var nHeight = screen.availHeight;
    if (nWidth > 820)
    {
    nWidth = 980;
    nHeight = 640;
    }
    var strOptions = "width=" + nWidth +",height=" + nHeight;
    if (bResize)
    {
    strOptions += ",resizable=yes"
    }
    if (bChromeless)
    {
    strOptions += ", status=0, toolbar=0, location=0, menubar=0, scrollbars=0";
    }
    else
    {
    strOptions += ", status=1, toolbar=1, location=1, menubar=1, scrollbars=1";
    }
    window.open(url , "_blank", strOptions);
    return(false);
    }
