function previousView(){
	showView(currentView - 1);
}

function nextView(){
	showView(currentView + 1);
}
var lastButton=null;
var thumbFrame = 'greyframe';
function showView( index ){
	currentView = index < 0 ? 0 : additionalViews.length <= index ? additionalViews.length - 1 : index;
	document.images['fullView'].src = additionalViews[currentView];
	if (lastButton) {
		lastButton.className = 'noframe';
	}
	document.images['buttonView_' + (currentView)].className = thumbFrame;
	lastButton = document.images['buttonView_' + (currentView)];
}
function NewColor(newfile,color){
   document.images.fullView.src = newfile;
   document.getElementById('ColorName').innerHTML = "&nbsp;" + color + "&nbsp;";
   return true;
}
function printDress(){
		window.focus(); window.print();
}
var NewWindow=null;

function ShowImage(FileURL) {
var WinHeight=Math.floor(screen.height);
   if (WinHeight >= 600) {
	var ImgHeight=597;
	var ImgWidth=557;
	var WinLeft=Math.floor((screen.width-ImgWidth)/2);
	var WinTop=Math.floor((screen.height-ImgHeight)/2);
	var WinAppearence = 'scrollbars=auto,width='+(ImgWidth)+',height='+(ImgHeight)+',top='+WinTop+',left='+WinLeft;
   } else {
	var ImgHeight=WinHeight-100;
	var ImgWidth=557;
	var WinLeft=Math.floor((screen.width-ImgWidth)/2);
	var WinTop=Math.floor((screen.height-ImgHeight)/2);
	var WinAppearence = 'scrollbars=yes,width='+(ImgWidth)+',height='+(ImgHeight)+',top='+WinTop+',left='+WinLeft;
   }
   NewWindow=window.open( FileURL,'dress',WinAppearence);
   NewWindow.focus();
}

function ShowStyle(style) {
	ShowImage('/dress_popup.php?style=' + style);
}
function areYouSure(){
	return confirm ('Are you sure?!');
}
function swatchView(itemID){
	window.open('swatches_view.php?id=' + itemID,
	  'swatches','resizable=no,menubar=no,status=no,scrollbars=yes,width=350,height=267,top=200,left=300');
}
function fabricView(fabricID){
	window.open('fabricswatches.php?id=' + fabricID,
	  'swatches','resizable=no,menubar=no,status=no,scrollbars=yes,width=350,height=267,top=200,left=300');
}