﻿var ContactMe = new Class({
	initialize: function (elements, options)
	{
		SqueezeBox.assign(elements,{
			everlayOpacity: 75,
			sizeLoading: { x : 100, y : 100 },
			size: { x: 460 , y: 580 },
			ajaxOptions: {
				method: 'get'
			},
			OnOpen: function() {
				var init = function(){
					if($("ContactForm")){
						var stateValue = $("ContactForm").getElement(".stateValue");
						stateValue.set("value", "7304");

						new FormValidator.Inline('ContactForm', {
							onFormValidate: function(passed, form, event){
								if(passed) {
									event.stop();

									form.set("send",{
										onComplete: function(response) {
											$("sbox-btn-close").fireEvent("click");
										}
									});
									form.send();
								}
							}
						});
					}
				};
				init.delay(500);
			}
		});
	}
});