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

 
$(document).ready(function(){  

  //nav
  $(".nav").appendTo("#mymenu");
  $(".navbar.main-nav:first").remove();
  $("#logo:first").remove(); 
 
  //myheader
  $(".myheader").prependTo("body"); 
  
  //$(".nav > li:nth-child(5) > a:hover").css({"position":"relative","z-index":"-1"});
  
  //wrap the body
  $("body").wrapInner('<div class="wrapper"></div>'); 
  
  //404 page
  $("#page-not-found div#error").wrap("<div class='container'>").wrap("<div class='row-fluid'>").wrap("<div class='span12'>"); 
  
   
  //favicon
  $('<link id="favicon" type="image/x-icon" rel="shortcut icon" href="http://cdn.myld.com.au/2/364/tweed-battery-centre_ce2f943d55.ico" />').appendTo('head'); //ico
  $('<link id="favicon" type="image/x-icon" rel="shortcut icon" href="http://cdn.myld.com.au/2/234/tweed-battery-centre_a30f1d4284.png" />').appendTo('head'); //png
  
  
  //********Windows IE8 and below popup*********//   		     		
	$("body").browserDetect( {     	
		name: "Tweed Battery Centre",     
		logo: "http://cdn.myld.com.au/2/364/tweed-battery-centre_b2c5cd241e.png",      
		phone: "07 5524 4895",     //optional
		fax: "07 5524 4895",      //optional
		email: "tweedbatteries@gmail.com",      //optional
		address: "Shop 2/84 Industry Drive, Tweed Heads South, NSW 2486",  //optional	
		ldprofile: "http://www.localdirectories.com.au/Tweed-Coast,NSW/Tweed-Battery-Centre/profile/HXHH"  
	});  

	//********Mobile Telephone*********//  
//	mobileTel(0755244895); //edit phone number
	
	$.backstretch("http://cdn.myld.com.au/2/364/tweed-battery-centre_5e5407fc6d.jpg"); 
	
	$('#custom_form').formValidation({
			validateText: ["name","message"],
			validateEmail: ["email"],
			validateSpam: true
	});
	
  //function calls
  myanimations();
  $("#page-not-found div#error").wrap("<div class='container'>").wrap("<div class='row-fluid'>").wrap("<div class='span12'>"); 
}); //end of doc ready

function myanimations(){
  var deviceAgent = navigator.userAgent.toLowerCase();
    var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
        if (!agentID) {

            $(".mybounce").addClass("animated bounceInDown");
            $(".myFade").addClass("animated fadeInLeftBig");

        }
}

