function createPopup()
{
 
  var HTML_CONTENT="<div id='webguru_video_popup_box'><div class='vid_pop_up_bg'></div><div class='youtubeContainer'></div><div class='crossBt'></div></div>";
  $('body').append(HTML_CONTENT);  
  resizeVidPopUp();
  $(window).resize(resizeVidPopUp);
  $('#webguru_video_popup_box .crossBt').bind('click',function(){$('#webguru_video_popup_box').hide(); })
  appear(true);
  applyVideo('http://www.youtube.com/embed/UWrupWsH_8k');
}

function resizeVidPopUp()
{
  var W = $(window).width();
  var H = $(window).height();
  var wa = $('#webguru_video_popup_box .youtubeContainer').css('width');
  var ha = $('#webguru_video_popup_box .youtubeContainer').css('height');
  
  var leftAmount = (W - parseInt(wa))/2;
   var topAmount = (H - parseInt(ha))/2;
  $('#webguru_video_popup_box .vid_pop_up_bg').css({
												   'opacity':0.8,
												   'width':W+'px',
												   'height':H+'px'
												   });
 
   $('#webguru_video_popup_box .youtubeContainer').css({
												   'left':leftAmount,
												   'top':topAmount,
												   'box-shadow':'10px 10px 20px #000',
												   '-webkit-box-shadow':'0px 0px 20px #000',
												   '-moz-box-shadow':'10px 10px 20px #000'
												   });
  
  $('#webguru_video_popup_box .crossBt').css('left',(parseInt($('#webguru_video_popup_box .youtubeContainer').css('left'))+parseInt(wa)-5)+'px');
  $('#webguru_video_popup_box .crossBt').css('top', (parseInt($('#webguru_video_popup_box .youtubeContainer').css('top'))-53)+'px');
 
}

function applyVideo(path)
{	
  	var CONTENT = '<iframe title="YouTube video player" width="640" height="390" src="'+path+'" frameborder="0" allowfullscreen></iframe>'
	$('#webguru_video_popup_box .youtubeContainer').html(CONTENT);
}

function appear(bool)
{
   if(bool)	
   {
	 
	 $('#webguru_video_popup_box').fadeIn('slow');  
   }
   else
   {
	 $('#webguru_video_popup_box').hide('fast');    
   }
   
}

