/* Version: $Id: modal.js 824 2010-04-09 12:06:32Z vysohlidm $ */

/**
 * Modal window object
 * @author Jozef Lukac, LMC s.r.o.
 */


/**
* We are using YUI. We need Dictionary, URLManager and also some files: container-min.js, dispatcher-min.js, utilities.js
*
*
* All u need to use Modal window is register an event and appropriate method and pass some params to the method.
* Let's say u want to register modal template 'basketModalTemplate' which shows on click at the elemnt with id='click_me'.
* U can do it by following:
*    Modal.register('click_me', 'click', "tpl", {header: __('basket'), tpl: 'basketModal', preventDefault : true});
*
* Using: Moda.register([element],[event],[method], [object of params])
*
* element can be an object as well, if event is ommited, click will be used,
*
* method can be:
*   tpl-for showing template,
*  elm- for showing some element content inside the window, or
*  url- for showing some url inside the window
*/

var util = YAHOO.util;

/**
* Main Modal window object
*/
var Modal = {

		  /**
		  * Initializes the modal window
		  *
		  * @param DomElement|null renderObj
		  * @returns void
		  */
		    init : function(name, renderObj) {
			if (!this._windows) {
				this._windows = {};
			}
			if (!this._windowStack) {
				this._windowStack = [];
			}
			
		    this._windows[name] = new YAHOO.widget.Panel("modal-window-"+name,{
		      width: this.modalWidth,
		      fixedcenter: true,
		      close: true,
		      draggable: true,
		      zIndex:1000,
		      modal: true,
		      visible: false,
		      constraintoviewport: true,
		      underlay: 'none',
		      effect:[{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.3}]
		      });
		     this._windows[name].setBody('');
		     this._windows[name].setHeader('');
		     if (renderObj) {
		    	 this._windows[name].render(renderObj);
		     } else {
		    	 this._windows[name].render(document.body);
		     }
		     this._windowStack[this._windowStack.length] = name;
		    },
		    
		    /**
		  * Sets the contents of the window.
		  *
		  * @param string pHeaderStr window header
		  * @param string pBodyStr window content
		  * @param object pTemplate
		  */
		    set : function(pHeaderStr, pBodyStr, pTemplate) {    	
		      var name = pTemplate.toString();
		      if (!this._windows || !this._windows[name]) {
		    	if (pTemplate.getRenderObj) {
		    		this.init(name, pTemplate.getRenderObj());
		    	} else {
		    		this.init(name);
		    	}
		      } 
		    	  
		    	  
		      if (pBodyStr) this._windows[name].setBody(pBodyStr);
		      if (pHeaderStr) this._windows[name].setHeader(pHeaderStr);
		      
		      if (typeof pTemplate.showEvent != 'undefined') {
		    	  this._windows[name].showEvent.subscribe(pTemplate.showEvent);
		      }
		      this._windows[name].show();
		    },

		    /**
		  * Hides the window.
		  *
		  * @returns void
		  */
		    hide : function(name){
		      if (!name) {
		    	  name = this._windowStack.pop();
		      }
		      if (this._windows[name]) {
		    	  this._windows[name].hide();    	  
		    	  this._windows[name] = null;
		      }
		    },

		    /**
		  * Method for displaying URL inside the window
		  *
		  * @param string pHeaderStr window header
		  * @param string pUrl URL of the page to display
		  */
		    showUrl : function(pHeader, pUrl) {
		      var callback = {
		      onLoad : function(o) {
		        Modal.hide();
		        Modal.set(pHeader, o.innerHTML);
		         },
		      onStart : function(o) {
		        Modal.set(__('Loading'), __('Please wait'));
		      }
		      }
		      /**
		      * We need an element to put the content into, so we create one first.
		      */
		      if (!document.getElementById('Modal-result-container')) {
		        var el = document.createElement("div");
		        el.id = 'Modal-result-container';
		        el.style.display = 'none';
		        document.body.appendChild(el);
		      }
		      YAHOO.util.Dispatcher.fetch('Modal-result-container', pUrl, callback);
		    },
		    /**
		  * Method for displaying Element inside the window.
		  *
		  * @param string pHeaderStr window header
		  * @param string pElmId id of the element to display
		  */
		  showElm : function(pHeader, pElmId) {
		    var lElm = document.getElementById(pElmId);
		    if (!lElm) {return false;}

		    this.set(pHeader, lElm.innerHTML);
		    return true;
		  },

		    /**
		  * Method for displaying a template inside the window.
		  *
		  * @param string pHeaderStr window header
		  * @param string pTpl a template to display
		  */
		  showTpl : function(pHeader, pTpl, pTplVars) {
		    /**
		    *  We have the name of the template, but we need template object. Ugly hack...
		    */
		    try {
		      var tpl = eval(pTpl);
		    }
		    catch (err) {
		      try {
		                    console.warn('no such template loaded '+pTpl);
		            }
		            catch(err){

		            }
		      /*
		      * We do not have such template, probably...
		      */
		      return false;
		    }
			if (pTplVars && pTplVars['modalWidth']) {
				this.modalWidth = pTplVars['modalWidth']; 
			} else {
		    	this.modalWidth = "340px";
			}
		    /**
		    * Set the variables that we want to override
		    */
		    if(pTplVars) {
		      for(lVar in  pTplVars) tpl.vars[lVar] = pTplVars[lVar];
		    }
		    this.set(pHeader, tpl.get(), tpl);
		    return tpl;
		  },

		    /**
		  * Registers event and method with args to call.
		  *
		  * @param string pElmId: id of the element to observe
		  * @param string pEvent: name of the event. If ommited, click will be used
		  * @param string pMethod: a method of Modal to call when pEvent occures. This corresponds to the method of this class written in lower-case without show prefix, 'url','elm','tlp' etc...
		  * @param array pArgs: Array of arguments for callback f-cion
		  */
		  register : function(pElmId, pEvent, pMethod, pArgs) {

		    pArgs['pMethod'] = pMethod;
		    if (!pEvent) pEvent = 'click';
		    YAHOO.util.Event.on(pElmId, pEvent, Modal.dispatch, pArgs);


		    /**
		    * Just some d-Bug infos. Uncomment following...
		    */

		    /*var lArgs = "";
		    if(pArgs) {
		      for(lArg in  pArgs) lArgs += lArg + '=' + pArgs[lArg] + ",";
		    }
		    console.warn('Modal: new evet registered: ' + pEvent + ', elmId: ' + pElmId + ', method: ' + pMethod + ',args: ' + lArgs);
		    */
		  },

		    /**
		  * Method for dealing with registered events. It's responsible for calling proper method with proper args when event occures on element.
		  * This method shoul not be called directly
		  *
		  * @param string pEvent: event to observe
		  * @param array pArgs: array of args for Method
		  */
		  dispatch : function(pEvent, pArgs) {
			var tpl = null;
		    switch (pArgs['pMethod']) {
		      case 'url':
		          /**
		          * Set the preventDefault for all registered showUrl calls
		          */
		          pArgs['preventDefault'] = true;
		          Modal.showUrl(pArgs['header'], pArgs['url']);
		        break;
		      case 'elm':
		          Modal.showElm(pArgs['header'], pArgs['id']);
		        break;
		      case 'tpl':
		          tpl = Modal.showTpl(pArgs['header'], pArgs['tpl'], pArgs['vars']);
		        break;
		    }
		    if ((pArgs['preventDefault'] && pArgs['preventDefault'] == true) 
		    		|| (tpl != null && tpl.preventDefault && tpl.preventDefault() == true)) {    	
		      if(YAHOO.env.ua.ie) pEvent.returnValue = false;
		      else  YAHOO.util.Event.preventDefault(pEvent);
		    }
		    if(pArgs['focus'] && document.getElementById(pArgs['focus'])) {
		      document.getElementById(pArgs['focus']).focus();
		    }
		  }
		}


