var pic = null
var popImg = null  
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"
var message="Welcome to Amer Rugs!";

function openPopImg(picName, windowTitle, windowWidth, windowHeight, topmargin){
	var nm ='';
	var pax=4;
	windowHeight=400;
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ 

	//var win = window.open('Carpopup49de.htm?name='+name+'&img='+img+'&pax='+pax+'', 'carpopup', 'width=350,height=225,left=10,top=20,screenX=10,screenY=20');
	//win.focus();
  popImg = window.open('TopImgWindowdc11.htm?img='+picName,imgWinName,"width=" + (parseInt(windowWidth))  + ",height=" + (parseInt(windowHeight))+",toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
topmargin=0;
  }

function closePopImg(){  
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) 
    if(popImg != null) if(!popImg.closed) popImg.close()
  }


function addItem(newItem) {
	index = document.cookie.indexOf("TheBasket");
	countbegin = (document.cookie.indexOf("^", index) + 1);
	countend = document.cookie.indexOf("@",countbegin);
	if (countend == -1) {
		countend = document.cookie.length;
	}
	if (document.cookie.substring(countbegin, countend).indexOf(newItem)== -1 ){ 
 		
 		if(index!=-1){
 			document.cookie="TheBasket^"+document.cookie.substring(countbegin, countend)+"["+newItem+"]@";
 		}else
 			document.cookie="TheBasket^"+"["+newItem+"]@";	
		alert(newItem+' has been added to your Enquiry List!\n\nAfter adding all the desired Item, Please go to the ENQUIRIES page.');
	}
	else {
		alert(newItem+" ALREADY EXISTS in your Enquiry List!");
	}
}

function changeaction(act,msg)
{
	if (act == 'del'){ 
		var Tell = window.confirm(" ARE YOU SURE ?? \n\n Click OK to delete " + msg + ", else click Cancel.");
		if (Tell) {
			return true; 
		}  else  return false; 
	}
}

function RightMouseClick(e) {
	if (document.all) {
		if (event.button == 2) {
			alert(message);
			return false;
		}
	}
	if (document.layers) {
		if (e.which == 3) {
			alert(message);
			return false;
		}
	}
}
if (document.layers)
	document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=RightMouseClick;