if (top.frames.length!=0) {
    if (window.location.href.replace)
        top.location.replace(self.location.href);
    else
        top.location.href=self.document.href;
}

function ConfirmChoice(url,msg) { 
	answer = confirm(msg)
	
	if (answer !=0) { 
		location = url 
	} 
}


function checkChange() {
	if(document.getElementById('ActionButtonChange')) {

	} else {
		document.form.submit()
	}
}

function movein(which,html){
	document.getElementById(which).innerHTML=html
}
	
function moveout(which,html){
	document.getElementById(which).innerHTML=html
}

function imgin(which,value){
	document.getElementById(which).src=value
}

PositionX = 50;
PositionY = 50;

defaultWidth  = 200;
defaultHeight = 200;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

var optNN='scrollbars=no,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,resizable=yes,width=120,height=120,left='+PositionX+',top='+PositionY;

function pop(imageURL) {

	if ((imageURL.indexOf(".jpg") > 0) || (imageURL.indexOf(".gif") > 0)) {
		
	} else {
		imageURL = "/productimages/store/imagenotfound.gif";
	}

	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('' + 
		'<html><head><title>Loading...</title>' +
		'<link href="../template/styles.css" rel="stylesheet" type="text/css">' +
		'<meta http-equiv="imagetoolbar" content="false">' +
		'<sc'+'ript>' +
			'var isNN,isIE;' +
			'if (parseInt(navigator.appVersion.charAt(0))>=4){' +
			'isNN=(navigator.appName=="Netscape")?1:0;' +
			'isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}' +
			'function reSizeToImage(){');writeln('if (isIE){' +
			'window.resizeTo(100,100);' +
			'width=150-(document.body.clientWidth-document.images[0].width);' +
			'height=140-(document.body.clientHeight-document.images[0].height);' +
			'window.resizeTo(width,height);}' +
			'if (isNN){' +       
			'window.innerWidth=document.images["Preview"].width + 30;' +
			'window.innerHeight=document.images["Preview"].height + 30;}}' +
			'function doTitle(){document.title="Preview";}' +
		'</sc'+'ript>');

			if (!AutoClose) writeln('</head><body scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
			else writeln('</head><body scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
			writeln('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="middle"><div align="center"><img name="Preview" src='+imageURL+' style="display:block" class="img_white_border"></div></td></tr></table></body></html>');
			close();		
	}			
}



function submitform() {
	document.form1.submit();
}