/**
* Modal Templates definitions
*/

callbackBasket = {
		success: function(o) {
					},
		failure: function(o) {
					},
		argument: []
}
function setBasketPopup() {
        var requestURL;
        if (document.domain.match('^absolvent\.') !== null) {
            requestURL = URLManager.getUrl('Absolvent_Basket_Popup');
        } else if (document.domain.match('^brigad\.') !== null) {
            requestURL = URLManager.getUrl('Temporary_Basket_Popup');
        } else {
            requestURL = URLManager.getUrl('Basket_Popup');
        }
	var transaction = YAHOO.util.Connect.asyncRequest('GET', '' + requestURL, callbackBasket, null);
}

var basketModalTemplate ={
  vars : {},
  get : function(){
  	var offerStr = '';
  	if(basketCount && basketCount>0){
  	    switch (basketCount){
  	    	case 1:
  	    		offerStr = __('Jobs_JD_1_Nabidku');
  	    		break;
  	    	case 2:
				offerStr = __('Jobs_JD_2_Nabidky');
				break;
			case 3:
				offerStr = __('Jobs_JD_3_Nabidky');
				break;
			case 4:
				offerStr = __('Jobs_JD_4_Nabidky');
				break;
			case 5:
				offerStr = __('Jobs_JD_5_Nabidek');
				break;
			default:
				offerStr = __('Jobs_JD_5_Nabidek');
				break;
		}
  	}
  	
    return  '<div id="modal-basket" style="display:block;"><img src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" alt="" align="left" class="good_ghost" /><br /> ' +
      '<strong>'+ __('add2cart') + '</strong><br />' +
      ''+ __('in_cart') + ' <span id="basketCnt3">' + basketCount + ' ' + offerStr + '</span><br />' +
      '<div style="margin-left:42px">' +
        '<form action="#" method="post" name="login_form" style="font-size:11px">' +
          '<br />' +
          '<input class="cbx" type="checkbox" name="checkbox" value="checkbox" style="width:15px;height:15px;margin:0px" />' +
          '&nbsp;&nbsp;' + __('noshow_again') + '<br />' +
          '<br />' +
          '<div class="clear"></div>' +
          '<table width="100%" border="0" cellpadding="0" cellspacing="0">' +
            '<tr>' +
             '<td align="left">' +
              '<input name="button" type="button" class="submit_basket" value="'+ __('show_cart') + '" onclick="if(document.login_form.checkbox.checked) { setBasketPopup(); setTimeout(function() {document.location=URLManager.getUrl(\'Jobs_Muj_Basket\');}, 2000); } else { document.location=URLManager.getUrl(\'Jobs_Muj_Basket\'); }"/>' +
             '</td>' +
             '<td align="right">' +
        		'<input name="button" type="button" class="submit" value="'+ __('global.continue') + '" onclick="if(document.login_form.checkbox.checked) setBasketPopup(); Modal.hide();" />' +
             '</td>' +
            '</tr>' +
          '</table>' +
        '</form>' +
      '</div>' +
    '</div>';
  }

}



