function showCurrent(current){
	var obj = document.getElementById(current);
	
	if (obj != null) {
		
		if (obj.style.visible == 'visible') {
		
			obj.style.visible = 'hidden';
			obj.style.display = 'none';
			
			createCookie("opengroup","",1);
		}
		else {
			hideAll();
			obj.style.visible = 'visible';
			obj.style.display = 'block';
			
			createCookie("opengroup",current,1)
			
		}
		
	}
}
function hideAll()
{
	var i = 1
	while (i<=3)
	{
		
		document.getElementById('group' + i).style.visible = 'hidden';
		document.getElementById('group' + i).style.display = 'none';
		i++;
	
	}
}


function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
	
}



function open_window(url)
		{			
		var logpage = '';
		eval("logpage = window.open(url, 'Display1', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=658, height=410, left=300,top=200');");	  
		}
function open_window2(url)
		{			
		var logpage = '';
		eval("logpage = window.open(url, 'Display1', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=658, height=410, left=300,top=200');");	  
		}
		
		
		
	function clickButton(btn) {
		if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) {
			document.getElementById(btn).click();
			return false;
		} 
    	else return true;
	}

	function viewPhoto(id, width, height, title)
   {
      if (id != "0") {
      view = window.open("viewer.htm?id="+id, id, "width="+width+",height="+height+",scrollbars=no,toolbar=no,status=no,resizable=no,menubar=no,location=no");
      view.focus();
      }
   }
 
function showPhoto(obj_photo,id,width,height,text) {
	while(obj_photo.indexOf(":") > -1) {
		obj_photo = obj_photo.replace(':','_');
	}
	document.getElementById(obj_photo).src = "../photos/"+id+"_310_0.jpg";
	document.getElementById(obj_photo).alt = text;
	document.getElementById(obj_photo).parentNode.href = "javascript:viewPhoto(" + id + "," + width + "," + height + ",'" + text + "');";
}

function showRelatedPhoto(obj_photo,id,width,height,text) {
	while(obj_photo.indexOf(":") > -1) {
		obj_photo = obj_photo.replace(':','_');
	}
	document.getElementById(obj_photo).src = "../photos/"+id+"_138_0.jpg";
	document.getElementById(obj_photo).alt = text;
	document.getElementById(obj_photo).parentNode.href = "javascript:viewPhoto(" + id + "," + width + "," + height + ",'" + text + "');";
}

   function setCost() {		
	var id = setCost.arguments[1].replace(":", "_").replace(":", "_").replace(":", "_");
		document.getElementById(id).innerHTML =  setCost.arguments[setCost.arguments[0].selectedIndex + 2];
		   
   }
   
   function jumpGroup(obj) {
	 document.location.href = "catalog.aspx?group="+obj.options[obj.selectedIndex].value;
   }




function showPreOrder() {
	alert('This item is a pre-order. Items offered for pre-order are in high demand, but by reserving yours you are guaranteed to be the first to own it. Your credit card will not be charged until it ships. The delivery date for pre-orders varies and is only an estimate. Please check the item\'s description for more information.');
}



function showSwatchTitle(title, space) {
	if (title == "") {
		document.getElementById("swatch_title").innerHTML = "&nbsp;";
	}
	else {
		space = 44 * space;
		image = "<img src='../images/blank.gif' height='2' width='"+space+"'>";
		document.getElementById("swatch_title").innerHTML = "&nbsp;"+image+"<span class='alert'>"+title+"</span>";
	}
}

function showPhotoTitle(title) {
	if (title == "") {
		document.getElementById("photo_title").innerHTML = "&nbsp;";
	}
	else {
		document.getElementById("photo_title").innerHTML = "&nbsp;<span class='alert'>"+title+"</span>";
	}
}
function emailPageLink() {
	urlAddress = window.location.href;
	pageName = document.title;
	
	efpopup = window.open("http://linux.virtualatlantic.com/common/pk_emailfriend.php?url="+urlAddress+"&title="+pageName, "efpopup", "width=400,height=300,scrollbars=no,menubar=no");
}




   function openWindow(url,win)
   {
      view = window.open(url, "", win);
      view.focus();
   }



function displayImage(file, height) {

if (file.indexOf("swf") > 0) {
	file = file.replace(".swf", "");
	//AC_FL_RunContent( 'codebase','https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','468','height','60','src','flash/' + file,'quality','high','pluginspage','https://www.macromedia.com/go/getflashplayer','wmode','transparent','movie','flash/' + file );	
	AC_FL_RunContent( 'codebase','https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','scale','exactfit','width','563','height',+height,'src','flash/' + file,'quality','high','pluginspage','https://www.macromedia.com/go/getflashplayer','wmode','transparent','movie','../images/' + file );	

}
else {
	

  document.write('<img src="../images/' + file + '" border="0" />');	
  	
}

}
