
		jQuery.preLoadImages("../images/downloadiPadOv.png", "../images/downloadiPhoneOv.png", "../images/contactBtnDn.jpg", '../images/splashBottom.jpg', '../images/splash.jpg','../images/sendBtnDn.gif','../images/contactx.gif', '../images/contactxDn.gif','../images/textBlock.gif','../images/textBox.jpg', '../images/contactBg.png', '../images/contactBtnActive.jpg', '../images/umLogoDn.png','../images/vidIcoDn.jpg');

	var contactSectVisible = false;
	var spinner_rot = 0;
	function init() {
	var _iPhone = document.getElementById('iPhone');
	
	
$(document).ready(function(){
	activatePlaceholderTag();
	//$('#textHolderRightCloumn a').lightBox();
	
	$('#iPhoneTop').fadeIn(0, null); //load order last
	$('#splashBottom').fadeIn(0, null);//load order last
	$('#bigSticky').delay(300).fadeIn(1000, null);
	$('#bigStickyTwo').delay(3600).fadeIn(1000, null);
	$('#smallSticky').delay(3200).animate({
   			 top: '137',
			 left: '758'
  		}, 
  			800, 
			'easeOutQuart',
			function() { null });
	
	$('#bigSticky').delay(1500).animate({
   			 top: '-70',
			 left: '43'
  		}, 
  			600, 
			'easeOutQuart',
			function() { null });
	

	//.attr('title', "Utilize ejar. $('#gallery a').lightBox();")
	
/// load flickr imgs//////////////////////
		
		$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=a41f71ac93f761bff61ba22d656c31f0&tags=ibrainstormapp&lang=en-us&format=json&jsoncallback=?", 
			function(data){																																														    			
			for (i = 0; i <= 6; i++) { // Loop through the 10 most recent, [0-9]
					var item = data.photos.photo[i];
					var str = "http://farm" +item.farm +"."+ "static.flickr.com/" + item.server +"/" + item.id + "_" + item.secret + "_"+"s"+".jpg";
					var link = "http://farm" +item.farm +"."+ "static.flickr.com/" + item.server +"/" + item.id + "_" + item.secret +".jpg";
					var lightbox = String('Utilize ejar. $("#gallery").lightBox();');
					//trace(str);
					$("<img alt='' />").attr("src", str).attr("src", str).attr("width", 30).appendTo("#flickrList").wrap("<li style='margin-right: 4px;<span style='padding-top: 4px; '></li>")
					.wrap("<a  href='" + link + "' id='"+ 'Gimage'+i +"'   rel='prettyPhoto' title='iBrainstorm flickr photo' ></a>");
					
					//$('#Gimage'+i).delay(1000).lightBox();
			  	};
				$('#gallery a').prettyPhoto();
				//$('#gallery a').lightBox();
			});

	
	});
	
																															
	}  //init end

	///// mail/////////
function sendToSender() {
	 $("#contaceName").attr("value", "");
		$("#contactEmail").attr("value", "");
		$("#contactMessage").attr("value", "");
	
	$("#contaceName").fadeOut(300, function() { });
	$("#contactEmail").fadeOut(300, function() { });
	$("#contactMessage").fadeOut(300, function() { });
	$("#contactSubmit").fadeOut(300, function() { });
	
	$("#spinner").delay(400).fadeIn(500, function() { });
	
	var dataString =  'Name='+ $('#Name').val() + '&Email=' + $('#Email').val() + '&Comments=' + $('#Comments').val();
	//trace("sender.php?cmd=send" + '&Name='+ $('#Name').val() + '&Email=' + $('#Email').val() + '&Comments=' + $('#Comments').val());
	$.ajax({
    	 type: "POST",
      url: "mailer/sender.php?cmd=send",
      data: dataString,
	 
      success: function(data) {
       // $('#contact_form').html("<div id='message'></div>");
       // $('#message').html("<h2>Contact Form Submitted!</h2>")
        //.append("<p>We will be in touch soon.</p>")
        //.hide()
		//trace(data);
		
		
        $("#contaceName").delay(400).fadeIn(300, function() { });
		$("#contactEmail").delay(400).fadeIn(300, function() { });
		$("#contactMessage").delay(400).fadeIn(300, function() { });
		$("#contactSubmit").delay(400).fadeIn(300, function() { });
		$("#spinner").fadeOut(700, function() { });
		
		$('#contactSect').delay(1200).fadeOut(0, null);
		contactSectVisible = !contactSectVisible;
	  }
	   
	});
}

	
function showHideContentSect () {
	contactSectVisible = !contactSectVisible;
	if(contactSectVisible) {
		$('#contactSect').fadeIn(0, null);
		$('#contactBtn').attr('class',"contactBtnActive");
		
	} else {
		$('#contactSect').fadeOut(0, null);
		$('#contactBtn').attr('class',"contactBtnUp");
	}
}

function contactBtnOver () {
		$('#contactBtn').attr('class',"contactBtnDn");
}

function contactBtnOut () {
	if(contactSectVisible) {
		$('#contactBtn').attr('class',"contactBtnActive");
	} else {
		$('#contactBtn').attr('class',"contactBtnUp");
	}
}
	
	
//http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=a6b444bff7cecf0b20127389528a08ca&tags=ibrainstormapp
	


	
	////  jquery preload images function
	(function($) {
	  var cache = [];
	  // Arguments are image paths relative to the current page.
	  $.preLoadImages = function() {
		var args_len = arguments.length;
		for (var i = args_len; i--;) {
		  var cacheImage = document.createElement('img');
		  cacheImage.src = arguments[i];
		  cache.push(cacheImage);
		}
	  }
	})(jQuery)
	
	function navigateToUM () {
		//window.location.href = "http://www.universalmind.com";
		window.open('http://www.universalmind.com', 'Universal Mind Inc');
	}
	function navigateToiPadApp () {
		window.open('http://itunes.apple.com/us/app/ibrainstorm/id382252825?mt=8', "iTunes Store");
	}
	function navigateToiPhoneApp () {
		window.open('http://itunes.apple.com/us/app/ibrainstorm-companion/id382260522?mt=8', "iTunes Store");
	}
	
	

