
/* -------------------------------------------------

START:: EXTERNAL LINKS

------------------------------------------------- */
function linksExternal(){

   if (document.getElementsByTagName){
     var anchors = document.getElementsByTagName("a");
     for (var i=0; i<anchors.length; i++){
	       var anchor = anchors[i];
		   if (anchor.getAttribute("rel") == "_external"){
			   anchor.target = "_blank";
           }
      }
    }
}
/* -------------------------------------------------

END:: EXTERNAL LINKS

------------------------------------------------- */



/* -------------------------------------------------

START:: DOCUMENT READY

------------------------------------------------- */
$(document).ready(function(){	

if ($(".contactForm".lenght > 0)){
	
		var contactForm = $("#contactForm").validate({
		submitHandler: function(form){$(form).ajaxSubmit({
		beforeSubmit:function(){
//				$('#contactForm').block
//				({ message: '<div id="globalLoaderWrapper"><div class="globalLoader">Please wait loading ...</div></div>',
//					 css: {border: 'none',padding: '10px',color: "#f8f4f4",backgroundColor: "none",width: "270px"},
//					
//					overlayCSS:  { 
//					backgroundColor: '#fff', 
//					opacity:         0.4
//					}
//				});
		},
		success:function(data){
		$("#name,#surname,#address,#postalCode,#city,#country,#email").val("");
		//$("#name").focus();
		$("#formResults").show();
		//globalUnblock ("mainContent");
		window.setTimeout(function() {
		$("#formResults").slideUp();
		}, 6000);
		
		return false;
		},
		target: "#formResults"
		});
		
		},
		rules: {
				name: "required",
				surname: "required",
				address: "required",
				postalCode: "required",	
				city: "required",
				country: "required",
																		
				email:{
					required: true,
					email:true
					}
					
			   }
		
		});// end: Validator	
	
}


linksExternal();

$("a[rel='imgGallery']").colorbox({
						  transition: "fade",
						  preloading: true,
						  photo: true
						 });

$("#mainMenu a").prepend("<span class='gradient'>&nbsp;</span>");

if($.browser.msie && $.browser.version=="6.0") {

$("div#carouselSlide > ul").cycle({fx: 'fade'});
	
}else{
$("div#carouselSlide > ul").cycle({fx: 'fade'});	
}

if ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)){
$('#logo,#wrapper').supersleight({shim: '../_images/transparent.gif'});
}

	$("#developedBy").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-66" //Find the <span> tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "-33"  //Move the <span> back to its original state (0px)
		}, 250);
	});



}); //End:: Document Ready