var emptySearchModalTemplate = {
  vars : {},
  get : function(){
    return '<div>'+
    			'<img align="left" alt="duch" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" class="good_ghost" />'+
      '<p>' + __('PleaseChooseAtLeastOneItemSoIWillKnowWhatToFind') + '</p><br />'+
      '<form action="#" method="post" style="font-size:11px; text-align: center;">'+
        '<input name="button" type="button" class="submit" value="'+ __('global.continue') + '" onclick="Modal.hide();" />'+
      '</form>'+
    '</div>';
    }
}

var overloadSearchModalTemplate = {
		  vars : {},
		  get : function(){
		    return '<div>'+
		    			'<img align="left" alt="duch" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" class="good_ghost" />'+
		      '<p>' + __('PleaseUnselectSomeItems') + '</p><br /><br />'+
		      '<form action="#" method="post" style="font-size:11px; text-align: center;">'+
		        '<input name="button" type="button" class="submit" value="'+ __('global.continue') + '" onclick="Modal.hide();" />'+
		      '</form>'+
		    '</div>';
		    }
		}

var searchFormSimpleTemplate = {
  vars :
  {
	lLocalityOptions : '',
  	lLocModalBranch : ''
  },
  get : function(){
	var localityOptions = this.vars.lLocalityOptions.replace(/&gt;/g, '>').replace(/&lt;/g, '<').replace(/&amp;/g,'&');
    return '<div id="modal-search-locality">'+
		'<img align="left" alt="duch" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" class="good_ghost" /><strong>' + __('JOBS_T_Modal_Locality_Select') + '</strong> '+
		'<br /><br />'+
		    '<form action="' + URLManager.getUrl('Jobs_form_dispatcher') + '" method="get" target="_top" name="locModalForm">'+
				'<input type="hidden" name="module" value="JobsSearchResults" />'+
				'<input type="hidden" name="lang" value="' + URLManager.getLang() + '" />'+
				'<input type="hidden" name="srch[prof][]" value="' + this.vars.lLocModalBranch + '" id="locModalBranch" />'+
				'<input type="hidden" name="srch[from]" value="simple" />'+
				'<input type="hidden" name="srch[agent][]" value="202900001" />'+
				'<input type="hidden" name="srch[agent][]" value="202900002" />'+
                                '<input type="hidden" name="srch[agent][]" value="202900005" />'+
				'<input type="hidden" name="srch[emp][]" value="201300001;201300002" />'+
				  '<select name="srch[local]" style="margin:20px; margin-left:40px; width:250px;">'+
				  	localityOptions+
				  '</select>'+
				  '<div align="right">'+
					'<input name="submit" type="submit" class="submit" value="' + __('global.continue') + '"/>'+
				  '</div>'+
		    '</form>'+
		'</div>';
	}
}

