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();
}

var slidenav_slideSpeed = 10;	// Higher value = faster
var slidenav_timer = 10;	// Lower value = faster

var objectIdToSlideDown = false;
var slidenav_activeId = false;
var slidenav_slideInProgress = false;
function showHideContent(e,inputId)
{
	if(slidenav_slideInProgress)return;
	slidenav_slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('slidenav_a' + numericId);

	objectIdToSlideDown = false;

	if(!answerDiv.style.display || answerDiv.style.display=='none'){
		if(slidenav_activeId &&  slidenav_activeId!=numericId){
			objectIdToSlideDown = numericId;
			slideContent(slidenav_activeId,(slidenav_slideSpeed*-1));
		}else{

			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';

			slideContent(numericId,slidenav_slideSpeed);
		}
	}else{
		slideContent(numericId,(slidenav_slideSpeed*-1));
		slidenav_activeId = false;
	}
}

function slideContent(inputId,direction)
{

	var obj =document.getElementById('slidenav_a' + inputId);
	var contentObj = document.getElementById('slidenav_ac' + inputId);
	height = obj.clientHeight;
	if(height==0)height = obj.offsetHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',slidenav_timer);
	}else{
		if(height<=1){
			obj.style.display='none';
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('slidenav_a' + objectIdToSlideDown).style.display='block';
				document.getElementById('slidenav_a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,slidenav_slideSpeed);
			}else{
				slidenav_slideInProgress = false;
			}
		}else{
			slidenav_activeId = inputId;
			slidenav_slideInProgress = false;
		}
	}
}



function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='slidenav_question'){
			divs[no].onclick = showHideContent;
			divs[no].id = 'slidenav_q'+divCounter;
			var answer = divs[no].nextSibling;
			while(answer && answer.tagName!='DIV'){
				answer = answer.nextSibling;
			}
			answer.id = 'slidenav_a'+divCounter;
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';
			contentDiv.className='slidenav_answer_content';
			contentDiv.id = 'slidenav_ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}
	}
}



function goTo(sAnchorIN) 
{
   sParameters = "text1=" + sText1 + "&text2=" + sText2 + "&text3=" + sText3;
   sParameters += "#" + sAnchorIN;
   location.href = "yourpage.asp?" + sParameters;
}
