function ImagePreloader(a,c){this.callback=c;this.nLoaded=0;this.nProcessed=0;this.aImages=new Array;this.nImages=a.length;for(var b=0;b<a.length;b++){this.preload(a[b])}}ImagePreloader.prototype.preload=function(b){var a=new Image;this.aImages.push(a);a.onload=ImagePreloader.prototype.onload;a.onerror=ImagePreloader.prototype.onerror;a.onabort=ImagePreloader.prototype.onabort;a.oImagePreloader=this;a.bLoaded=false;a.src=b};ImagePreloader.prototype.onComplete=function(){this.nProcessed++;if(this.nProcessed==this.nImages){this.call-back(this.aImages,this.nLoaded)}};ImagePreloader.prototype.onload=function(){this.bLoaded=true;this.oImagePreloader.nLoaded++;this.oImagePreloader.onComplete()};ImagePreloader.prototype.onerror=function(){this.bError=true;this.oImagePreloader.onComplete()};ImagePreloader.prototype.onabort=function(){this.bAbort=true;this.oImagePreloader.onComplete()};function emailCheck(b){var s=/^(.+)@(.+)$/;var q='\\(\\)<>@,;:\\\\\\"\\.\\[\\]';var l="[^\\s"+q+"]";var d='("[^"]*")';var r=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var a=l+"+";var p="("+a+"|"+d+")";var m=new RegExp("^"+p+"(\\."+p+")*$");var f=new RegExp("^"+a+"(\\."+a+")*$");var c=b.match(s);if(c==null){alert("Email address seems incorrect (check @ and .'s)");return false}var t=c[1];var u=c[2];if(t.match(m)==null){alert("The username doesn't seem to be valid.");return false}var j=u.match(r);if(j!=null){for(var n=1;n<=4;n++){if(j[n]>255){alert("Destination IP address is invalid!");return false}}return true}var g=u.match(f);if(g==null){alert("The domain name doesn't seem to be valid.");return false}var h=new RegExp(a,"g");var e=u.match(h);var o=e.length;if(e[e.length-1].length<2||e[e.length-1].length>3){alert("The address must end in a three-letter domain, or two letter country.");return false}if(o<2){var k="This address is missing a hostname!";alert(k);return false}return true}var isNS4=(navigator.appName=="Netscape")?1:0;var text0Focus;var text20Focus;var maxChar=22;var maxCharPlus1=maxChar+1;function EvalSound(soundobj){var thissound=eval("document."+soundobj);thissound.Play()}function loading(){document.getElementById("colorselect").focus();text0Focus=false;text20Focus=false;document.forms.multibuy.colorselect.selectedIndex=0;document.forms.multibuy.colorselect.options[0].selected=true;document.forms.multibuy.font0.selectedIndex=0;document.forms.multibuy.font0.options[0].selected=true;document.getElementById("text0_old").value=document.getElementById("text0").value;document.getElementById("text20_old").value=document.getElementById("text20").value;var a=document.getElementById("text0");var b=document.getElementById("text20");disableSelection(a);disableSelection(b);document.getElementById("nts_ad").value="";document.getElementById("text0").value="";document.getElementById("text20").value="";document.getElementById("text0_old").value="";document.getElementById("text20_old").value="";document.getElementById("button1").style.visibility="visible";document.getElementById("button2").style.visibility="visible";document.getElementById("button3").style.visibility="visible";document.getElementById("button4").style.visibility="visible"}function handleEnter(d,b){var c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(c==13){var a;for(a=0;a<d.form.elements.length;a++){if(d==d.form.elements[a]){break}}a=(a+1)%d.form.elements.length;d.form.elements[a].focus();return false}else{return true}}function disableSelection(a){if(typeof a.onselectstart!="undefined"){a.onselectstart=function(){return false}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="none"}else{a.onmousedown=function(){return false}}}a.style.cursor="default"}function cancelEvent(a){if(!a){a=window.event}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}}function stopEvent(a){if(!a){a=window.event}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}}function disableCtrlKeyCombination(d){var b=new Array("a","n","c","x","v","j");var a;var c;if(window.event){a=window.event.keyCode;if(window.event.ctrlKey){c=true}else{c=false}}else{a=d.which;if(d.ctrlKey){c=true}else{c=false}}if(c){for(i=0;i<b.length;i++){if(b[i].toLowerCase()==String.fromCharCode(a).toLowerCase()){return false}}}return true}function disableShiftKeyCombination(d){var c=new Array("33","34","35","36","37","38","39","40","96","97","98","99","100","101","102","103","104","105","106");var b;var a;if(window.event){b=window.event.keyCode;if(window.event.shiftKey){a=true}else{a=false}}else{b=d.which;if(d.shiftKey){a=true}else{a=false}}if(a){for(i=0;i<c.length;i++){if(c[i]==b){return false}}}return true}function ismaxlength(b){var a=b.getAttribute?parseInt(b.getAttribute("maxlength")):"";if(b.getAttribute&&b.value.length>a){b.value=b.value.substring(0,a)}}function setMaxLength(){var a=document.getElementsByTagName("textarea");var b=document.createElement("div");b.className="counter";for(var c=0;c<a.length;c++){if(a[c].getAttribute("maxlength")){var d=b.cloneNode(true);d.relatedElement=a[c];d.innerHTML="<span>0</span>/"+a[c].getAttribute("maxlength");a[c].parentNode.insertBefore(d,a[c].nextSibling);a[c].relatedElement=d.getElementsByTagName("span")[0];a[c].onkeyup=a[c].onchange=checkMaxLength;a[c].onkeyup()}}}function checkMaxLength(){var a=this.getAttribute("maxlength");var b=this.value.length;if(b>a){this.relatedElement.className="toomuch"}else{this.relatedElement.className=""}this.relatedElement.firstChild.nodeValue=b}function background(b){var c=navigator.appName;var d="";var e=0;var f=0;if(b=="white"){d="white";e=46;f=47}if(b=="gray"){d="gray";e=48;f=49}if(b=="metallic_silver"){d="metallic silver";e=100;f=101}if(b=="metallic_gold"){d="metallic gold";e=102;f=103}if(b=="carolina_blue"){d="carolina blue";e=50;f=51}if(b=="royal"){d="royal";e=52;f=53}if(b=="navy"){d="navy";e=106;f=107}if(b=="purple"){d="purple";e=54;f=55}if(b=="kelly"){d="kelly";e=42;f=43}if(b=="forest"){d="forest";e=56;f=57}if(b=="yellow"){d="yellow";e=58;f=59}if(b=="orange"){d="orange";e=60;f=61}if(b=="pink"){d="pink";e=62;f=63}if(b=="red"){d="red";e=40;f=41}if(b=="cardinal"){d="cardinal";e=110;f=111}if(b=="maroon"){d="maroon";e=64;f=65}if(b=="brown"){d="brown";e=66;f=67}if(b=="black"){d="black";e=68;f=69}var a=document.getElementById("color_label");a.innerHTML=d;document.getElementById("pId0").value=b;document.getElementById("pId1").value=b;document.getElementById("onum01").value=e;document.getElementById("onum11").value=f;document.getElementById("main_img").src="prodimages/"+b+".jpg"}function showphrases(){var c=document.getElementById("font0").value;var a="";var g="12px";switch(c){case"Arial":a="Arial, Helvetica, sans-serif";break;case"Arial Extra Bold":a='"Arial Black", Gadget, sans-serif';break;case"Brush Script":a="Brush Script MT, script";g="18px";break;case"College":a="College";break;case"Comic Sans":a='"Comic Sans MS", "Comic Sans MS5", cursive';break;case"Courier New":a='"Courier New", Courier6, monospace';break;case"Edwardian Script":a="Edwardian Script ITC, script";
g="18px";break;case"Freshbot":a="Freshbot";break;case"Impact":a="Impact, Impact5, Charcoal6, sans-serif";break;case"Tahoma":a="Tahoma, Geneva, sans-serif";break;case"Times":a="Times New Roman, Times, serif";break;default:a="Arial, Helvetica, sans-serif";break}var b=document.getElementById("g_table");b.style.fontFamily=a;var f=document.getElementById("g2_table");f.style.fontFamily=a;var e=document.getElementById("text0");e.style.fontSize=g;e.style.fontFamily=a;var d=document.getElementById("text20");d.style.fontSize=g;d.style.fontFamily=a;document.getElementById("font20").value=a}function embolden(){var a=document.getElementById("boldvalue").value;if(a=="false"){var b=document.getElementById("g_table");b.style.fontWeight="bold";var e=document.getElementById("g2_table");e.style.fontWeight="bold";var d=document.getElementById("text0");d.style.fontWeight="bold";var c=document.getElementById("text20");c.style.fontWeight="bold";a="true";document.getElementById("bold").style.backgroundColor="#847F80"}else{var b=document.getElementById("g_table");b.style.fontWeight="normal";var e=document.getElementById("g2_table");e.style.fontWeight="normal";var d=document.getElementById("text0");d.style.fontWeight="normal";var c=document.getElementById("text20");c.style.fontWeight="normal";a="false";document.getElementById("bold").style.backgroundColor=""}document.getElementById("boldvalue").value=a}function italicize(){var b=document.getElementById("italicvalue").value;if(b=="false"){var a=document.getElementById("g_table");a.style.fontStyle="italic";var e=document.getElementById("g2_table");e.style.fontStyle="italic";var d=document.getElementById("text0");d.style.fontStyle="italic";var c=document.getElementById("text20");c.style.fontStyle="italic";b="true";document.getElementById("italic").style.backgroundColor="#847F80"}else{var a=document.getElementById("g_table");a.style.fontStyle="normal";var e=document.getElementById("g2_table");e.style.fontStyle="normal";var d=document.getElementById("text0");d.style.fontStyle="normal";var c=document.getElementById("text20");c.style.fontStyle="normal";b="false";document.getElementById("italic").style.backgroundColor=""}document.getElementById("italicvalue").value=b}function getprice(){var d=document.getElementById("pId0").value;var b=document.getElementById("text20").value;var c=0;var e=0;c=parseInt(document.getElementById("qty0").value);e=parseInt(document.getElementById("qty1").value);if(isNaN(c)){c=0}if(isNaN(e)){e=0}var j=c+e;var f=1.9;var a=0;if(j>=1&&j<=9){f=6.1;a=0}if(j>=10&&j<=49){f=1.9;a=0}if(j>=50&&j<=99){f=1.5;a=0}if(j>=100&&j<=190){f=1.15;a=0}if(j>=200&&j<=490){f=0.8;a=0}if(j>=500&&j<=990){f=0.7;a=0}if(j>=1000&&j<=4990){f=0.5;a=0}if(j>=5000&&j<=9990){f=0.3;a=0}if(j>10000){f=0.2;a=0}if(b!=""){f+=a}var h=f*j;h=Math.round(h*100)/100;document.getElementById("pPrice0").value=f;document.getElementById("pPrice1").value=f;var g=document.getElementById("price_label");var k=f.toFixed(2);g.innerHTML="$"+k}function showdetails(){var a=document.getElementById("phrase_detail");a.style.visibility="visible"}function hidedetails(){var a=document.getElementById("phrase_detail");a.style.visibility="hidden"}function countChars(b){var c=0;for(var a=0;a<b.length;a++){if(b.charAt(a)!="\r"){c++}}return c}function CursorPos(b,a){this.start=b;this.end=a}function getCursorPosition(d){var g=0;var b=0;if(document.selection){d.focus();var a=document.selection.createRange();var f=a.duplicate();f.moveToElementText(d);var e=a.text;a.text="\001";var c=f.text.indexOf("\001");g=countChars((c==-1)?f.text:f.text.substring(0,c));b=countChars(e)+g;a.moveStart("character",-1);a.text=e}else{if(d.selectionStart||(d.selectionStart=="0")){g=d.selectionStart;b=d.selectionEnd}}return new CursorPos(g,b)}function setCursorPosition(b,c){if(document.selection){var a=b.createTextRange();a.collapse(true);a.moveStart("character",c.start);a.moveEnd("character",c.end-c.start);a.select()}else{if(b.selectionStart||(b.selectionStart=="0")){b.selectionStart=c.start;b.selectionEnd=c.end}}b.focus()}var cur_pos=new CursorPos(0,0);var end_pos=new CursorPos(0,0);var end_pos2=new CursorPos(0,0);var code;var character;var front_imgs=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){front_imgs[i]=""}var back_imgs=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){back_imgs[i]=""}var front_picname=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){front_picname[i]=""}var back_picname=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){back_picname[i]=""}var front_phrase="";var back_phrase="";var right_menu=0;function checkKey(a){if(!a){var a=window.event}if(a.keyCode){code=a.keyCode}else{if(a.which){code=a.which}}character=String.fromCharCode(code)}function getPositions(){var a="";if(document.getElementById("text0").hasFocus){text0Focus=true;a="text0"}else{text0Focus=false}if(document.getElementById("text20").hasFocus){text20Focus=true;a="text20"}else{text20Focus=false}if(a!=""){var b=document.getElementById(a);cur_pos=getCursorPosition(b)}}function changeSpots(){var g="";var d=document.getElementById("text0").value;var e=document.getElementById("text20").value;var s=document.getElementById("text0_old").value;var f=document.getElementById("text20_old").value;if(document.getElementById("text0").hasFocus){text0Focus=true;g="text0"}else{text0Focus=false}if(document.getElementById("text20").hasFocus){text20Focus=true;g="text20"}else{text20Focus=false}if(g!=""){var c=document.getElementById(g);end_pos2=getCursorPosition(c)}if(code==8&&text0Focus&&end_pos.start!=0){var k=1;for(i=1;i<=end_pos2.start;i++){if(front_imgs[i]!=""){k=k+1}}var a=end_pos.end-end_pos2.start;var o=maxChar-a;for(i=end_pos2.start+1;i<=end_pos.end;i++){front_imgs[i]="";front_picname[i]=""}for(i=end_pos2.end+1;i<=o;i++){if(front_imgs[i+a]!=""){switch(k){case 1:r1="st";break;case 2:r1="nd";break;case 3:r1="rd";break;default:r1="th";break}front_imgs[i]="Add "+front_picname[i+a]+"graphic where "+k+r1+" &#9674; is in Front Phrase.<br />";front_picname[i]=front_picname[i+a];k++}else{front_imgs[i]="";front_picname[i]=""}}front_imgs[maxChar]="";front_picname[maxChar]="";if(document.getElementById("nts_ad").value!=""){document.getElementById("note").style.visibility="visible"}var j=document.getElementById("nts");j.innerHTML="";document.getElementById("nts_ad").value="";front_phrase="";for(i=1;i<maxCharPlus1;i++){if(front_imgs[i]!=""){j.innerHTML+=front_imgs[i];document.getElementById("nts_ad").value+=front_imgs[i];front_phrase+=front_imgs[i]}}j.innerHTML+=back_phrase;document.getElementById("nts_ad").value+=back_phrase}else{if(code==46&&text0Focus&&end_pos.start!=maxChar){var k=1;for(i=1;i<=end_pos2.end;i++){if(front_imgs[i]!=""){k=k+1}}var b=s.length;var n=d.length;var a=b-n;var o=maxChar-a;for(i=end_pos2.end+1;i<=o;i++){if(front_imgs[i+a]!=""){switch(k){case 1:r1="st";break;case 2:r1="nd";break;case 3:r1="rd";break;default:r1="th";break}front_imgs[i]="Add "+front_picname[i+a]+"graphic where "+k+r1+" &#9674; is in front Phrase.<br />";front_picname[i]=front_picname[i+a];
k++}else{front_imgs[i]="";front_picname[i]=""}}front_imgs[maxChar]="";front_picname[maxChar]="";if(document.getElementById("nts_ad").value!=""){document.getElementById("note").style.visibility="visible"}var j=document.getElementById("nts");j.innerHTML="";document.getElementById("nts_ad").value="";front_phrase="";for(i=1;i<maxCharPlus1;i++){if(front_imgs[i]!=""){j.innerHTML+=front_imgs[i];document.getElementById("nts_ad").value+=front_imgs[i];front_phrase+=front_imgs[i]}}j.innerHTML+=back_phrase;document.getElementById("nts_ad").value+=back_phrase}else{if(code==8&&text20Focus&&end_pos.start!=0){var h=1;for(i=1;i<=end_pos2.start;i++){if(back_imgs[i]!=""){h=h+1}}var a=end_pos.end-end_pos2.start;var o=maxChar-a;for(i=end_pos2.start+1;i<=end_pos.end;i++){back_imgs[i]="";back_picname[i]=""}for(i=end_pos2.end+1;i<=o;i++){if(back_imgs[i+a]!=""){switch(h){case 1:r2="st";break;case 2:r2="nd";break;case 3:r2="rd";break;default:r2="th";break}back_imgs[i]="Add "+back_picname[i+a]+"graphic where "+h+r2+" &#9674; is in Back Phrase.<br />";back_picname[i]=back_picname[i+a];h++}else{back_imgs[i]="";back_picname[i]=""}}back_imgs[maxChar]="";back_picname[maxChar]="";if(document.getElementById("nts_ad").value!=""){document.getElementById("note").style.visibility="visible"}var j=document.getElementById("nts");j.innerHTML=front_phrase;document.getElementById("nts_ad").value=front_phrase;back_phrase="";for(i=1;i<maxCharPlus1;i++){if(back_imgs[i]!=""){j.innerHTML+=back_imgs[i];document.getElementById("nts_ad").value+=back_imgs[i];back_phrase+=back_imgs[i]}}}else{if(code==46&&text20Focus&&end_pos.start!=maxChar){var h=1;for(i=1;i<=end_pos2.end;i++){if(back_imgs[i]!=""){h=h+1}}var b=f.length;var n=e.length;var a=b-n;var o=maxChar-a;for(i=end_pos2.end+1;i<=o;i++){if(back_imgs[i+a]!=""){switch(h){case 1:r2="st";break;case 2:r2="nd";break;case 3:r2="rd";break;default:r2="th";break}back_imgs[i]="Add "+back_picname[i+a]+"graphic where "+h+r2+" &#9674; is in Back Phrase.<br />";back_picname[i]=back_picname[i+a];h++}else{back_imgs[i]="";back_picname[i]=""}}back_imgs[maxChar]="";back_picname[maxChar]="";if(document.getElementById("nts_ad").value!=""){document.getElementById("note").style.visibility="visible"}var j=document.getElementById("nts");j.innerHTML=front_phrase;document.getElementById("nts_ad").value=front_phrase;back_phrase="";for(i=1;i<maxCharPlus1;i++){if(back_imgs[i]!=""){j.innerHTML+=back_imgs[i];document.getElementById("nts_ad").value+=back_imgs[i];back_phrase+=back_imgs[i]}}}else{if((code<33||code>40)&&text0Focus&&end_pos.start!=maxChar){var k=1;for(i=1;i<end_pos.start;i++){if(front_imgs[i]!=""){k=k+1}}var m=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){m[i]=""}var p=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){p[i]=""}var a=end_pos2.end-end_pos.start;var o=maxChar-a;for(i=end_pos.end+1;i<=o;i++){if(front_imgs[i]!=""){switch(k){case 1:r1="st";break;case 2:r1="nd";break;case 3:r1="rd";break;default:r1="th";break}m[i+a]="Add "+front_picname[i]+"graphic where "+k+r1+" &#9674; is in Front Phrase.<br />";p[i+a]=front_picname[i];k++}else{m[i+a]="";p[i+a]=""}}for(i=end_pos.start+1;i<=end_pos2.end;i++){front_imgs[i]="";front_picname[i]=""}for(i=end_pos2.end+1;i<=maxChar;i++){front_imgs[i]=m[i];front_picname[i]=p[i]}var j=document.getElementById("nts");j.innerHTML="";document.getElementById("nts_ad").value="";front_phrase="";for(i=1;i<maxCharPlus1;i++){if(front_imgs[i]!=""){j.innerHTML+=front_imgs[i];document.getElementById("nts_ad").value+=front_imgs[i];front_phrase+=front_imgs[i]}}j.innerHTML+=back_phrase;document.getElementById("nts_ad").value+=back_phrase}else{if((code<33||code>40)&&text20Focus&&end_pos.start!=maxChar){var h=1;for(i=1;i<end_pos.start;i++){if(back_imgs[i]!=""){h=h+1}}var l=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){l[i]=""}var r=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){r[i]=""}var a=end_pos2.end-end_pos.start;var o=maxChar-a;for(i=end_pos.end+1;i<=o;i++){if(back_imgs[i]!=""){switch(h){case 1:r2="st";break;case 2:r2="nd";break;case 3:r2="rd";break;default:r2="th";break}l[i+a]="Add "+back_picname[i]+"graphic where "+h+r2+" &#9674; is in Back Phrase.<br />";r[i+a]=back_picname[i];h++}else{l[i+a]="";r[i+a]=""}}for(i=end_pos.start+1;i<=end_pos2.end;i++){back_imgs[i]="";back_picname[i]=""}for(i=end_pos2.end+1;i<=maxChar;i++){back_imgs[i]=l[i];back_picname[i]=r[i]}var j=document.getElementById("nts");j.innerHTML=front_phrase;document.getElementById("nts_ad").value=front_phrase;back_phrase="";for(i=1;i<maxCharPlus1;i++){if(back_imgs[i]!=""){j.innerHTML+=back_imgs[i];document.getElementById("nts_ad").value+=back_imgs[i];back_phrase+=back_imgs[i]}}}else{if((code>=33&&code<=40)&&text0Focus){var c=document.getElementById("text0");end_pos=getCursorPosition(c);end_pos2=getCursorPosition(c)}else{if((code>=33&&code<=40)&&text20Focus){var c=document.getElementById("text20");end_pos=getCursorPosition(c);end_pos2=getCursorPosition(c)}}}}}}}}document.getElementById("position").value="Character was , Position was "+end_pos.start+","+end_pos.end+", Position is "+end_pos2.start+","+end_pos2.end;end_pos.start=end_pos2.start;end_pos.end=end_pos2.end;document.getElementById("text0_old").value=document.getElementById("text0").value;document.getElementById("text20_old").value=document.getElementById("text20").value}function insertAtCursor(d,h,f){var g=new CursorPos(0,0);if(navigator.appName=="Microsoft Internet Explorer"){if(d=="notes"||(d=="text0"&&!text0Focus)||(d=="text20"&&!text20Focus)){var a=h.value+f;h.value=a;var e=a.length;document.getElementById(d).focus(e)}else{h.focus();sel=document.selection.createRange();sel.text=f}}else{cur_pos=getCursorPosition(h);var c=cur_pos.start;var b=cur_pos.end;g.start=cur_pos.start+1;g.end=cur_pos.end+1;h.value=h.value.substring(0,c)+f+h.value.substring(b,h.value.length);setCursorPosition(h,g)}}var DHTML=(document.getElementById||document.all||document.layers);function getObj(a){if(document.getElementById){this.obj=document.getElementById(a);this.style=document.getElementById(a).style}else{if(document.all){this.obj=document.all[a];this.style=document.all[a].style}else{if(document.layers){this.obj=document.layers[a];this.style=document.layers[a]}}}}function dlgColorPalette(c){if(!DHTML){return}if(c!="note"){if(c=="glyphs"||c=="img"){f1="text0"}else{if(c=="glyphs2"||c=="img2"){f1="text20"}}var d=document.getElementById(f1);var b=getCursorPosition(d)}var a=new getObj(c);if(a.obj.style.visibility=="hidden"){a.obj.style.visibility="visible"}else{a.obj.style.visibility="hidden"}if(c!="note"){setCursorPosition(d,b);getPositions()}}function selectCharacter(q,l,d,t){var y="";var n=0;var f=1;var e=1;var b="";var a="";var r="";var p="";var o="";var g=document.getElementById("text0").value;var j=document.getElementById("text20").value;if((d=="glyphs"||d=="img")&&g.length==maxChar){alert("You have reached the maximum number of characters for the Front Phrase.")}else{if((d=="glyphs2"||d=="img2")&&j.length==maxChar){alert("You have reached the maximum number of characters for the Back Phrase.")
}}if(d=="glyphs"&&g.length<maxChar){insertAtCursor("text0",document.getElementById("text0"),q);y=document.getElementById("text0");end_pos=getCursorPosition(y);setCursorPosition(y,end_pos)}else{if(d=="glyphs2"&&j.length<maxChar){insertAtCursor("text20",document.getElementById("text20"),q);var y=document.getElementById("text20");end_pos=getCursorPosition(y);setCursorPosition(y,end_pos)}else{if(d=="img"&&g.length<maxChar){insertAtCursor("text0",document.getElementById("text0"),q);y=document.getElementById("text0");end_pos=getCursorPosition(y);var w=1;for(i=1;i<end_pos.end;i++){if(front_imgs[i]!=""){w=w+1}}var c=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){c[i]=""}var h=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){h[i]=""}f=parseInt(w);for(i=end_pos.end;i<maxChar;i++){if(front_imgs[i]!=""){f++;switch(f){case 1:p="st";break;case 2:p="nd";break;case 3:p="rd";break;default:p="th";break}c[i+1]="Add "+front_picname[i]+"graphic where "+f+p+" "+q+" is in Front Phrase.<br />";h[i+1]=front_picname[i]}else{c[i+1]="";h[i+1]=""}}for(i=end_pos.end+1;i<=maxChar;i++){front_imgs[i]=c[i];front_picname[i]=h[i]}switch(w){case 1:b="st";break;case 2:b="nd";break;case 3:b="rd";break;default:b="th";break}r="Add "+t+"graphic where "+w+b+" "+q+" is in Front Phrase.<br />";document.getElementById("note").style.visibility="visible";var u=document.getElementById("nts");front_imgs[end_pos.end]=r;front_picname[end_pos.end]=t;u.innerHTML="";document.getElementById("nts_ad").value="";front_phrase="";for(i=1;i<maxCharPlus1;i++){if(front_imgs[i]!=""){u.innerHTML+=front_imgs[i];document.getElementById("nts_ad").value+=front_imgs[i];front_phrase+=front_imgs[i]}}u.innerHTML+=back_phrase;document.getElementById("nts_ad").value+=back_phrase;setCursorPosition(y,end_pos)}else{if(d=="img2"&&j.length<maxChar){insertAtCursor("text20",document.getElementById("text20"),q);y=document.getElementById("text20");end_pos=getCursorPosition(y);var v=1;for(i=1;i<end_pos.end;i++){if(back_imgs[i]!=""){v=v+1}}var m=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){m[i]=""}var s=new Array(maxCharPlus1);for(i=0;i<=maxChar;i++){s[i]=""}e=parseInt(v);for(i=end_pos.end;i<maxChar;i++){if(back_imgs[i]!=""){e++;switch(e){case 1:o="st";break;case 2:o="nd";break;case 3:o="rd";break;default:o="th";break}m[i+1]="Add "+back_picname[i]+"graphic where "+e+o+" "+q+" is in Back Phrase.<br />";s[i+1]=back_picname[i]}else{m[i+1]="";s[i+1]=""}}for(i=end_pos.end+1;i<=maxChar;i++){back_imgs[i]=m[i];back_picname[i]=s[i]}switch(v){case 1:a="st";break;case 2:a="nd";break;case 3:a="rd";break;default:a="th";break}r="Add "+t+"graphic where "+v+a+" "+q+" is in Back Phrase.<br />";document.getElementById("note").style.visibility="visible";var u=document.getElementById("nts");back_imgs[end_pos.end]=r;back_picname[end_pos.end]=t;u.innerHTML=front_phrase;document.getElementById("nts_ad").value=front_phrase;back_phrase="";for(i=1;i<maxCharPlus1;i++){if(back_imgs[i]!=""){u.innerHTML+=back_imgs[i];document.getElementById("nts_ad").value+=back_imgs[i];back_phrase+=back_imgs[i]}}setCursorPosition(y,end_pos)}}}}showphrases();getprice();document.getElementById("text0_old").value=document.getElementById("text0").value;document.getElementById("text20_old").value=document.getElementById("text20").value}function InitColorPalette(){if(document.getElementsByTagName){var a=document.getElementsByTagName("TD")}else{if(document.all){var a=document.all.tags("TD")}}for(var b=0;b<a.length;b++){if(a[b].className=="on_hover"){a[b].onmouseover=over;a[b].onmouseout=out;a[b].onclick=click}}}function over(){this.style.backgroundColor="#777777";if(document.getElementById("text0").hasFocus){text0Focus=true}else{text0Focus=false}if(document.getElementById("text20").hasFocus){text20Focus=true}else{text20Focus=false}}function out(){this.style.backgroundColor="#FFFFFF"}function click(){var a=findParent(this,"div");var c=this.id;var d=new Array();var b="";d=c.split("_");for(x=2;x<d.length;x++){b+=d[x]+" "}if(a.id=="img"||a.id=="img2"){selectCharacter(d[1],d[0],a.id,b)}else{selectCharacter(this.id,this.name,a.id,"")}}function findParent(b,a){a=a.toLowerCase();while(b&&b.tagName){if(b.tagName.toLowerCase()==a){return b}b=b.parentNode}return false};