var validationResultTemplate = {
  vars : {
  	title : 'pleaseCheckThisDataBeforeSubmit',
	submit_title : 'defaultCONTINUE',
  	errs: null
  },
  get : function(){
    // solve defaults, so case when calling of dictionary for translation is necessary
    if (this.vars.title == 'pleaseCheckThisDataBeforeSubmit') this.vars.title = __(this.vars.title);
    if (this.vars.submit_title == 'defaultCONTINUE') this.vars.submit_title = __('global.continue');
	  var err = '<div style="margin: 8px 8px 8px 42px; line-height: 150%;">';
	  err+= '<p>' + (this.vars.title? '<span style="color:red">' + this.vars.title + '</span><br />' : '') ;

  	  if(this.vars.errs) {
        for(var i in this.vars.errs) {
	  	  err+= '<strong><span style="color: red;">*</span> ' + this.vars.errs[i] + '</strong> <br />';
	  	}
		  err += "</p></div>";
  		};
      return '<div>' +
		'<img src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" alt="" align="left" style="margin-right:5px" />' +
		  err +
	    '</div>' +
	    '<div style="float: right;">' +
	  	  '<input class="submit" value="' + this.vars.submit_title + '"  onclick="Modal.hide();" type="submit"><br />&nbsp;' +
	    '</div>' +
	    '<div class="clear"><br />&nbsp;</div>&nbsp;';
  } // get
}

var attachmentValidationTemplate = {
  vars : {
	title: 'noAttachmentAttachedSendAnyway',
	submit_title : 'defaultSEND',
	cancel_title : 'defaultCANCEL',
	isValid : false
	},
  get : function(){
    // solve defaults, so case when calling of dictionary for translation is necessary
    if (this.vars.title == 'noAttachmentAttachedSendAnyway') this.vars.title = __(this.vars.title);
    if (this.vars.cancel_title == 'defaultCANCEL') this.vars.cancel_title = __('CANCEL');
    if (this.vars.submit_title == 'defaultSEND') this.vars.submit_title = __('SEND');
  
 	if(this.validate()) return Modal.hide();
	return '<div>' +
		'<img src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" alt="" align="left" style="margin-right:5px" />' +
		'<br />'+
		'<strong>' + this.vars.title + '</strong>' +
		'<br /><br />' +
		'<div style="float:right">' +
		'<input value="' + this.vars.submit_title + '" class="submit" onclick="document.getElementById(\'questionary\').submit();" type="submit" />' +
		'&nbsp;<input type="submit" class="submit" value="' + this.vars.cancel_title + '" onclick="Modal.hide();" />' +
	'</div>'+
	'<div class="clear">&nbsp;</div>&nbsp;';
    },
  validate: function(){
	var questionaryForm = document.getElementById('questionary');
	for (var i= 0; i<questionaryForm.length; i++){
		if(questionaryForm.elements[i].type == 'file'){
			if(questionaryForm.elements[i].value != '') {
				return true;
			}
		}
	}
	return false;
    }
}


