/*===================================================================================
TERMS OF USE
The Following license and copyright information must not be removed 
=====================================================================================
The Pacer Edition CMS -  Core File
=====================================================================================
- Software Name : The Pacer Edition CMS
-      Category : Modules
-       Package : Core
-   Module Name : show_menu2
-      Version  : 2.4 Stable
-     Platform  : The Pacer Edition CMS x.
- Requirements  : PHP 5.2.9 and higher
-   Build Date  : July 1, 2011
-   Build Time  : 10:00:00
-    File Name  : frontend.js   
-       Author  : The Pacer Edition CMS Development Team
-      License  : Pacer Copyright / GNU General Public License
-          URL  : http://www.thepaceredition.com
=====================================================================================
LICENSE INFORMATION:
THIS SOFTWARE IS PROVIDED BY THE PACER EDITION CMS AND CONTRIBUTORS "AS IS" AND ANY    
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES   
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT    
SHALL THE PACER EDITION CMS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,   
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF     
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,  
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                          
=====================================================================================
The Pacer Edition CMS.
Copyright (C) 2009 - 2011 The Pacer Edition CMS.
A Subsidiary of Darkstar Incorporated. All Rights Reserved.
=====================================================================================
Additional Information goes here 
===================================================================================*/
var show_menu2_hwin = null;
function show_menu2(url,modal,target,_type,_w,_h,_t,_l){
	var type = (_type==undefined)?'':_type;
	var w = (_w==undefined)?0:_w;
	var h = (_h==undefined)?0:_h;
	var t = (_l==undefined)?0:_t;
	var l = (_l==undefined)?0:_l;
	
	w = (w==0)?600:parseInt(w);
	h = (h==0)?400:parseInt(h);
	l = (l==0)?(screen.availWidth - w) / 2:parseInt(l);
	t = (t==0)?(screen.availHeight - h) / 2:parseInt(t);
	
	var nwind = 'show_menu2';
	
	if (modal){
		if (window.showModalDialog) {
			window.showModalDialog(url,nwind,'center:yes;status:no;dialogWidth:'+w+'px;dialogHeight:'+h+'px;dialogTop:'+t+'px;dialogLeft:'+l+'px');
		} else {
			window.open(url,nwind,'height='+h+',width='+w+',toolbar=no,directories=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no,modal=yes,top='+t+',left='+l);
		};	
	}else{
		if(target!=''){
			switch(target){
				case 'self':
					self.location.href = url;
					break;
				case 'top':
					top.location.href = url;
					break;
				case 'parent':
					parent.location.href = url;
					break;			
				default: // blank
					window.open(url);
					break;
			}
		} else {
			try{
				if (show_menu2_hwin) show_menu2_hwin.close();
			} catch (e){};
			
			show_menu2_hwin = window.open(url,nwind,'height='+h+',width='+w+',toolbar=no,directories=no,menubar=no,location=no,status=no,menubar=no,top='+t+',left='+l);
			try{
				if (show_menu2_hwin.focus) show_menu2_hwin.focus();
			} catch (e){};
		}
	}
	return false;
}
function show_menu2_icon_over(obj,url){
	//jQuery('img.pacer_menu_icon:first',obj).attr('src',url);
	var o = obj.getElementsByTagName("IMG");
	if (o) for (var i = 0; i < o.length; i++) {
		if (o[i].className.match(/pacer_menu_icon/)) {
			o[i].src = url;
			return;
		}
    }	
}
