	// JavaScript Document
// The JS below was pieced together, customized, and developed by Evan Fell.
// EvanFell.com
  function grayOut(vis, options) {
        var options = options || {}; 
        var zindex = options.zindex || 50;
        var opacity = options.opacity || 70;
        var opaque = (opacity / 100);
        var bgcolor = options.bgcolor || '#ffffff';
        var dark=document.getElementById('darkenScreenObject');
        if (!dark) {
          var tbody = document.getElementsByTagName("body")[0];
          var tnode = document.createElement('div');
              tnode.style.position='absolute';
              tnode.style.top='0px';
              tnode.style.left='0px';
              tnode.style.overflow='hidden';          
              tnode.style.display='none';
              tnode.id='darkenScreenObject';
          tbody.appendChild(tnode);
          var dark=document.getElementById('darkenScreenObject');
          var wall=document.getElementById('wall');
        }
        if (vis) {
          // Calculate the page width and height 
          if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
              var pageWidth = document.body.scrollWidth+'px';
              var pageHeight = document.body.scrollHeight+'px';
          } else if( document.body.offsetWidth ) {
            var pageWidth = document.body.offsetWidth+'px';
            var pageHeight = document.body.offsetHeight+'px';
          } else {
             var pageWidth='100%';
             var pageHeight='100%';
          }   
          //set the shader to cover the entire page and make it visible.
          dark.style.opacity=opaque;                      
          dark.style.MozOpacity=opaque;                   
          dark.style.filter='alpha(opacity='+opacity+')'; 
          dark.style.zIndex=zindex;        
          dark.style.backgroundColor=bgcolor;  
          dark.style.width= pageWidth;
          dark.style.height= pageHeight;
          dark.style.display='block';				 
          wall.style.display='block';
        } else {
           document.getElementById('darkenScreenObject').style.display='none';
           document.getElementById('wall').style.display='none';
        }
    }
  
  function getURLVar(urlVarName) {
      var urlHalves = String(document.location).split('?');
      var urlVarValue = '';
      if(urlHalves[1]){
          var urlVars = urlHalves[1].split('&');
          for(i=0; i<=(urlVars.length); i++){
              if(urlVars[i]){
              var urlVarPair = urlVars[i].split('=');
                  if (urlVarPair[0] && urlVarPair[0] == urlVarName) {
                  urlVarValue = urlVarPair[1];
                  }
              }
          }
      }
      return urlVarValue;   
  }

  function checkLanding(){
      
      var noticeVar = getURLVar('notice');
    
      var preserveTextTop = "Preserve Those Precious Memories.";
      var preserveTextMain = "Artimus Art is the one-stop resource for transforming your child&#39;s art into a gorgeous, hard-bound quality book and share-able Web gallery. Our pro-grade layout and publishing services make preserving your artwork a breeze. Even oversized and mixed-media originals! Take a peek at the rest of our site. Whether you&#39;re a parent, a grandparent or just a friend buying a unique gift, there&#39;s an Artimus Art package that&#39;s right for you.";
      var bookTextTop = "Custom Bound Books.";
      var bookTextMain = "Our elegant 11 x 11 handcrafted books are one of a kind. Artimus artisans scan your originals at  high resolution, carefully staging each image to look their best in print. We use heavy glossy paper and wrap the whole thing in a perfectly bound hard cover (using the image of your choice!).";
      var collectingTextTop = "Collecting Your Art.";
      var collectingTextMain = "Gathering and sending us your originals is snap using our super-sized shipping box designed for gentle transport of your creative treasures. Roomy enough for over-sized and mixed-media originals. It arrives at your door within days of placing your order with a prepaid UPS label so you can fill &#39;er up and get it to us ASAP.";
      var sharingTextTop = "Sharing Your Art Online.";
      var sharingTextMain = "Stash your freshly-digitized art on a private Web gallery where you can gloat over your growing collection and share images with friends and families online. You can also choose to post selected images to the public gallery as well.";
      var technologyTextTop = "Advanced Technology.";
      var technologyTextMain = "Artimus uses advanced digital imaging and printing systems. As a result, you enjoy lasting, hard-cover masterpieces that will thrill art critics and stand the test of time. It&#39;s the perfect blend of Do-it-Yourself fun and pro-grade production that you can&#39;t replicate at home.";
      var transferTextTop = "Transfer Images to Disk!";
      var transferTextMain = "Together we&#39;re writing the book on preserving kid art. But it doesn&#39;t stop there! Once your artwork has been sized, scanned and loaded to your gallery, you can also transfer your treasures to a high-resolution disk. Or reproduce your favorite images onto a framed, canvas-backed &#39;painting&#39;.";
      var masterpieceTextTop = "Your Child's Masterpiece is an<br />Oil-On-Canvas.";
      var masterpieceTextMain = "Make that \"Wow, I can't believe how good that is\" piece from your child's web gallery into a digital reproduction on canvas. So real, you'll think the paint is still drying! Worthy of the Louvre but perfect for hanging over Nana's piano (or even in Dad's office).<br />&nbsp;<br />Your chosen image is digitally reproduced on artist's canvas and stretched on wood ready for hanging. Printed with exceptionally high resolution files for ultimate color clarity. Water resistant, framable and durable. Truly a masterpiece!";
      
      if(noticeVar == 'land') {
          var pageVar = getURLVar('page');
          
          if(pageVar == 'preserve'){ 
              document.featuredImage.src = "img/preserve-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = preserveTextTop;
              document.getElementById('mainText').innerHTML = preserveTextMain;
              grayOut(true); 
          }
          if(pageVar == 'book'){ 
              document.featuredImage.src = "img/book-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = bookTextTop;
              document.getElementById('mainText').innerHTML = bookTextMain;
              grayOut(true); 
          }
          if(pageVar == 'collecting'){ 
              document.featuredImage.src = "img/collecting-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = collectingTextTop;
              document.getElementById('mainText').innerHTML = collectingTextMain;
              grayOut(true); 
          }
          if(pageVar == 'sharing'){ 
              document.featuredImage.src = "img/sharing-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = sharingTextTop;
              document.getElementById('mainText').innerHTML = sharingTextMain;
              grayOut(true); 
          }
          if(pageVar == 'technology'){ 
              document.featuredImage.src = "img/technology-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = technologyTextTop;
              document.getElementById('mainText').innerHTML = technologyTextMain;
              grayOut(true); 
          }
          if(pageVar == 'transfer'){ 
              document.featuredImage.src = "img/transfer-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = transferTextTop;
              document.getElementById('mainText').innerHTML = transferTextMain;
              grayOut(true); 
          }
          if(pageVar == 'masterpiece'){ 
              document.featuredImage.src = "img/masterpiece-featured.gif"; 
              document.getElementById('mainTitle').innerHTML = masterpieceTextTop;
              document.getElementById('mainText').innerHTML = masterpieceTextMain;
              grayOut(true); 
          }
                
      } 
  }