var sendToAFriendTemplate = {
  vars : {
	pdjd_id: 0,
	pdjd_name: '',
	pdjd_url: '',
	email_r: '',
	name: '',
	email: ''
	},
  get : function(){
	return '<form style="font-size:11px" name="nazor" method="get" action="/" xmlns="http://www.w3.org/1999/xhtml" onsubmit="return recommendCheck();">'+
			'<input type="hidden" id="pdjd_id" name="pdjd_id" value="' + this.vars.pdjd_id + '"/>' +
			'<input type="hidden" id="pdjd_name" name="pdjd_name" value="' + this.vars.pdjd_name + '"/>' +
			'<input type="hidden" name="jdurl" value="' + this.vars.pdjd_url + '"/>'+
			'<input type="hidden" name="send" value="send"/>'+
			'<input type="hidden" name="module" value="JobForward"/>' +
			'<input type="hidden" name="lang" value="' + URLManager.getLang() + '"/>' +
			'<div class="quad">'+
				'<table cellspacing="0" cellpadding="2" class="txt12">' +
					'<tr>' +
						'<td align="right" style="width:110px; !width: 140px;">' +
							'<span class="red">*</span>' +
							'<strong>' + __('recipientsEmail') + ':</strong>' +
						'</td>' +
						'<td align="right">' +
							'<input class="txtinp" type="text" name="email_r" id="email_r" value="' + this.vars.email_r + '" />' +
						'</td>' +
					'</tr>' +
					'<tr>' +
						'<td align="right">' +
							'<span class="red">*</span>' +
								'<strong>' + __('yourName') + ':</strong>' +
						'</td>'+
						'<td align="right">' +
							'<input class="txtinp" type="text" name="name" id="name_r" value="' + this.vars.name + '" />' +
						'</td>' +
					'</tr>' +
					'<tr>' +
						'<td align="right">' +
							'<span class="red">*</span>' +
							'<strong>' + __('yourEmail') + ':</strong>' +
						'</td>' +
						'<td align="right">' +
							'<input class="txtinp" type="text" name="email" id="youremail_r" value="' + this.vars.email + '" />' +
						'</td>' +
					'</tr>' +
					'<tr>' +
						'<td colspan="2"> </td>' +
					'</tr>' +
					'<tr>' +
						'<td colspan="2">' +
							'<strong>' + __('message') + ':</strong>' +
						'</td>' +
					'</tr>' +
					'<tr>' +
						'<td colspan="2" align="right">' +
							'<textarea style="width:290px" class="txtinp" rows="5" name="message"></textarea>' +
						'</td>' +
					'</tr>' +
					'</table>'+
				'</div>'+
				'<div style="text-align:right">' +
					'<input value="' + __('SEND') + '" class="submit" type="submit"/>' +
				'</div>' +
			'</form>';
	}
}


var recommendToAFriendTemplate = {
  vars : {
		pdjd_id: 0,
		pdjd_name: '',
		pdjd_url: '',
		email_r: '',
		firstname: '',
		surname: '',
		email: '',
		phone: '',
		companyName: ''
	},
  get : function(){
	return '<form action="/" method="get" name="nazor" style="font-size:11px" xmlns="http://www.w3.org/1999/xhtml" onsubmit="return recommendCheck2();">' +
			'<input type="hidden" id="pdjd_id_2" name="pdjd_id" value="' + this.vars.pdjd_id + '" />' +
			'<input type="hidden" id="pdjd_name_2" name="pdjd_name" value="' + this.vars.pdjd_name + '"/>'+
			'<input type="hidden" name="jdurl" value="' + this.vars.pdjd_url + '"/>'+
			'<input type="hidden" name="module" value="JobRecommend"/>'+
			'<input type="hidden" name="send" value="send"/>'+
			'<input type="hidden" name="lang" value="' + URLManager.getLang() + '"/>' +
			'<div class="quad">'+
				'<table class="txt12" cellpadding="2" cellspacing="0">'+
					'<tr>'+
						'<td colspan="2">'+
							'<img style="margin-right: 10px; margin-bottom: 10px; float: left;" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif"/>'+							
							'<div style="float: left; width: 250px; margin-top: 5px;">' + __('Jobs_JD_T_PreposlatDoporuceniText') + '</div>' +
							'<br style="clear: both" />' +
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td style="width:110px; !width: 140px;" align="right">'+
							'<span class="red">*</span>'+
							'<strong>' + __('recipientsEmailAddress') + ':</strong>'+
						'</td>'+
						'<td>'+
							'<input id="email_r" name="email_r" type="text" class="txtinp" style="width:154px" value="' + this.vars.email_r + '"/>'+
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td align="right">'+
							'<span class="red">*</span>'+
							'<strong>' + __('yourName') + ':</strong>'+
						'</td>'+
						'<td>'+
							'<input id="name_r" name="firstname" type="text" class="txtinp" style="width:154px" value="' + this.vars.firstname + '"/>'+
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td align="right">'+
							'<span class="red">*</span>'+
							'<strong>' + __('yourSurname') + ':</strong>'+
						'</td>'+
						'<td>'+
							'<input id="surname_r" name="surname" type="text" class="txtinp" style="width:154px" value="' + this.vars.surname + '"/>'+
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td align="right">'+
							'<span class="red">*</span>'+
							'<strong>' + __('yourEmail') + ':</strong>'+
						'</td>'+
						'<td>'+
							'<input id="youremail_r" name="email" type="text" class="txtinp" style="width:154px" value="' + this.vars.email + '" />'+
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td align="right">'+
							'<strong>' + __('yourPhone') +':</strong>'+
						'</td>'+
						'<td>'+
							'<input id="yourphone_r" name="phone" type="text" class="txtinp" style="width:154px" value="' + this.vars.phone + '" />'+
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td>&#160;</td>'+
						'<td class="txt11">'+
							'<input name="internal_employee" type="checkbox"></input>&#160;' + __('iAmAnEmployeeOf') + ' <span id="firmName">' + this.vars.companyName + '</span>' +
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td colspan="2">&#160;</td>'+
					'</tr>'+
					'<tr>'+
						'<td colspan="2">'+
							'<strong>' + __('message') + ':</strong>'+
						'</td>'+
					'</tr>'+
					'<tr>'+
						'<td colspan="2">'+
							'<textarea name="message" rows="5" class="txtinp" style="width:280px"></textarea>'+
						'</td>'+
					'</tr>'+
				'</table>'+
			'</div>'+
			'<div style="float:right">'+
				'<input name="submit" type="submit" class="submit" value="' + __('SEND') + '" />'+
			'</div><br /><br />'+
			'<div class="clear"></div>'+
		'</form>';
	}
}


