

function detectBrowser () {
	if (navigator.appName.indexOf('Microsoft') == -1) {
			document.write('<link rel="stylesheet" href="noneie.css" />');
		}
}   

function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			/*var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();*/
			return false;
		} else {
			return true;
		}
}     


function showme(type) {
	document.productform.product.value = type;
	document.productform.submit();
	
}

function setFormActionJSP(formAction, nextState) {
	document.mainform.action = formAction;
	document.mainform.nextState.value = nextState;
	document.mainform.submit();
}

function setFormActionJSP(formAction, nextState, prevState) {
	document.mainform.action = formAction;
	document.mainform.nextState.value = nextState;
	document.mainform.prevState.value = prevState;
	document.mainform.submit();
}

function editCreateDeliveryAddress(addressID, nextState) {
	document.mainform.action = 'registerDeliveryAddress.jsp';
	document.mainform.nextState.value = nextState;
	document.mainform.IdToBeEdited.value = addressID;
	document.mainform.submit();
}
function removeAddress(addressID, nextState) {
	document.mainform.action = 'deleteAddress.jsp';
	document.mainform.nextState.value = nextState;
	document.mainform.IdToBeEdited.value = addressID;
	document.mainform.submit();
}


function showmethetandcs(formname){
	var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=612px,height=470px,top=50,left=50;"
  	window.open(jsRelPath+"showmethetandcs.jsp?include="+formname,null,features,true);
}

function PopupWindow(inLocation,width,height)
{
  /*var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=" + parseInt((screen.height)/2 - (height/2)) + ",left=" + parseInt((screen.width)/2 - (width/2)) + ";";*/
  var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ";"
  if(NewPopWin != null)
  {
    if(!NewPopWin.closed)
    {
      NewPopWin.close();
    }  
  }
  NewPopWin = window.open(jsRelPath+inLocation,null,features,true);
}
function removeItem(id){
	document.removeform.nextState.value = 'shoppingbag.jsp';
	document.removeform._removeItemfromShopBag_.value = id;
	document.removeform.submit();
	
}
function setFormAction(strAction) {
	document.mainform.nextState.value = strAction;
	document.mainform.submit();
}
function showdetail(screenName){
	var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=410,height=430,top=200,left=200;"
  	window.open(jsRelPath+"productdetail.jsp?detail="+screenName,null,features,true);
}
function showSmallText(theText){
	var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=200,top=200,left=200;"
  	window.open(jsRelPath+"smalltext.jsp?text="+theText,null,features,true);
}
function showBedroomSizes(){
	//var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=440,height=490,top=100,left=200;"
	var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=650,top=0,left=100;"
  	window.open("bedroomsizes.jsp",null,features,true);
}
function showDiningSizes (){
	//var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=440,height=490,top=100,left=200;"
	var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=550,top=0,left=100;"
  	window.open("diningsizes.jsp",null,features,true);
}
function showBathroomSizes(){
	//var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=440,height=490,top=100,left=200;"
	var features = "fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=450,top=0,left=100;"
  	window.open("bathroomsizes.jsp",null,features,true);
}