/***********************
*  Site Specific JS   *
************************/

//-- SPEEDLOADER "JS" --//

$(document).ready(function(){

  //MOVE
  $('.slider-container').prependTo('body');
  $('#header').prependTo('body');
  
  //Navigation
  $('.navbar').appendTo('.menu');
  
  //Wrappers
  //$('body').wrapInner('<div class="wrapper" />');
  //$('.wrapper').children().not('header, footer').wrapAll('<div class="container" />');
  
  //Remove
  $('.default_header').remove();
  $('.default_footer').remove();
	
	//IE8
	
	//FAVICON
	$('<link id="favicon" type="image/x-icon" rel="shortcut icon" href="http://cdn.myld.com.au/2/263/semrau-constructions_a22413120f.png" />').appendTo('head');
	$('<link rel="shortcut icon" href="http://cdn.myld.com.au/2/311/semrau-constructions_c412e3b573.ico" type="image/x-icon" />').appendTo('head');
	$('<link rel="icon" href="http://cdn.myld.com.au/2/311/semrau-constructions_c412e3b573.ico" type="image/x-icon" />').appendTo('head');
	
  //STYLESHEETS
  $('<link href="http://cdn.myld.com.au/1/js/cform_validation/validation.css" rel="stylesheet" />').appendTo('head');
  $('<link href="http://cdn.myld.com.au/1/css/socialmedia.css" rel="stylesheet" />').appendTo('head');
	
	//Fancybox $('<link href="http://cdn.myld.com.au/1/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" />').appendTo('head');
	
 
    
  //404 PAGE
  $("#page-not-found div#error").wrap("<div class='container'>").wrap("<div class='row-fluid'>").wrap("<div class='span12'>");
	
	//FEATURE HOVER FIX
    $('.fdw-background').hover(
      function () {
        $(this).animate({opacity:'1'});
      },
      function () {
        $(this).animate({opacity:'0'});
      }
    );


});

$(window).load(function() {

	//FEATURE HOVER FIX
    $('.fdw-background').css('opacity', 0);

});

//-- /SPEEDLOADER "JS" --//

$(document).ready(function(){  

  //********Windows IE8 and below popup*********//   		     		
	$("body").browserDetect( {     	
		name: "Semrau Constructions ",     
		logo: "http://www.localdirectories.com.au/sys/ad/68/CLIENTS/Cairns/92389/92389_1194805_LD.png",      
		phone: "(07) 40450 100",     //optional
		fax: "(07) 4942 6342",      //optional
		email: "semcon@bigpond.net.au",      //optional
		address: "PO Box 4789, Cairns, Qld  4870",  //optional	
		ldprofile: "http://www.localdirectories.com.au/Cairns-Area,QLD/Semrau-Constructions-Pty-Ltd/profile/7CZp"  
	});  

	//********Mobile Telephone*********//  
	mobileTel("740450100"); //edit phone number
        
        $('<link id="favicon" type="image/x-icon" rel="shortcut icon" href="../favicon.png" />').appendTo('head');
	 $(".img-box").mouseover(function(){
            $(this).addClass("pulse");
            $(this).addClass("animated");
        });
        $(".img-box").mouseout(function(){
            $(this).removeClass("pulse");
            $(this).removeClass("animated");
        });
        
        
         $("#custom_form").submit(function(){ //** START - SUBMIT FUNCTION **//
            validateText(["name"]); // input id (can validate multiple id's)
            validateEmail(["email"]); // input id (can validate multiple id's)
            validateChar(["message"], 8);

            //DO NOT DELETE ***if any inputs on the page have the class 'needsfilled' the form will not submit
                if (($(":input").hasClass("needsfilled")) || ($("form label").hasClass("needsfilled")) || ($("form select").hasClass("needsfilled2")))
                return false;
                else return true;

            }); //** END - SUBMIT FUNCTION **//
}); 