﻿Initialize();
function Initialize()
{
   var url;
   var _frameWidth;
   var _frameHeight;
   var sitePath = 'http://www.authorSTREAM.com/';
   var rows;
   var cols;
   
   if(_rows > 10)
   {
     _rows = 10;
   }
   
   if(_cols > 10)
   {
     _cols  = 10;
   }
   
   try
   {
       if(_UserId==null || _UserId=="" || _UserId=="undefined")
       {  
         return false;
       }
   }
   catch(ex)
   {
        return false;
   }
     
           try
           {
               if(_cols == "" || _cols == null || _cols == "undefined" || (isNaN(_cols)))
               {
                 _cols = 1;
                 _frameWidth = 173;
               }
               else
               {
                 _frameWidth = (_cols * 118) + ((_cols + 1) * 3) + 8 * (_cols + 3)-_cols+18;
                 
               }
           }
           catch(ex)
           {
             _frameWidth = 173;
           }
           
           
           
           try
           {
               if(_rows == "" || _rows == null || _rows == "undefined" || (isNaN(_rows)))
               { 
                   _rows = 3;
                   _frameHeight= 354;
                   _frameWidth = 414;
                  
               }
               else
               {
                  //_frameHeight = _rows * 94 + (6 * _rows - 4) + 58;
                  _frameHeight = 540;
               }
           }
           catch(ex)
           {
             _frameHeight= 354;
           }
           
           try
           {
                  if(_rows <= 5)
                   {
                      _frameHeight = _rows * 94 + (6 * (_rows+1)-_rows) + 58;
                      _frameWidth = (_cols * 118) + ((_cols + 1) * 3) + 8 * (_cols + 3);
                      
                       url = ""+sitePath+"/Account/WidgetPPT.aspx?wid_userid="+_UserId+"&wid_rows="+_rows+"&wid_cols="+_cols+"&wid_heading="+_heading+"";
                       document.write("<iframe src='" + url + "' scrolling=no allowTransparency='true' style='background-color:"+_backcolor+";width:"+_frameWidth+"px;height:"+_frameHeight+"px;border-style:solid; border-width:1px; border-color:#cccccc' frameborder=no;></iframe>");  
                   }
                   else
                   {
                       url = ""+sitePath+"/Account/WidgetPPT.aspx?wid_userid="+_UserId+"&wid_rows="+_rows+"&wid_cols="+_cols+"&wid_heading="+_heading+"";
                       document.write("<iframe src='" + url + "' scrolling=yes allowTransparency='true' style='background-color:"+_backcolor+";width:"+_frameWidth+"px;height:"+_frameHeight+"px;border-style:solid; border-width:1px; border-color:#cccccc' frameborder=no;></iframe>");
                   }
           }
           catch(ex)
           {
              url = ""+sitePath+"/Account/WidgetPPT.aspx?wid_userid="+_UserId+"&wid_rows=3&wid_cols=1&wid_heading=default";
              document.write("<iframe src='" + url + "' scrolling=yes allowTransparency='true' style='background-color:#FFFFFF;width:173px;height:354px' frameborder=no;></iframe>");
           }
   
}


