function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=600,left = 545,top = 150');");
}
//Standard Rollover Scripts

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_swapImgRestore2() { //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];}
}

function MM_swapImage2() { //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];}
}

//CLEAR YEAR FIELD FOR AGE VERIFY

function clearYear(){
	 if (document.Age.year.value = "Year") {
		   document.Age.year.value = "";
	 }
}

function privacyWindow(URL) {
newWindow = window.open(URL, "myNewWindow2", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=400,height=270,left=40,top=40")
}
function closeWindow() {
newWindow.close()
}

//deny image saving

var msg="Do not save the thumbnail. Click to download the zip file.";

function right(e)
{
	if(navigator.appName=='Netscape'&&e.which==3) {
		alert(msg);
		return false;
	}
	if(navigator.appName=='Microsoft Internet Explorer'&&event.button==2) {
		alert(msg);
		return false;
	}
	else return true;
}

function trap() 
{
	if(document.images) {
		for(i=0;i<document.images.length;i++) {
			document.images[i].onmousedown=right;
			document.images[i].onmouseup=right;
		}
	}
}

function trap2()
{
	trap();
	var msg="Do not save the thumbnail. Click to download the zip file.";
}

//toggles layer visibility on and off

function changeContent(id,shtml) {
   if (document.getElementById || document.all) {
   
   	  //clear any existing content
   	  
   	  document.getElementById('office').innerHTML = '';
   
   	  //add the new content		
      var el = document.getElementById? document.getElementById(id): document.all[id];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
   }
}

// PRODUCT DIV LAYER CONTENT
var roll0 = "Welcome to Vodka360.com, home of vodka with a 'green' state of mind."; //home
var roll1 = "Welcome to Vodka360.com, home of vodka with a 'green' state of mind."; //home
var roll2 = "A glimpse into the 3 Ps and how they are evolving the way we all think about vodka."; // vodka evolved
var roll3 = "Listed are some of the resources, which are helping us lead the way towards a greener tomorrow."; // downloads
var roll4 = "Introducing two new flavors of the world's first eco-friendly flavored vodka series."; //action
var roll5 = "Find the nearest distributor of 360 Vodka."; // where to buy
var roll6 = "A myriad of delicious cocktails featuring 360 Vodka."; // recipes
var roll7 = "Discover simple ways how you can get involved in the fight to save our environment."; // you can help
var roll8 = "Press releases and marketing materials for 360 Vodka."; //press room
var roll9 = "McCormick and its partners reforest 40 acres."; // Forest 360
var roll10 = "Let us know what you think of 360 Vodka."; // contact us
var roll11 = "McCormick Distilling has a company policy of being green."; // Green Initiatives
var roll12 = "Explore the growing list of eco-terminology."; //eco-glossary
var roll13 = "The sweet-and-spicy flavor of old-fashioned cola paired with the world's first eco-friendly vodka."; //cola
var roll14 = "360 Double Chocolate is irresistible pairing of 360 Vodka with a double dose of rich chocolate flavor."; //chocolate
var roll21 = "360 Madagascar Vanilla is rich, smooth and complex with a slightly sweet finish."; //vanilla
var roll15 = "360 Concord Grape is smooth and sweet with robust flavor and a slightly tart finish."; //grape
var roll16 = "360 Mandarin Orange has a refreshingly light, crisp taste that echoes the natural zest of this royal fruit."; //oraqnge
var roll17 = "360 Vodka salutes America's heritage with the vibrantly fruity, smoothly sweet 360 Bing Cherry."; //cherry
var roll18 = "360 Sorrento Lemon has the refreshing crisp taste and nicely balanced sweetness with a bit of tart of the truly golden fruit."; //lemon
var roll17 = "360 Vodka salutes America's heritage with the vibrantly fruity, smoothly sweet 360 Bing Cherry."; //cherry
var roll19 = "360 Georgia Peach brings you the same juicy, refreshing flavor with just the right amount of sweet and tart."; //peach
var roll20 = "360 Vodka -- the world's first eco-friendly vodka."; //360



//FACTOID RANDOM:

var ic = 14;     // Number of alternative images

function pickRandom(range) {
	if (Math.random)
		return Math.round(Math.random() * (range-1));
	else {
		var now = new Date();
		return (now.getTime() / 1000) % range;
	}
}
var choice = pickRandom(ic) + 1;



//FLAVOR DROPDOWN

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