var positionSentSuccessfulyTemplate = {
  vars : {
	message : '',
    email : ''
	},
  get : function(){
	return '<img class="good_ghost" alt="" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" align="left">' +
	  '<br/>'+
	  '<strong>' + this.vars.message + '</strong> ' +
	  '<strong id="friendEmaiModal">' + this.vars.email + '</strong><br>' +
	  '<div class="clear">&nbsp;</div>' +
	  '<div style="float: right;">' +
        '<input onclick="Modal.hide();" value=" ' + __('global.continue') + '" class="submit"  type="submit">'+
      '</div><br /><div class="clear">&nbsp;</div>';
	}
}

var googleMapTemplate = {
		  vars : {
				title: '',
				address: ''
		  },
		  
		  toString: function() {
			  return 'googleMapTemplate';
		  },

		  close: function() {
			  Modal.hide();
		  },
		  
		  showEvent: function() {
			  showAddress("mapModalCanvas", 1);				  				  
			  
		  },
		  
		  
		  get : function(){			  
			return '<div class="modal">' +                   
	  		       '<h2>'+ this.vars.title +'</h2>' +
	               '<h3>' +  this.vars.address + '</h3>' +	               
	               '<div id="mapModalCanvas"></div>' +
	               '<form action="#" method="post" style="font-size:11px; text-align: center;">'+
	               '<input name="button" type="button" class="submit" value="'+ __('modal.global.close') + '" onclick="googleMapTemplate.close();" />'+
	               '</form>'+	                
					'</div>';
		  }
	};


var stopListErrorTemplate = {
		vars:{},
		toString: function() {
		return 'stopListErrorTemplate';
		},
		get: function(){
			return '<img class="good_ghost" alt="" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" align="left">' +
			  '<br/>'+
			  '<div class="modBox"><strong>'+__('modal.valid.stopWord')+'</strong></div>' +
			  '<div class="clear">&nbsp;</div>' +
			  '<div style="float: right;">' +
		        '<input onclick="Modal.hide();" value=" ' + __('global.continue') + '" class="submit"  type="submit">'+
		      '</div><br /><div class="clear">&nbsp;</div>';
		}
	}

var validationErrorTemplate = {
		vars:{
			invalid : ''
		},
		toString: function() {
		return 'validationErrorTemplate';
		},
		get: function(){
			var out = '<img class="good_ghost" alt="" src="' + URLManager.getUrl('Jobs_Images2') + 'layout_ghost.gif" align="left">' +
			  '<br/>'+
			  '<div class="modBox">'+__('modal.valid.invalid') + '</div>' +
			  '<div class="clear">&nbsp;</div>' +
			  '<div style="float: right;">' +
		        '<input onclick="Modal.hide();" value=" ' + __('global.continue') + '" class="submit"  type="submit">'+
		      '</div><br /><div class="clear">&nbsp;</div>';
			return out.replace("#invalid#", this.vars.invalid);
		}
	}