
// docwrite.js
var fw = (2*page_width+45); // 2 pages + margins
var fh = page_height+80; // page + margins
if (fh<400) fh = 400;	// minimum height for flash component

var flashvars = 'e='+jsp_path+'&v='+v+'&n='+page_number+'&l='+is_large+'&w='+page_width+'&bh='+by_height+
    			'&sl='+slIds+'&sb='+se+'&ee='+ee+'&pu='+pu+'&bl='+bl+'&cl='+cl+'&p='+pdf_enabled+
    			'&s='+sl_enabled+'&ce='+coupons_enabled+'&ct='+coupons_tip+'&cp='+coupon_is_link+
    			'&zd='+zoom_disabled+'&pd='+print_disabled+'&sv='+single_view+
    			'&de='+page_text_enabled+'&cd='+circle_disabled+
    			'&sd='+psdate+'&ed='+edate+
    			'&fo=true'; //standalone flash only, no browse mode controls
//alert(flashvars);

if(hasRightVersion) {  // if we've detected an acceptable version
 
    var oeTags = '<object id="flashView" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
    + 'width="'+fw+'" height="'+fh+'" align="center" '
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="circular.swf" />'
    + '<param name="quality" value="high" />'
    + '<param name="scale" value="exactfit" />'
    + '<param name="loop" value="false" />'
    + '<param name="menu" value="false" />'
    + '<param name="wmode" value="opaque" />'
    + '<param name="bgcolor" value="#ffffff" />'
    + '<param name="flashvars" value="'+flashvars+'" />'
    + '<embed id="flashView1" src="circular.swf" quality="high" '
    + 'scale="exactfit" wmode="opaque" bgcolor="#ffffff" '
    + 'width="'+fw+'" height="'+fh+'" '
    + 'name="circular" align="center" '
    + 'play="true" '
    + 'loop="false" '
    + 'menu="false" '
    + 'quality="high" '
    + 'allowScriptAccess="sameDomain" '
    + 'type="application/x-shockwave-flash" '
    + 'flashvars="'+flashvars+'" '
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '</embed>'
    + '</object>';
    
    document.write(oeTags);   // embed the flash movie & help controls
    
} else 
{  
	// flash is too old or we can't detect the plugin
    var alternateContent = '<div class="stdtext" style="padding-left:15px;width:'+fw+'">'
    + '<br>Sorry, we cannot display our catalog in Flash on your computer.'
    + '<br>To view the catalog, make sure that:'
    + '<ul class="stdtext"><li>Your browser is set to allow browser plug-ins.</li>'
    + '<li>You have Adobe Flash Player version 8 or later.</li></ul>'
    + 'To download the most recent version of the Flash Player, click the following link:'   
    + '<ul class="stdtext"><a href="http://www.macromedia.com/go/getflash/" target="_blank">Download Adobe Flash Player</a></ul>'
    + '<br>&nbsp;</div>';
    document.write(alternateContent);  // insert non-flash content
}

function resizeFlash(new_h)
{
//alert(new_h);
	var new_height = new Number(new_h+100);	// page + margins
	
	var o = document.getElementById("flashView");
	if (o!=null)
	{
//alert(o.height+" "+new_height);
		//if ( new Number(o.height) < new_height )
			o.height = new_height;
	}
	
	o = document.getElementById("flashView1");
	if (o!=null)
	{
//alert(o.height+" "+new_height);
		//if ( new Number(o.height) < new_height )
			o.height = new_height;
	}
}

