function MM_CheckFlashVersion(reqVerStr,msg){
	with(navigator){
		var isIE	= (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
		var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
		if (!isIE || !isWin){	
			var flashVer = -1;
			if (plugins && plugins.length > 0){
				var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
				desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
				if (desc == "") flashVer = -1;
				else{
					var descArr = desc.split(" ");
					var tempArrMajor = descArr[2].split(".");
					var verMajor = tempArrMajor[0];
					var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
					var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
					flashVer =	parseFloat(verMajor + "." + verMinor);
				}
			}
			// WebTV has Flash Player 4 or lower -- too low for video
			else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

			var verArr = reqVerStr.split(",");
			var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
	
			if (flashVer < reqVer){
				if (confirm(msg))
					window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
			}
		}
	} 
}

var newwin;
function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0)
	{
 		setTimeout('newwin.focus();',250);
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {

// by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 2.2.1
	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10, lift;
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
		lift=0.90;
	}
	if(w>=740 & w<835){
		lift=0.91;
	}
	if(w>=835){
		lift=0.93;
	}
	if (imageWidth>w){	
		byFactor = w / imageWidth;			
		imageWidth = w;
		imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
		byFactor = h / imageHeight;
		imageWidth = (imageWidth * byFactor);
		imageHeight = h; 
	}
		 
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
			imageHeight=imageHeight*lift;
		imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
		if (hugMargin == ""){
			hugMargin = 0;
		}
		var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
		if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
		} 
		var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
		if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
		}
		
		if (scrHeight<100){scrHeight=100;}
		if (scrWidth<100){scrWidth=100;}

		posTop =	((h-(scrHeight/lift)-adj)/2);
		posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}

	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
		var args= new Array();
		args[0]='parent';
		args[1]=imageName;
		var i ; document.MM_returnValue = false;
		for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');	
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Click screen to close" >'); 
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}

function fullWindow(url) { 
	var str = "left=0,screenX=0,top=0,screenY=0,resizable=yes, scrollbars=yes";
	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		str += ",height=" + ah;
		str += ",innerHeight=" + ah;
		str += ",width=" + aw;
		str += ",innerWidth=" + aw;
	}
	win=window.open(url, "w", str);
}

var clickmessage="Contents copyright Boar's Head Provisions Co., Inc. All Rights Reserved. For permission to use materials, please contact Boar's Head Marketing at (941) 955-0994."

function disableclick(e) {
	if (document.all) {
		if (event.button==2||event.button==3) {
			if (event.srcElement.tagName=="IMG") {
				alert(clickmessage);
				return false;
			}
		}
	} else if (document.layers) {
		if (e.which == 3) {
			alert(clickmessage);
			return false;
		}
	} else if (document.getElementById) {
		if (e.which==3&&e.target.tagName=="IMG") {
			alert(clickmessage)
			return false
		}
	}
	return(false);
}

function associateimages(){
	for(i=0;i<document.images.length;i++) {
		document.images[i].onmousedown=disableclick;
	}
}

if (document.all) {
	document.onmousedown=disableclick;
} else if (document.getElementById) {
	document.onmouseup=disableclick;
} else if (document.layers) {
	associateimages();
}

var init = function() {
	var mm = $('mainmenu');
	if (mm) {
		mm.getElements('li').each(function(el) {
			el.addEvents({
				mouseenter: function() { this.setStyle('background-color', '#EEEECC');  var z = this.getElement('ul'); if (z) { z.setStyle('display', 'block'); } },     
				mouseleave: function() { this.setStyle('background-color', '#fff');  var z = this.getElement('ul'); if (z) { z.setStyle('display', 'none'); } }              
			});
		});
	}

/*
	$$('*').each(function(el) {
		try  {
			if ((el.get('tag') == 'img') || (el.getStyle('background-image') != 'none')) {
			if (el.get('tag') == 'img') {
				el.addEvent('contextmenu', function(e) { var e = new Event(e).stop(); alert(clickmessage); } );
			}
		} catch (error) {
			// catch moronic IE non-error error. The above works perfectly in IE6/7, but IE *STILL* bitches
		}
	});
*/
}
