$(document).ready(function(){$(".portfolio_full img, .portfolio_two img, .content_picture_prettyphoto img, .image-nav").hover(function(){$(this).animate({opacity:"0.6"},"slow")},function(){$(this).animate({opacity:"1"},"slow")});$("#footer-widget-fourth .social-links img").fadeTo("fast","0.5");$("#footer-widget-fourth .social-links img").hover(function(){$(this).animate({opacity:"1"},"fast")},function(){$(this).animate({opacity:"0.5"},"fast")});$(function(){$(".tt_bottom").tipTip({edgeOffset:5,defaultPosition:"bottom"})});$(function(){$(".tt_top").tipTip({edgeOffset:5,defaultPosition:"top"})});$(function(){$(".tt_left").tipTip({edgeOffset:5,defaultPosition:"left"})});$(function(){$(".tt_right").tipTip({edgeOffset:5,defaultPosition:"right"})});$("a[href=#top]").click(function(){$("html, body").animate({scrollTop:0},"slow");return false});$("a[rel^='prettyPhoto']").prettyPhoto({animation_speed:"fast",slideshow:false,autoplay_slideshow:false,opacity:0.8,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"light_square",hideflash:false,wmode:"opaque",autoplay:true,modal:false,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> 						<div class="ppt">&nbsp;</div> 						<div class="pp_top"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 						<div class="pp_content_container"> 							<div class="pp_left"> 							<div class="pp_right"> 								<div class="pp_content"> 									<div class="pp_loaderIcon"></div> 									<div class="pp_fade"> 										<a href="#" class="pp_expand" title="Expand the image">Expand</a> 										<div class="pp_hoverContainer"> 											<a class="pp_next" href="#">next</a> 											<a class="pp_previous" href="#">previous</a> 										</div> 										<div id="pp_full_res"></div> 										<div class="pp_details clearfix"> 											<p class="pp_description"></p> 											<a class="pp_close" href="#">Close</a> 											<div class="pp_nav"> 												<a href="#" class="pp_arrow_previous">Previous</a> 												<p class="currentTextHolder">0/0</p> 												<a href="#" class="pp_arrow_next">Next</a> 											</div> 										</div> 									</div> 								</div> 							</div> 							</div> 						</div> 						<div class="pp_bottom"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 					</div> 					<div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> 								<a href="#" class="pp_arrow_previous">Previous</a> 								<ul> 									{gallery} 								</ul> 								<a href="#" class="pp_arrow_next">Next</a> 							</div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>',custom_markup:""})});function checkemail(b){var a=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return a.test(b)}$(document).ready(function(){var c=Math.floor(Math.random()*(100));var b=Math.floor(Math.random()*(100));$("#contactform #math1").text(c);$("#contactform #math2").text(b);var a=c+b;$("#contactform a#formsend").click(function(){var i=$("#name").val();var e=$("#email").val();var f=$("#subject").val();var g=$("#message").val();var d=$("#confirm").val();var h=$("#contactemail").val();if(i!=""&&i.length<3){$nameshort=true}else{$nameshort=false}if(i!=""&&i.length>30){$namelong=true}else{$namelong=false}if(e!=""&&checkemail(e)){$emailerror=true}else{$emailerror=false}if(f!=""&&f.length<3){$subjectshort=true}else{$subjectshort=false}if(f!=""&&f.length>100){$subjectlong=true}else{$subjectlong=false}if(g!=""&&g.length<3){$messageshort=true}else{$messageshort=false}if(d!=""&&d!=a){$confirmerror=true}else{$confirmerror=false}$(".loading").fadeIn("fast");if(i!=""&&$nameshort!=true&&$namelong!=true&&e!=""&&$emailerror!=false&&f!=""&&$subjectshort!=true&&$subjectlong!=true&&g!=""&&$messageshort!=true&&d!=""&&$confirmerror!=true&&h!=""){$.post("php/sendmail.php",{contactemail:h,name:i,email:e,subject:f,message:g},function(j){$(".loading").fadeOut("fast");$("#contactform").fadeOut();$("#name, #subject, #url, #email, #message, #confirm").val("").css({border:"none"});$("#contactform label span").remove();$("label.overlabel-apply").show();$('<div class="box2 ok"><span>Thank you, '+i+"! <br />Your message has been send successfully.</span></div>").insertBefore("#contactform");$(".box2").delay(5000).fadeOut(1000,function(){$(this).remove();$("#contactform").fadeIn();$("label.overlabel-apply").fadeIn()})});return false}else{$(".loading").fadeOut("fast");$('<div class="box2 err"><span>Your message has not been send successfully.<br />It was an error on page!</span></div>').insertBefore("#contactform");$(".box2").delay(5000).fadeOut(1000,function(){$(this).remove()});if(i==""){$("#name").parent("div").find("label").find("span").remove();$("#name").parent("div").find("label").append("<span>&laquo; You forgot to enter your name.</span>")}else{if($nameshort==true){$("#name").parent("div").find("label").find("span").remove();$("#name").parent("div").find("label").append("<span>&laquo; Entered name must not be shorter than 3 characters.</span>")}else{if($namelong==true){$("#name").parent("div").find("label").find("span").remove();$("#name").parent("div").find("label").append("<span>&laquo; Entered name must not be longer than 30 characters.</span>")}else{$("#name").parent("div").find("label").find("span").remove()}}}if(e==""){$("#email").parent("div").find("label").find("span").remove();$("#email").parent("div").find("label").append("<span>&laquo; You forgot to enter your email address.</span>")}else{if($emailerror==false){$("#email").parent("div").find("label").find("span").remove();$("#email").parent("div").find("label").append("<span>&laquo; You entered an invalid email address.</span>")}else{$("#email").parent("div").find("label").find("span").remove()}}if(f==""){$("#subject").parent("div").find("label").find("span").remove();$("#subject").parent("div").find("label").append("<span>&laquo; You forgot to enter the subject of your message.</span>")}else{if($subjectshort==true){$("#subject").parent("div").find("label").find("span").remove();$("#subject").parent("div").find("label").append("<span>&laquo; Entered subject must not be shorter than 3 characters.</span>")}else{if($subjectlong==true){$("#subject").parent("div").find("label").find("span").remove();$("#subject").parent("div").find("label").append("<span>&laquo; Entered subject must not be longer than 100 characters.</span>")}else{$("#subject").parent("div").find("label").find("span").remove()}}}if(g==""){$("#message").parent("div").find("label").find("span").remove();$("#message").parent("div").find("label").append("<span>&laquo; You forgot to enter the text of your message.</span>")}else{if($messageshort==true){$("#message").parent("div").find("label").find("span").remove();$("#message").parent("div").find("label").append("<span>&laquo; Entered message must not be shorter than 3 characters.</span>")}else{$("#message").parent("div").find("label").find("span").remove()}}if(d==""){$("#confirm").parent("div").find("label").find("span").remove();$("#confirm").parent("div").find("label").append("<span>&laquo; You forgot to fill the confirmation field.</span>")}else{if($confirmerror==true){$("#confirm").parent("div").find("label").find("span").remove();$("#confirm").parent("div").find("label").append("<span>&laquo; Entered confirmation value is incorrect.</span>")}else{$("#confirm").parent("div").find("label").find("span").remove()}}return false}})});
