﻿// JavaScript Document
YAHOO.namespace("help.container");

function STFinderPanel() {
					
					// Define various event handlers for Dialog
					var handleSubmit = function() {
						//mySAF();
					};
					var handleCancel = function() {
						this.cancel();
					};
					var handleSuccess = function(o) {
						//alert("Submission success: " + o.status);
					};
					var handleFailure = function(o) {
						//alert("Submission failed: " + o.status);
					};

                        
					if (YAHOO.util.Cookie.get('missoverlaycook')) {

					    // Instantiate the Dialog closed
					    YAHOO.help.container.STFinderBox = new YAHOO.widget.Panel("helpBox",
																				{ width: "465px",
																				    fixedcenter: true,
																				    modal: false,
																				    draggable: false,
																				    visible: false,
																				    constraintoviewport: true																				    
																				   // effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: 0.45 }
																			 });

					    // Wire up the success and failure handlers
					    YAHOO.help.container.STFinderBox.callback = { success: handleSuccess,
					        failure: handleFailure
					    };

					    YAHOO.help.container.STFinderBox.render();
                        mySTFinderclose();
					
					}
					else {

					    YAHOO.util.Cookie.remove("missoverlaycook");
					    YAHOO.util.Cookie.set("missoverlaycook", "true");

					    // Instantiate the Dialog open
					    YAHOO.help.container.STFinderBox = new YAHOO.widget.Panel("helpBox",
																				{ width: "465px",
																				    fixedcenter: true,
																				    modal: true,
																				    draggable: false,
																				    visible: true,
																				    constraintoviewport: true,
																				    zIndex: "10",
																				    close: false,
																				    autofillheight: false,
																				    effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: 0.45 }
                                                                                    
																				});

					YAHOO.help.container.STFinderBox.setBody(
					
					'<div id="HelpBox">' +
					'<h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h2>' +
                    '<a href="javascript:mySTFinderclose()" id="helpclosebtn" class="helpclosebtn">Close X</a>' +
                    '<div id="HelpBoxInside">' +
                        '<img class="main" id="overlayimg" src="images/home_page_overlay.jpg" alt="Overlay Navigation"/>' +
						'<div id="LeftLink"><a href="javascript:mySTFinderclose()">Continue to Mission Foods site</a><img src="images/overlay_arrow.jpg" alt="Arrow"/></div>'+
						'<div id="RightLink"><a href="FoodService.aspx">Click here for Foodservice site</a><img src="images/overlay_arrow.jpg" alt="Arrow"/></div>' +
						'<div id="LeftCopy"><p>Your source for recipes, cooking tips, and more.</p></div>'+
						'<div id="RightCopy"><p>Our site for professional chefs and restaurant owners.</p></div>'+
				    '</div>' +                         
                '</div>');

					// Wire up the success and failure handlers
					YAHOO.help.container.STFinderBox.callback = { success: handleSuccess,
																 failure: handleFailure };
																
					// Render the Dialog
					YAHOO.help.container.STFinderBox.render();

		}
						
				}

mySTFinderclose = function(){
	YAHOO.help.container.STFinderBox.hide();
}

mySTFinderopen = function(){
	YAHOO.help.container.STFinderBox.show();
}





