String.prototype.capitalize = function(){ //v1.0
    return this.replace(/\w+/g, function(a){
        return a.charAt(0).toUpperCase() + a.substr(1).toLowerCase();
    });
};


function viewqt(folder, mov)
{
	var directory	= "infuse.tv/motion/"+folder+"/mov/";
	var url			= "http://" + "www." + directory + mov;
	
	document.write("<object classid='clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b'")
	document.write("id='qt_object' width='517' height='404'")
	document.write("codebase='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'>")
	
	document.write("<param name='type' value='video/quicktime'>")
	document.write("<param name='name' value='qt_object'>")
	document.write("<param name='nocache' value='true'>")
	document.write("<param name='autoplay' value='true'>")
	document.write("<param name='kioskmode' value='true'>")
	document.write("<param name='controller' value='true'>")
	document.write("<param name='bgcolor' value='#000000'>")
	document.write("<param name='src' value='" + url + "'>")
	document.write("<param name='pluginspage' value='http://www.apple.com/quicktime/download/indext.html'>")

	document.write("<embed width='517' height='404' controller='true' autoplay='true'")
	document.write("src='" + url + "'")
	document.write("kioskmode='true' nocache='true' type='video/quicktime' bgcolor='#000000' border='0'")
	document.write("pluginspace='http://www.apple.com/quicktime/download/indext.html'")
	document.write("</embed></object>")

}

// compliments of squidfingers.com
openWin = function(url,name,width,height,xpos,ypos,chrome,scroll){
  var x, y, w, h, moveX=0, moveY=0, features="";
  chrome = chrome ? "yes" : "no";
  scroll = scroll ? "yes" : "no";
  features += "toolbar="+chrome+",location="+chrome+",status="+chrome+",menubar="+chrome;
  features += ",scrollbars="+scroll+",resizable="+scroll;
  if(width) features += ",width="+width;
  if(height) features += ",height="+height;
  if(xpos && window.screen){
    w = window.screen.availWidth;
    width = parseInt(width);
    switch(xpos){
      case "left": x = 0; break;
      case "center": x = (w-width)/2; break;
      case "right": x = w-width; break;
      default: x = xpos;
    }
    features += ",screenX="+x+",left="+x;
    var moveX = x;
  }
  if(ypos && window.screen){
    h = window.screen.availHeight;
    height = parseInt(height);
    switch(ypos){
      case "top": y = 0; break;
      case "middle": y = (h-height)/2; break;
      case "bottom": y = h-height; break;
      default: y = ypos;
    }
    features += ",screenY="+y+",top="+y;
    var moveY = y;
  }
  openWinReference = window.open(url,name,features);
  if(moveX || moveY){
    // position the window for browsers that don't recognize screenX, screenY
    openWinReference.moveTo(moveX,moveY);
  }
}
openScroll = function(url,name,width,height){
  openWin(url,name,width,height,false,false,false,"scroll");
}
openCenter = function(url,name,width,height){
  openWin(url,name,width,height,"center","middle");
}
openCenterScroll = function(url,name,width,height){
  openWin(url,name,width,height,"center","middle",false,"scroll");
}
openFull = function(url,name){
  openWin(url,name,false,false,false,false,"chrome","scroll");
}
