function setBlank(objField){if(objField.value==objField.defaultValue){objField.value="";}}function setDefault(objField){if(objField.value==""){objField.value=objField.defaultValue;}}function insertLink(protocol,domainName,filePath,linkText){insertLinkEx(protocol,domainName,0,filePath,null,null,null,linkText);}function insertLinkEx(protocol,domainName,portNumber,filePath,target,className,id,linkText){var linkTagText='<a href="';linkTagText+=protocol;linkTagText+="://";linkTagText+=domainName;if(portNumber!=0){linkTagText+=":";linkTagText+=portNumber;}linkTagText+="/";linkTagText+=filePath;linkTagText+='"';if(target!=null){linkTagText+=' target="';linkTagText+=target;linkTagText+='"';}if(className!=null){linkTagText+=' class="';linkTagText+=className;linkTagText+='"';}if(id!=null){linkTagText+=' id="';linkTagText+=id;linkTagText+='"';}linkTagText+=' rel="nofollow"';linkTagText+=">";linkTagText+=linkText;linkTagText+="</a>";document.write(linkTagText);}function initPage(){document.body.onbeforeunload="sendPageEvent(1)";el=document.getElementById("leftmenu1");el.style.display="";document.getElementById("listimage1").style.backgroundImage="url(../assets/images/compress.gif)";el=document.getElementById("leftmenu3");el.style.display="";document.getElementById("listimage3").style.backgroundImage="url(../assets/images/compress.gif)";el=document.getElementById("leftmenu2");if(el){el.style.display="";document.getElementById("listimage2").style.backgroundImage="url(../assets/images/compress.gif)";}}function drop(id,num){el=document.getElementById(id);var display=el.style.display?"":"none";el.style.display=display;if(display=="none"){document.getElementById("listimage"+num).style.backgroundImage="url(../assets/images/expand.gif)";display="";}else{document.getElementById("listimage"+num).style.backgroundImage="url(../assets/images/compress.gif)";}}function getAjaxRequest(){var openRequest;try{openRequest=new XMLHttpRequest();return openRequest;}catch(error){try{openRequest=new ActiveXObject("Microsoft.XMLHTTP");return openRequest;}catch(error){if(debug){displayDebugError("Error creating AJAX request:\n",error);}return null;}}}var adRequest=getAjaxRequest();var adIdValue;function showDynadritiAd(adId){var adServer="/misc/dynadriti?tid="+adId+"&r=";adServer+=escape(document.referrer);adRequest.onreadystatechange=loadAd;adRequest.open("GET",adServer,true);adRequest.send(null);adIdValue=adId;}function loadAd(){if(adRequest.readyState==4){if(adRequest.status==200){var divAdId=document.getElementById(adIdValue);divAdId.innerHTML=adRequest.responseText;}}}var clickedPromo;function showCatalogSelector(promoInput,event){var divCatalogSelector=document.getElementById("catalogselector");var divContent="Loading. . .";clickedPromo=promoInput;repositionCatalogSelector(event.clientX,event.clientY);}function getCatalogSelector(){var divCatalogSelector;if(document.getElementById){divCatalogSelector=document.getElementById("catalogselector");}else{if(document.all){divCatalogSelector=document.all.catalogselector;}}return divCatalogSelector;}function repositionCatalogSelector(x,y){var divCatalogSelector=getCatalogSelector();if(divCatalogSelector!=null){divCatalogSelector.style.left=(x-80-5)+"px";divCatalogSelector.style.top=y+"px";loadCatalogSelector();}}var request;function loadCatalogSelector(){var category=clickedPromo.name;try{if(category){request=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP.3.0");request.open("GET","/control/showcatalogselector?promo="+category,true);getCatalogSelector().innerHTML='<div id="catalogselectorcontent">Loading .</div>';getCatalogSelector().style.display="block";request.onreadystatechange=function(){if(request.readyState==3){document.getElementById("catalogselectorcontent").innerHTML=document.getElementById("catalogselectorcontent").innerHTML+" .";}else{if(request.readyState==4){if(request.status==200){if(request.responseText){new Effect.Fade("catalogselectorcontent",{afterFinish:showData1});}}else{getCatalogSelector().innerHTML="Could not load catalogs for '"+clickedPromo.name+"' category.";}}}};request.send(null);}else{window.location=clickedPromo;}}catch(e){getCatalogSelector().style.display="block";getCatalogSelector().innerHTML="Could not load catalogs for '"+clickedPromo.name+"' category.";}return false;}function showData1(){getCatalogSelector().innerHTML=request.responseText;Element.hide("catalogselectorcontent");document.getElementById("catalogselectorcontent").style.borderWidth="1px";document.getElementById("catalogselectorcontent").style.borderStyle="solid";document.getElementById("catalogselectorcontent").style.borderColor="#b9567e";new Effect.SlideDown("catalogselectorcontent");}function gotoCategory(categorySelect){var categoryPage="http://shop.theflowerexpert.com/send-"+categorySelect.options[categorySelect.selectedIndex].value.split("_")[0]+"-flowers-to-"+categorySelect.options[categorySelect.selectedIndex].value.split("_")[1];document.location.href=categoryPage;}function gotoProduct(productSelect){var productPage="http://shop.theflowerexpert.com/products/"+productSelect.options[productSelect.selectedIndex].value.split("_")[1]+"/"+productSelect.options[productSelect.selectedIndex].value.split("_")[0];document.location.href=productPage;}function gotoLink(categorySelect){var categoryPage=categorySelect.options[categorySelect.selectedIndex].value.split("_")[0];document.location.href=categoryPage;}function closeClicked(closeButton,e){new Effect.BlindUp("catalogselector");if(e&&e.preventDefault){e.preventDefault();return true;}else{return false;}}