// JavaScript Document

function over(imgName){
	
	var element = document.getElementById(imgName);
	element.style.color="red";
	element.style.cursor="pointer";
}



function out(imgName){
	
	var element = document.getElementById(imgName);
	element.style.color="#fff";
	element.style.cursor="default";
}



function click(imgName){
	
	var strpos = imgName.indexOf('logo');
	
	if (strpos > -1){
	document.podImage.src = "images/print/" + imgName + ".gif";
	}else{
	document.podImage.src = "images/print/" + imgName + ".jpg";	
		
	}
}


var onLoadEvents = function() { };

function addLoadEvent(func) {
  var oldOnLoadEvents = onLoadEvents;
  if (typeof onLoadEvents != 'function') {
    onLoadEvents = func;
  } else {
    onLoadEvents = function() {
      oldOnLoadEvents();
      func();
    }
  }
}

function domReady() {
    this.n = (typeof this.n == 'undefined') ? 0 : this.n+1;

    if(typeof document.getElementsByTagName != 'undefined' &&
        (document.getElementsByTagName('body')[0] != null ||
            document.body != null))
    {
        this.doOnce = (typeof this.doOnce == 'undefined') ? 1 : 0;

        if (doOnce) { onLoadEvents(); }
    } else {
        // if(this.n<240){setTimeout('domReady()',250);}};domReady();
        setTimeout('domReady()',50);
    }
}

window.onload = domReady;






 function podImageClass() {

       if ( !(this instanceof podImageClass) ) return new podImageClass();

       var browser;

       var podImage;
       var podImageHeight;
       var podImageWidth;
       var podImageAspect;

       var debounceResize = 0;
       var haveResized = 0;

       function __setViewOriginalLink(displayBool) {
           var voLink = document.getElementById("podImageViewOriginalLink");
           if (displayBool) {
              voLink.innerHTML = 
                  '<a href="javascript:podImage.setOriginalSize()">' +
                  "scale to original size" + "</a>";
           } else {
              voLink.innerHTML = '&nbsp;';
           }
       }

       function _setText () {
           var podImageText = "Redraven Creative Graphic Design and Web Design";
           podImage.alt = podImageText;
           podImage.title = podImageText;
       }

       function _setSize() {
          var myWidth = 0, myHeight = 0;
        
          if (debounceResize) {
             debounceResize = 0;
             return;
          }

          if( typeof( window.innerWidth ) == 'number' ) {
             //Non-IE
             myWidth = window.innerWidth;
             myHeight = window.innerHeight;
          } else if( document.documentElement &&
             ( document.documentElement.clientWidth ||  
                document.documentElement.clientHeight ) ) {
             //IE 6+ in 'standards compliant mode'
             myWidth = document.documentElement.clientWidth;
             myHeight = document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || 
                document.body.clientHeight ) ) {
             //IE 4 compatible
             myWidth = document.body.clientWidth;
             myHeight = document.body.clientHeight;
          }

          // Only do the resize if we've done this before or if our
          // image is greater than their window size 64px of top margin.
          if  (!( haveResized || ( (podImageWidth + 450) > myWidth ) || ( (podImageHeight + 175) > myHeight ))) {
             return;
          }
		  
		  
		  
          // allow 128px margins on top and bottom:
          var newImageHeight = myHeight - ( 2 * 128 );

          if (( (podImageWidth + 450) < myWidth ) || ( (podImageHeight + 175) < myHeight )) {
             // Just use original width and height;
             _setOriginalSize();
          } else {
             // Downscale:
             if (newImageHeight > 0) {
                var newImageWidth = newImageHeight * podImageAspect;
                podImage.width = newImageWidth;
                podImage.height = newImageHeight;
             }

             __setViewOriginalLink(true);
          }

          haveResized = 1;
       }

       function _setOriginalSize() {
          // We have to play with the onresize handler to work
          // around IE sending spurious events.
          window.onresize = null;
          podImage.width = podImageWidth;
          podImage.height = podImageHeight;
          __setViewOriginalLink(false);
          if (browser == "MSIE") {
             debounceResize = 1;
          }
          window.onresize = _setSize;
       }

       function _checkIt(string)
       {
          var detect = navigator.userAgent.toLowerCase();
          place = detect.indexOf(string) + 1;
          thestring = string;
          return place;
       }

       function _init() {
          if (_checkIt('msie')) browser = "MSIE"
          else browser = "Other";

          podImage = document.getElementById("podImage");
          podImageWidth = podImage.width;
          podImageHeight = podImage.height;
          podImageAspect = (podImageHeight > 0) ?
             (podImageWidth / podImageHeight) : 0;
       }

       this.init = _init;
       this.setText = _setText;
       this.setSize = _setSize;
       this.setOriginalSize = _setOriginalSize;

       _init();
    }

    <!-- setup podImage class: -->
    var podImage;
    addLoadEvent(function() {
            podImage = podImageClass();
            podImage.setText();
            podImage.setSize();
            window.onresize = podImage.setSize;
    });

