/***************************************************************
*  	Custom Java Script and JQuery Extension 
*	(c) retained by Marc | nahtass.com 
*	for more information contact 
*	http://interzonemultimedia.com
*	Licensed for use by Tehama Inc by
*	Interzone Multi-Media : do not remove
************************************************************* */

/* General toggle on and off by ID*/
function offAndOn (off, on ) {
    document.getElementById(off).style.display = 'none';
    document.getElementById(on).style.display = 'block';
}

// Simple function to open in a new window || as the joke goes: target="_blank" for strict
function openNewWindow(website)  {
    window.open(website);
}

/* This will open a link from the onClick event on the element [div] for menu areas */
function targetLink(linkage) {
    document.location.href = linkage;
}

/* ********* JQuery Related ********* */

$(document).ready(function () {
/* >>>TOP MENU<<< */
// leaving the table causes all top menus to roll up (scoop)
    $("table").bind("mouseleave", function(){
	$(".submenus").slideUp("fast");    
    });
    $("td").bind("mouseleave", function(){
	$(".submenus").slideUp("fast");
        $("li.dohide").hide(); // kills the list elments on the bottom menu
    });
    $("#style_news").bind("mouseleave", function(){
	$("li.dohide").hide(); // kills the list elments on the bottom menu        
    });   
/* HOME */
    // MM_swap covers this...
/* ABOUT */
    $("#mm_about").hover(function () { // onHover
	$("#style_about").slideDown("fast");
	$("#style_about").show();
    },
    function() { 
	// no action required
    });
/* MENS */
    $("#mm_men").hover(function () { // hover / release for the mens
	$("#mens_slide").slideDown("fast");
	$("#mens_slide").show();
    },
    function() {
	// no action required
        $("#mens_slide").show();
    });
/* WOMENS */
    $("#mm_women").hover(function () { // hover / release for the womans
	$("#womans_slide").slideDown("fast");
	$("#womans_slide").show();},
    function() {
	// no action required
    });
/* STYLE GUIDE */
// MM_swap covers this...

/* >>>BOTTOM MENU<<< */
/* NEWS */

//$("li.dohide").hide(); 
$("#mm_news").hover(function() {
        $("li.dohide").show();       
        },
        function(){        
        })
    $("#hover_wrapper").hover(function(){
        $("li.dohide").show();  
        $("#style_news").animate({

            height: "57px"
        }, 250 );
    },
    function() {  // hover out
	$("#style_news").animate({
	    height: "0px"
            // changes div to 0px height - works in conjunction with bing on td for mouseleave (above)     
	}, 200 );
    }
    );
});

/* ***** IMAGE SWAP ** MacroMedia generated - rewrite if bored - preferred in CSS w/JS ****** */
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* ***********************Pop up window for Store Locator ********************** */
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=600,height=500,left = 390,top = 262');");
}

// same as avove, but this carries in the W and H 
function popUpDimensional(URL, Pheight,  Pwidth) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+ Pwidth +",height="+ Pheight +",left = 390,top = 262');");
}





