// JavaScript Document
			   
	//function to show dialog   
    showDialog = function( newText, newTitle, emailAddress ) {
	
	$myWindow = jQuery('#dialogDiv');

	//grab the content from the #colOne div
	var newContent = newText + ' #colOne';
	
	//instantiate the dialog
	$myWindow.load(newContent,function(response, status, xhr) {
  if (status == "success") {
	  
	  		//put an email address on the top of the page
	 		$('<div class="mini-nav noEscape"><ul class="alt"><li><a onClick="var s=s_gi(s_account); s.linkTrackVars=\'events\'; s.linkTrackEvents=\'event38\'; s.events=\'event38\'; s.tl(this,\'o\',\'Open Position Application: ' + newTitle + '\');" href="mailto:' + emailAddress + '@webroot.com?subject=' + newTitle + ' | WS">Apply for this position</a></li><li><a href="/shared/careers/career-print.html?path=' + newText + '&eml=' + emailAddress +'" target="_blank">Print</a></li></ul></div>').prependTo('div#dialogDiv.ui-dialog-content #colOne .inner');

			//put in the ending text,email address and About Webroot at the end
			
			$(boilerA + "<a onClick='var s=s_gi(s_account); s.linkTrackVars=\'events\'; s.linkTrackEvents=\'event38\'; s.events=\'event38\'; s.tl(this,\'o\',\'Open Position Application: ' + newTitle + '\');' href='mailto:" + emailAddress + "@webroot.com?subject=" + newTitle + " | WS\'>" + emailAddress + "@webroot.com</a> " + boilerB).appendTo('div#dialogDiv.ui-dialog-content #colOne .inner');
			
  		};
			
	}).dialog({ height:700,
				width: 760,
				modal: true,
				position: 'center',
				autoOpen:true,
				title:newTitle,
				overlay: { opacity: 0.9, background: 'black'}
				});

		
        //if the contents have been hidden with css, you need this
        $myWindow.show(); 
		
		
		
        //open the dialog
        $myWindow.dialog("open");
		
		//put the window and overlay above the locale selector
		$('.ui-widget-overlay').css('z-index', 99998);
		$('.ui-dialog').css('z-index',99999);
		$('.ui-widget').css('z-index',99999);
		$('.ui-widget-content').css('z-index',99999);
		$('.ui-corner-all').css('z-index',99999);
		$('.ui-draggable').css('z-index',99999);
		$('.ui-resizable').css('z-index',99999);	
     }

    //function to close dialog, probably called by a button in the dialog
    closeDialog = function() {
		$myWindow.dialog( "destroy" );

        $myWindow.dialog("close");
    }
	
