// JavaScript Document
// JScript File
var popUpWin=0;
function popUpWindowCenterParent(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,statusbar=0,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
function popUpWindowCenterScreen(url, width, height)
{
	var left, top = 0;
	if (screen) {
	  left = (screen.availWidth - width) / 2;
	  top = (screen.availHeight - height) / 2;
	}
	popUpWin = open(url, 'popUpWin', 'toolbar=no,location=no,directories=no,statusbar=0,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
function popUpWindowCenterParentScroll(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,statusbar=0,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
function popUpWindowCenterScreenScroll(url, width, height)
{
	var left, top = 0;
	if (screen) {
	  left = (screen.availWidth - width) / 2;
	  top = (screen.availHeight - height) / 2;
	}
	popUpWin = open(url, 'popUpWin', 'toolbar=no,location=no,directories=no,statusbar=0,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
function popUpPutter(url, imageNum) {
	//var width = 440;
	var height = 480;
	if(imageNum == 4) {
		//var height = 480;
		var width = 520;
	}
	else {
		//var height = 580;
		var width = 620;
	}
	var centerX = 0;
	var centerY = 0;
	if (window.screenX != null && window.outerWidth) {
	  centerX = window.screenX + (window.outerWidth / 2);
	  centerY = window.screenY + (window.outerHeight / 2);
	}
	else if (window.screenLeft) {
	  if (document.documentElement) {
		 centerX = window.screenLeft + (document.documentElement.offsetWidth / 2);
		 centerY = window.screenTop + (document.documentElement.offsetHeight / 2);
	  }
	  else if (document.body && document.body.offsetWidth) {
		 centerX = window.screenLeft + (document.body.offsetWidth / 2);
		 centerY = window.screenTop + (document.body.offsetHeight / 2);
	  }
	}
	if(centerX == 0)
	{
		popUpWindowCenterScreen(url, width, height);
	}
	else 
	{
		var x = parseInt(centerX - (width / 2));
		var y = parseInt(centerY - (height / 2));
		popUpWindowCenterParent(url, x, y, width, height);
	}
}
function popupCenter(url, width, height)
{
	var centerX = 0;
	var centerY = 0;
	if (window.screenX != null && window.outerWidth) {
	  centerX = window.screenX + (window.outerWidth / 2);
	  centerY = window.screenY + (window.outerHeight / 2);
	}
	else if (window.screenLeft) {
	  if (document.documentElement) {
		 centerX = window.screenLeft + (document.documentElement.offsetWidth / 2);
		 centerY = window.screenTop + (document.documentElement.offsetHeight / 2);
	  }
	  else if (document.body && document.body.offsetWidth) {
		 centerX = window.screenLeft + (document.body.offsetWidth / 2);
		 centerY = window.screenTop + (document.body.offsetHeight / 2);
	  }
	}
	if(centerX == 0)
	{
		popUpWindowCenterScreen(url, width, height);
	}
	else 
	{
		var x = parseInt(centerX - (width / 2));
		var y = parseInt(centerY - (height / 2));
		popUpWindowCenterParent(url, x, y, width, height);
	}
}
function popupCenterScroll(url, width, height)
{
	var centerX = 0;
	var centerY = 0;
	if (window.screenX != null && window.outerWidth) {
	  centerX = window.screenX + (window.outerWidth / 2);
	  centerY = window.screenY + (window.outerHeight / 2);
	}
	else if (window.screenLeft) {
	  if (document.documentElement) {
		 centerX = window.screenLeft + (document.documentElement.offsetWidth / 2);
		 centerY = window.screenTop + (document.documentElement.offsetHeight / 2);
	  }
	  else if (document.body && document.body.offsetWidth) {
		 centerX = window.screenLeft + (document.body.offsetWidth / 2);
		 centerY = window.screenTop + (document.body.offsetHeight / 2);
	  }
	}
	if(centerX == 0)
	{
		popUpWindowCenterScreenScroll(url, width, height);
	}
	else 
	{
		var x = parseInt(centerX - (width / 2));
		var y = parseInt(centerY - (height / 2));
		popUpWindowCenterParentScroll(url, x, y, width, height);
	}
}
function showTraditionGallery()
{
	popUpPutter('gallery_tradition.html', 8);
}
function showKlassicGallery()
{
	popUpPutter('gallery_klassic.html', 8);
}
function showOneGallery()
{
	popUpPutter('gallery_one.html', 8);
}
function showFleetwoodGallery()
{
	popUpPutter('gallery_fleetwood.html', 8);
}
function showSofttailGallery()
{
	popUpPutter('gallery_softtail.html', 8);
}
function showHeadCover()
{
	popupCenter('headcover_popup.html', 460, 400);
}
function showPrivacyPolicy()
{
	popupCenterScroll('privacy.html', 450, 400);
}
function showTerms()
{
	popupCenterScroll('terms.html', 450, 400);
}
function showCVV2()
{
	popupCenterScroll('security_code.html', 450, 400);
}