(function($){

	if(typeof(com)==="undefined"){com = {};}
	if(typeof(com.adwencreative)==="undefined"){com.adwencreative = {};}

	if(typeof(com.adwencreative.site)==="undefined"){
		com.adwencreative.site = function(){

			return {

				init:function(){		
					$("#logodivFLASH").each(function(){
					    $(this).flash({
					        src:"/test1.swf",
							width:317,
							height:314
					    });
					});			
					$("div.scroll").each(function(dsI,ds){
						$(ds).width($(window).width()-$(ds).offset().left);
						$("#logodiv").height($("div.scroll").size()*380);
						$(window).resize(function(){
							$(ds).width($(window).width()-$(ds).offset().left);
						});
					});
					$("#contactForm").submit(function(){
						var eVal = $("#emailInput").val();
						if(eVal.length > 3 && eVal.indexOf("@") > 0 && eVal.indexOf(".") > 0){
							$("#contactForm").attr("action","http://adwencreative.com/cgi-bin/cgiemail/contact.txt");
							return true;
						}else{
							alert("Your e-mail address is required and must be valid.");
							return false;
						}
					});
				}
			}
		}();
	}   

	$(document).ready(function(){
		com.adwencreative.site.init();
	});

})(jQuery);
