function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
function openCart()
{ 
    if ($('#TB_overlay').length==0)
    {tb_show('SHOPPING BASKET','http://www.johnpaulpietrus.com/cms/cart.php?KeepThis=true&TB_iframe=true&width=720&height=500' , false);
    iframeResize();
   }
}

function add2Cart(id)
{ 
    if ($('#TB_overlay').length==0)
    {tb_show('SHOPPING BASKET','http://www.johnpaulpietrus.com/cms/cart.php?add='+id+'&KeepThis=true&TB_iframe=true&width=720&height=500' , false);
    iframeResize();}
}

function checkThickbox()
{
	
if ($('#TB_overlay').length==0)
	{return false;}
else
	{return true;}
}

$(function(){ 
  $('#terms').hide();
  

  
 
});
function iframeResize()
{
$('iframe').load(function()
    {
       contenthref=0;
       try{
       contenthref=this.contentWindow.document.body;
       
       }
        catch(e)
	{
	contenthref=0;
	
	}
       //alert(this.src);
       
       if (contenthref!=0)
		{
		 if ($('#TB_window').width()>750)
{ 
	  
	  $('#TB_window').animate({ 
			marginLeft: -375, width:750 }, "slow");
	$('#TB_iframeContent').animate({ 
			 width:749 }, "fast");
}
		}
	else
		{
		
	$('#TB_window').animate({ 
			marginLeft: -475, width:950 }, "slow");
	$('#TB_iframeContent').animate({ 
			 width:949 }, "slow");
		}
    }

);}
function paypal_increase_window()
{
	self.parent.$('#TB_window').attr('margin-left','-475px').attr('width','950px');

}

function submit_cart()
{
	
	document.forms[0].submit();

}

