﻿/********************************************************
 * Copyright (C) 2002-2003, CodeHouse.com. All rights reserved.
 * CodeHouse(TM) is a registered trademark.
 *
 * THIS SOURCE CODE MAY BE USED FREELY PROVIDED THAT
 * IT IS NOT MODIFIED OR DISTRIBUTED, AND IT IS USED
 * ON A PUBLICLY ACCESSIBLE INTERNET WEB SITE.
 * 
 * CodeHouse.com JavaScript Library Module: Get Current Style Method
 *
 * You can obtain this script at http://www.codehouse.com
 ********************************************************/
function CJL_getCurrentStyle(elem, prop)
{
   if( elem.currentStyle )
   {  
      var ar = prop.match(/\w[^-]*/g);
      var s = ar[0];
      
      for(var i = 1; i < ar.length; ++i)		   
      {
         s += ar[i].replace(/\w/, ar[i].charAt(0).toUpperCase());
      }
           
      return elem.currentStyle[s]
   }
   else if( document.defaultView.getComputedStyle )
   {
      return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
   }
}
colorparam2 = CJL_getCurrentStyle(document.getElementById("body"),"background-color");
colorparam2 = colorparam2.replace(/#/g, '');
colorparam1 = "999999";
videopathwatch = videopath.replace(/\/v\//, '/watch?v=');
videopathimage = videopath.replace(/www/, 'img');
videopathimage = videopathimage.replace(/\/v\//, '/vi/');
document.write("<OBJECT data=\""+videopath+"&fs=1&rel=0&color1=0x"+colorparam1+"&color2=0x"+colorparam2+"\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" width=\"400\" height=\"330\">");  
document.write("<PARAM name=\"movie\" value=\""+videopath+"&fs=1&rel=0&color1=0x"+colorparam1+"&color2=0x"+colorparam2+"\">");
document.write("<PARAM name=\"allowFullScreen\" value=\"true\">");
document.write("<!-- Fallback content --> ");
document.write("<a href=\""+videopathwatch+" \" >");
document.write("<img src=\""+videopathimage+"/0.jpg\" width=\"400\" height=\"330\" alt=\"Youtube Video\" />");
document.write("</a> ");
document.write("</OBJECT> ");
