﻿// 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 ($.cookie('missoverlaycook')) {
					   

					    YAHOO.help.container.STFinderBox = new YAHOO.widget.Panel("helpBox",
																				{ width: "461px",
																				    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 {
					    $.cookie('missoverlaycook', 'true', { expires: -1 });
					    $.cookie('missoverlaycook', 'true');

					    // Instantiate the Dialog closed
					    YAHOO.help.container.STFinderBox = new YAHOO.widget.Panel("helpBox",
																				{ width: "461px",
																				    fixedcenter: true,
																				    modal: true,
																				    draggable: false,
																				    visible: true,
																				    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 };
																
					// Render the Dialog
					//YAHOO.help.container.helpBox.render();
//					myQID = displayItem('chicago');
//					if(myQID){
						YAHOO.help.container.STFinderBox.render();
//					}
					//YAHOO.util.Dom.setStyle(['HelpBoxInside'], 'overflow', 'hidden');
					
					//YAHOO.util.Event.addListener("myHelpbtn", "click", YAHOO.help.container.helpBox.show, YAHOO.help.container.helpBox, true);
					//YAHOO.util.Event.addListener("helpclosebtn", "click", YAHOO.help.container.helpBox.hide, YAHOO.help.container.helpBox, true);

//						if ($.cookie('missoverlaycook')) {
//						    mySTFinderclose();
//						}
//						else {
//						    $.cookie('missoverlaycook', 'true', { expires: -1 });
//						    $.cookie('missoverlaycook', 'true');
//						}
		}
						
				}

mySTFinderclose = function(){
	YAHOO.util.Dom.setStyle(['HelpBoxInside'], 'overflow', 'hidden');
	YAHOO.help.container.STFinderBox.hide();
}

mySTFinderopen = function(){
	YAHOO.util.Dom.setStyle(['HelpBoxInside'], 'overflow', 'auto');
	YAHOO.help.container.STFinderBox.show();
}




