	var theparent = true;
	var popupitem = new PopupWindow();
	var advframes = 0;

	var cbypopup = "";
	var cbyname = "";
	var cbyurl = "";
	var cbywidth = 0;
	var cbyheight = 0;
	var cbyoffsetX = 0;
	var cbyoffsetY = 0;

	function changeframe(){
		args = changeframe.arguments;
		//alert(args.length);
		if ((args.length < 5)&&(cbypopup =="")&&(cbyname =="")&&(cbyurl == "")&&(cbywidth == 0)&&(cbyheight == 0)){
			return false;
		} else {
			cbypopup = args[0];
			cbyname = args[1];
			cbyurl = args[2];
			cbywidth = args[3];
			cbyheight = args[4];
		}
		if(args[5]){
			cbyoffsetX = args[5];
		}
		if(args[6]){
			cbyoffsetY = args[6];
		}
		//alert("Value");
		if(!document.layers){
			frameobj = findframe(cbypopup, cbyname);
			if(frameobj){
				//alert(frameobj);				
				switch(advframes){
					case 1:
						frameobj.width = cbywidth;
						frameobj.height = cbyheight;
						/*
						IFrameObj = new Object();
						IFrameObj.document = new Object();
						IFrameObj.document.location = new Object();
						IFrameObj.document.location.iframe = document.getElementById(cbyname);
						IFrameObj.document.location.replace = function(location) {this.iframe.src = location;}
						if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) {
							// we have to give NS6 a fraction of a second
							// to recognize the new IFrame
							setTimeout('changeframe()',10);
							return false;
							//alert("Gecko");
							//loop
						}
						var validFrame = true;
						if (IFrameObj.contentDocument) {
							// For NS6
							alert('NS');
							IFrameDoc = IFrameObj.contentDocument;
						} else if (IFrameObj.contentWindow) {
							// For IE5.5 and IE6
							alert('IE');
							IFrameDoc = IFrameObj.contentWindow.document;
						} else if (IFrameObj.document) {
							// For IE5
							alert('Heve Ho');
							IFrameDoc = IFrameObj.document;
						} else {
							validFrame = false;
							frameobj.src = cbyurl;
						}
						if(validFrame){
							IFrameDoc.location.replace(cbyurl);
						}*/
						frameobj.src = cbyurl;
						break;
					case 2:
						frameobj.width = cbywidth;
						frameobj.height = cbyheight;
						frameobj.location.href = cbyurl;
						break;
					case 3:
						/*frameobj.resizeTo(cbywidth, cbyheight);
						frameobj.src = cbyurl;
						break;*/
					default:
						break;
				}//end swtich
			}
		} else {
			//NS Layers are impossible
			popupitem.setWindowProperties("toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,alwaysRaised=yes,dependent=yes,titlebar=no");
			popupitem.setSize(cbywidth,cbyheight);
			popupitem.offsetX = cbyoffsetX;
			popupitem.offsetY = cbyoffsetY;
			//alert(popupitem.offsetX);
			//alert(popupitem.offsetY);			
			popupitem.autoHide();
			//alert('basta');
			popupitem.setUrl(cbyurl);
		}
	}//end report

	function findframe(popup, byname){
		//alert("Hi");
		/*
		If you use the SRC attribute in an iLayer, the maximum layers for this document is 2.
		Otherwise, it won't be able to find any nested layers beneath the item.
		*/
		if (document.layers){
			popupitem = new PopupWindow();
			//alert('basta find frame');			
			/*
			//alert('Inside Layers Now');
			advframes= 3;
			var curobj = document;
			var objects = new Array;
			var xstop = new Array;
			//alert(document.layers[0].layers);
			//return;
			for (var x = 0; x < curobj.layers.length; x++){
				//alert('Loop upto ' + curobj.layers.length);
				//alert(curobj.layers[x].name);
				if(curobj.layers[byname]){
					//alert('I have found ' + byname);
					return curobj.layers[byname];
				} else {
					//alert('I have not found ' + byname + ' at ' + curobj.layers[x].name + '. I am at current level ' + xstop.length);
					var nofurtherlayers = true;
						if((curobj.layers[x].document)&&(curobj.layers[x].document.layers)){
							//alert('How many sub layers does ' + curobj.layers[x].name + ' have? = ' + curobj.layers[x].document.layers.length);
							if(curobj.layers[x].document.layers.length >= 1){
								//alert('this one has a sub layer');
								tempobj = curobj;
								objects.push(tempobj);
								//alert('pushed objects, total now is ' + objects.length + ' total items of this is ' + tempobj.layers.length);
								xstop.push(x);
								//alert('pushed xstop at ' + x);
								curobj = curobj.layers[x].document;
								//alert(curobj.layers.length);
								x = -1;
								nofurtherlayers = false;
								//alert('Going back to loop at ' + x + ' and stopping at ' + curobj.layers.length);
							}//layer length is good
						}//
						if(nofurtherlayers){
							//alert('no further layers');
							//alert(objects.length);
							//alert(xstop.length);
							if(x >= curobj.layers.length){
								if ((objects.length >= 1)&&(xstop.length >= 1)){
									alert('lets go back one level');
									curobj = objects.pop();
									alert(curobj.layers.length);
									x = xstop.pop();
									alert('start again at ' + x);
								}//
							}//
						}//no further layers
				}//try to loop again
			}//end for each loop
			*/
			return null;
		} else if (document.getElementById(byname)){
			advframes= 1;
			popupitem = new PopupWindow(popup);
			popupitem.offsetY=20;
			popupitem.offsetX = cbyoffsetX;
			popupitem.offsetY = cbyoffsetY;
			//alert(popupitem.offsetX);
			//alert(popupitem.offsetY);			
			popupitem.autoHide();
			return document.getElementById(byname);
		} else if (document.frames[byname]) {
			advframes= 2;
			popupitem = new PopupWindow(popup);
			popupitem.offsetY=20;
			popupitem.offsetX = cbyoffsetX;
			popupitem.offsetY = cbyoffsetY;
			//alert(popupitem.offsetX);
			//alert(popupitem.offsetY);			
			popupitem.autoHide();
			return document.frames[byname];
		} else {
			advframes= 0;
			return null;
		}
	}