function pagebreak(cat){	//alert('num is ' + no);	var num = pb%7;	var table="<table width=780 border=0><tr><td><a href='http://www.pearlnpretty.com' class=t>http://www.pearlnpretty.com</a></td><td align=center><font class=t> "+cat+" ( continued )</font></td></tr></table>"	if (pb<=6) {		if (pb == 6) {document.writeln("<P CLASS='breakhere'>"+table+"</p>");pb=7;}	}		else {		if (num == 0) {document.writeln("<P CLASS='breakhere'>"+table+"</p>")}	}	pb = pb + 1;}function printask(){	var ui= confirm("Welcome to the print view.  All stock items are displayed available in a format in Internet Explorer (only) which you can print directly.  Click OK to open the Print dialogue box now, or cancel to view.  You can select File - Print anytime.");	if (ui==true){window.print();}}function edit(ru,id){	if (ru==1) {		var edit="<br><a href='/pnp.nsf/webshopview/"+id+"?editdocument\' class=t>Edit</a>"		document.writeln(edit)	}}function dt_old(dspcat,amount){ //alert(' cat is ' + cat + ' amount is ' + amount);  //alert('DbPath ' + DbPath + ' ShowCat ' + showcat ); //alert('display cat = ' + showcat + ' but current cat = ' + cat); var dowhat = 'show'; var pc=pc+10 document.writeln("</td></tr></table></div></td></tr><tr><td>"); document.writeln("<a href='#' class='shopm' onClick='togCat(\""+dspcat+"\")'>"+dspcat+" ("+amount+")</a>"); document.writeln("</td><td><table border=0><tr><td>"); var divline = "<div id='"+dspcat+"' style='position:absolute; left:?px; top:155px; width:?px; height:?px; z-index:1; "; //one more bit!! if (dspcat==showcat){ //	alert('True - dspcat == showcat');	dowhat = '';	cat = showcat; }	else { //	alert('false - dspcat == showcat - cat is ' + cat); 	if (cat=='None') { 		if (showcat == 'None') { 			dowhat='show';cat=dspcat; 		} else { 			dowhat='none';cat=showcat; 		}	} else {		dowhat='none'	} } document.writeln(divline + "display:"+dowhat+"'>")}function dt(dspcat,amount){ //alert(' cat is ' + cat + ' amount is ' + amount);  //alert('DbPath ' + DbPath + ' ShowCat ' + showcat ); //alert('display cat = ' + showcat + ' but current cat = ' + cat); var dowhat = 'show'; var pc=pc+10 //split dspcat using - if (InStr(dspcat,"-")!=-1){   var newcat = Left(dspcat,InStr(dspcat,"-"));   newcat = trim(newcat);   //alert('newcat =' + newcat);   //check cat var 	if (newcat==catmenu) { //same as last then replace 		//var dspitem = replaceSubstring(dspcat,cat +" - ",newcat); 		//alert('newcat = ' + newcat +' cat = ' + cat + 'dspitem will be returned  '); 		//dspitem="ret-"+dspcat		dspitem = Right(dspcat,Len(dspcat)-InStr(dspcat,"-"));		document.writeln("</td></tr></table></div></td></tr><tr><td>");		document.writeln("<a href='#' class=shopm onClick='togCat(\""+dspcat+"\")'>"+dspitem+" ("+amount+")</a>");		document.writeln("</td><td><table border=0><tr><td>"); 	} else { //not same as replace with new  		//var dspitem = replaceSubstring(dspcat," - ","<br>") 		//alert('newcat = ' + newcat +' cat = ' + cat + 'dspitem will be normal '); 		//dspitem="nor-"+dspcat		dspitem = Right(dspcat,Len(dspcat)-InStr(dspcat,"-"));		document.writeln("</td></tr></table></div></td></tr><tr><td valign=bottom height=40>");		document.writeln("<font class=shopm>"+newcat + "</font><br>");		document.writeln("<a href='#' class='shopm' onClick='togCat(\""+dspcat+"\")'>"+dspitem+" ("+amount+")</a>");		document.writeln("</td><td><table border=0><tr><td>");		catmenu = newcat; //set cat  	} } else { 	var dspitem = dspcat;	document.writeln("</td></tr></table></div></td></tr><tr><td valign=bottom height=25>");	document.writeln("<a href='#' class='shopm' onClick='togCat(\""+dspcat+"\")'>"+dspitem+" ("+amount+")</a>");	document.writeln("</td><td><table border=0><tr><td>"); } var divline = "<div id='"+dspcat+"' style='position:absolute; left:?px; top:155px; width:?px; height:?px; z-index:1; "; //one more bit!! if (dspcat==showcat){ //	alert('True - dspcat == showcat');	dowhat = '';	cat = showcat; }	else { //	alert('false - dspcat == showcat - cat is ' + cat); 	if (cat=='None') { 		if (showcat == 'None') { 			dowhat='show';cat=dspcat; 		} else { 			dowhat='none';cat=showcat; 		}	} else {		dowhat='none'	} } document.writeln(divline + "display:"+dowhat+"'>")}function Right(str, len) {  // Rightmost len characters  return(str.substring(str.length - len, str.length));}function Left(str, len) {  // Leftmost len characters  return(str.substring(0, len));}function replaceSubstring(sourceList,fromList,toList) {    for (var i=0; i<sourceList.length; i++) {         if (sourceList.substring(i,i+fromList.length) == fromList) {         sourceList = sourceList.substring(0,i)+toList+sourceList.substring(i+fromList.length,sourceList.length)        }     }     return sourceList}function Len(str) {  return(str.length);}function trim(string) {     while (string.substring(0,1) == ' ')         string = string.substring(1, string.length);    while (string.substring(string.length-1,string.length) == ' ')        string = string.substring(0, string.length-1);   return string;}function InStr(strHaystack, strNeedle) {    return(strHaystack.indexOf(strNeedle));}function togCat(newcat){//DbPath//alert('Toogle new cat = ' + newcat + ' and the old cat is ' + cat); if (cat==newcat) { 	//alert('do nothing u already on this cat') } else {	//hide the current category	//alert('I am going to hide ' + cat)	//show the new category	if (cat != 'off') { 		var hide = getItem(cat);		if (hide == null) {return;} else {hide.style.display = "none"; }	}	//alert('I am going to show ' + newcat) 	var show = getItem(newcat);	if (show == null) {return;} else {show.style.display = ""; }	cat = newcat; }}function getItem(id) { // IE5+, Mozilla, NS5 if (document.getElementById)   return document.getElementById(id);// IE4if (document.all)   return document.all.item(id);// NS4   return eval("document."+ id + ".document." + id);}