function disableEnterKey(e){var key;if(window.event)key=window.event.keyCode;else key=e.which;return(key!=13)}function EmailPage(){var url=location.href;window.open("mailto:EnterEmailHere?subject="+url)}function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){curleft+=obj.offsetLeft;curtop+=obj.offsetTop}}return[curleft,curtop]}function chooseColor(hex,colorname){document.aspnetForm.SelectedColor.value=hex;var newColor=new Image(71,55);newColor.src="./picbutton.asp?clr=";newColor.src+=hex;if(colorname!="")document.getElementById('color').innerHTML=colorname;document.getElementById('currentColor').src=newColor.src;return false}function ChooseColor2(hex){document.getElementById("selectedColorImage").src="/images/swatch/"+hex+".gif";document.getElementById("SelectedColor").value=hex}function stat(name){window.status=name;return true}function makeargs(url){url+='?img='+document.aspnetForm.workingImage.value+".gif";url+='&ops='+1;top.location.href=url}function verifyColor(){if(parent.pictureFrame.document.pictureForm){clr=parent.pictureFrame.document.pictureForm.clr.value;chooseColor(clr,'White')}}function fillcolorin(e){var x,y;var b=document.getElementById("pictureToColor");var pos=new Array();pos=findPos(b);if(e.offsetX){x=e.offsetX;y=e.offsetY}else if(e.layerX){x=e.pageX-pos[0];y=e.pageY-pos[1]}else{return true}ajaxFunction(x,y);return false}function ajaxFunction(x,y){var xmlHttp;try{xmlHttp=new XMLHttpRequest()}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){alert("Your browser does not support AJAX!");return false}}}xmlHttp.onreadystatechange=function(){var curentDT=new Date();if(xmlHttp.readyState==4){document.getElementById("canvasimg").src=document.getElementById("canvasimg").src+'?'+curentDT}};xmlHttp.open("GET","/FillTheImage.aspx?img="+document.aspnetForm.workingImage.value+"&color="+document.aspnetForm.SelectedColor.value+"&x="+x+"&y="+y,true);xmlHttp.send(null)}function SubmitForm(control,theForm){if(control.value==-1){alert("Please select the category");control.focus();return}theForm.submit()}function removeText(data,str){if(data.value==str)data.value=''}function showdata(data,str){if(data.value=='')data.value=str}function imageholderclass(){this.over=new Array();this.down=new Array();this.src=new Array();this.store=store;function store(src,down,over){var AL=this.src.length;this.src[AL]=new Image();this.src[AL].src=src;this.over[AL]=new Image();this.over[AL].src=over;this.down[AL]=new Image();this.down[AL].src=down}}var ih=new imageholderclass();var mouseisdown=0;function preloader(t){for(i=0;i<t.length;i++){if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){storeimages(t[i]);var checker='';checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';switch(checker){case'A':mouseover(t[i]);mouseout(t[i]);break;case'B':mousedown(t[i]);mouseup2(t[i]);break;case'AB':mouseover(t[i]);mouseout(t[i]);mousedown(t[i]);mouseup(t[i]);break;default:return}if(t[i].src){t[i].setAttribute("oldsrc",t[i].src)}}}}function mouseup(t){var newmouseup;if(t.onmouseup){t.oldmouseup=t.onmouseup;newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup()}}else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover")}}t.onmouseup=newmouseup}function mouseup2(t){var newmouseup;if(t.onmouseup){t.oldmouseup=t.onmouseup;newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup()}}else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc")}}t.onmouseup=newmouseup}function mousedown(t){var newmousedown;if(t.onmousedown){t.oldmousedown=t.onmousedown;newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown()}}}else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown")}}}t.onmousedown=newmousedown}function mouseover(t){var newmouseover;if(t.onmouseover){t.oldmouseover=t.onmouseover;newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover()}}else{newmouseover=function(){this.src=this.getAttribute("srcover")}}t.onmouseover=newmouseover}function mouseout(t){var newmouseout;if(t.onmouseout){t.oldmouseout=t.onmouseout;newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout()}}else{newmouseout=function(){this.src=this.getAttribute("oldsrc")}}t.onmouseout=newmouseout}function storeimages(t){var s=(t.getAttribute('src'))?t.getAttribute('src'):'';var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';ih.store(s,d,o)}function preloadimgsrc(){if(!document.getElementById)return;var it=document.getElementsByTagName('IMG');var it2=document.getElementsByTagName('INPUT');preloader(it);preloader(it2)}if(window.addEventListener){window.addEventListener("load",preloadimgsrc,false)}else{if(window.attachEvent){window.attachEvent("onload",preloadimgsrc)}else{if(document.getElementById){window.onload=preloadimgsrc}}}function isValidEmailAddress(emailAddress) {var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i); return pattern.test(emailAddress);}
