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_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_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];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
var header_text = Array();
var link_text = Array();
var body_text = Array();
var target_value = Array();

/*header_text.push('njoy exhibiting at AVN Adult Entertainment Expo 2009');
link_text.push('http://show.adultentertainmentexpo.com/adult-expo/v42/index.cvn?ID=10000');
body_text.push('Come visit us! We\'ll be at booth B1121<br />January 8-11, Sands Expo Center, Las Vegas NV');
target_value.push('_blank');

header_text.push('njoy sponsors "Rated X": Amsterdam Alternative Erotica Film Festival');
link_text.push('http://www.ratedx.nl/index.html');
body_text.push('January 15-18, 2009, Amsterdam<br />Click here for more info!');
target_value.push('_blank');

header_text.push('njoy sponsors new German sitcom, <em>Torstrasse Intim</em>');
link_text.push('http://www.torstrasse-intim.de/');
body_text.push('click here to see more!');
target_value.push('_blank');
*/
header_text.push('njoy provides customized njoy Elevens for First Annual Fleshbot Awards');
link_text.push('/events.php');
body_text.push('');
target_value.push('_blank');

header_text.push('njoy will be exhibiting our shiny wares at Berlin\'s Venus International Trade Fair');
link_text.push('http://www.venus-berlin.com/en/');
body_text.push('October 15-18, 2009<br />Come visit us at Hall 22B, Stand 27');
target_value.push('_blank');

header_text.push('Njoy wins "Outstanding Non-Powered Product" for the pure wand in AVN’s First Annual "O" Awards');
link_text.push('/events.php');
body_text.push('');
target_value.push('_self');

header_text.push('njoy proudly sponsors the New York City Sexbloggers 2010 Calendar to support Sex Work Awareness');
link_text.push('/events.php');
body_text.push('');
target_value.push('_self');

header_text.push('njoy nominated in 5 categories for AVN\'s first annual "O" Awards');
link_text.push('/events.php');
body_text.push('');
target_value.push('_self');

/*header_text.push('njoy will be exhibiting our shiny wares at ANE in Los Angeles, July 13-15 come visit us at booth 823');
link_text.push('http://www.avnnoveltyexpo.com/index.php');
body_text.push('');
target_value.push('_blank'); */

header_text.push('The njoy Pure Wand selected one of \'Babeland\'s All-Stars\'');
link_text.push('/events.php');
body_text.push('');
target_value.push('_self');


var active_id = -1;
function events() {
	active_id++;
	if (active_id > (header_text.length - 1)) {
		active_id = 0;
	}
	
	var event_link = document.getElementById('event_link');
	event_link.style.display="none";
	event_link.innerHTML = "<a href=\""+link_text[active_id]+"\" target=\""+target_value[active_id]+"\" class=\"event_link\"><strong><span style=\" color:#eb1e85;\" id=\"event_header\">"+header_text[active_id]+"</strong><br /><span style=\"color: #999999\"><em>"+body_text[active_id]+"</em></span>";
	Effect.Appear('event_link');
	setTimeout("events()", 9000);
}

// preload images
	var home_img_ro = new Image();
	home_img_ro.src="/images/nav/new2/home-pink.gif";
	var home_img = new Image();
	home_img.src="/images/nav/new2/home-gray.gif";
	var toys_img_ro = new Image();
	toys_img_ro.src="/images/nav/new2/toys-pink.gif";
	var toys_img = new Image();
	toys_img.src="/images/nav/new2/toys-gray.gif";
	var philosophy_img_ro = new Image();
	philosophy_img_ro.src="/images/nav/new2/philosophy-pink.gif";
	var philosophy_img = new Image();
	philosophy_img.src="/images/nav/new2/philosophy-gray.gif";
	var reviews_img_ro = new Image();
	reviews_img_ro.src="/images/nav/new2/reviews-pink.gif";
	var reviews_img = new Image();
	reviews_img.src="/images/nav/new2/reviews-gray.gif";
	var shop_img_ro = new Image();
	shop_img_ro.src="/images/nav/new2/shop-pink.gif";
	var shop_img = new Image();
	shop_img.src="/images/nav/new2/shop-gray.gif";
	var contact_img_ro = new Image();
	contact_img_ro.src="/images/nav/new2/contact-pink.gif";
	var contact_img = new Image();
	contact_img.src = "/images/nav/new2/contact-gray.gif";
	var purchase_img_ro = new Image();
	purchase_img_ro.src="/images/nav/new2/purchase-pink.gif";
	var purchase_img = new Image();
	purchase_img.src = "/images/nav/new2/purchase-gray.gif";
	var events_img_ro = new Image();
	events_img_ro.src="/images/nav/new2/events-pink.gif";
	var events_img = new Image();
	events_img.src = "/images/nav/new2/events-gray.gif";
	var a_gallery_img = new Image();
	a_gallery_img.src = "/images/nav/new2/a-gallery_gray.gif";
	var a_gallery_img_ro = new Image();
	a_gallery_img_ro.src = "/images/nav/new2/a-gallery_pink.gif";
	var catalog_img = new Image();
	catalog_img.src = "/images/nav/new2/catalogue-gray.gif";
	var catalog_img_ro = new Image();
	catalog_img_ro.src = "/images/nav/new2/catalogue-pink.gif";
	
	function swap_images(obj, val) {
		obj.src = val.src;
	}
	function swap(image_name) {
		document.getElementById('product_sm').src="/images/products/"+image_name;
	}
	var active_div = "";
	function display(the_div, text_obj) {
		if (active_div == the_div) {
			Effect.SlideUp(the_div, { duration: 0.4 });
			text_obj.innerHTML = "more...";
			active_div = "";
		} else {
			if (active_div != "") {
				Effect.SlideUp(active_div, { duration: 0.4 });
				document.getElementById(active_div+"-text").innerHTML = "more...";
			}
			Effect.SlideDown(the_div, { duration: 0.4 });
			text_obj.innerHTML = "hide";
			active_div = the_div;
		}
	}
	function display_div(the_div) {
		if (active_div == the_div) {
			Effect.SlideUp(the_div, { duration: 1.0 });
			active_div = "";
		} else {
			if (active_div != "") {
				Effect.SlideUp(active_div, { duration: 1.0 });
			}
			Effect.SlideDown(the_div, { duration: 1.0 });
			active_div = the_div;
		}
	}
