﻿function OpenHelp(anchor){var helpPopup=document.getElementById('IFramePopup_Help');if((helpPopup)&&(helpPopup.parentNode)){CloseIFramePopup(helpPopup);}else{OpenIFramePopup('IFramePopup_Help',anchor,920,560,document._ps_HelpUri);}};function SetLoadTime(){var pageTotalLoadTimeControl=document.getElementById("PageTotalLoadTime");if(pageTotalLoadTimeControl){var now=(new Date()).getTime();pageTotalLoadTimeControl.innerHTML=((now-document._ps_PageLoadingBegin)+(document._ps_PageServerTime*1))/1000;}};function ImageButtonKeyEvent(sender,currentEvent,imgUrl){if(currentEvent.keyCode==Sys.UI.Key.enter)sender.src=imgUrl;};function ImageButtonBlur(sender,imgUrl){sender.src=imgUrl;};function _ps_OpenTestRegex(anchor,regex){var userSellersFiltersPopup=document.getElementById('IFramePopup_TestRegex');if((userSellersFiltersPopup)&&(userSellersFiltersPopup.parentNode)){CloseIFramePopup(userSellersFiltersPopup);}else{OpenIFramePopup('IFramePopup_TestRegex',anchor,410,170,document._ps_TestRegexUrl+'?regex='+regex,"right");}};function _ps_ShowTermsPopup(anchor,align){var userSellersFiltersPopup=document.getElementById('IFramePopup_Terms');if((userSellersFiltersPopup)&&(userSellersFiltersPopup.parentNode)){CloseIFramePopup(userSellersFiltersPopup);}else{OpenIFramePopup('IFramePopup_Terms',anchor,500,500,document._ps_TermsPopupUrl,align,"bottom");}};if(navigator.userAgent.indexOf("Firefox")!=-1){HTMLElement.prototype.click=function(){var evt=this.ownerDocument.createEvent('MouseEvents');evt.initMouseEvent('click',true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);this.dispatchEvent(evt);}};function _ps_TermsAgreeRequired(sender,e){e.IsValid=document.getElementById(document._ps_TermsAgreeCheckBoxId).checked;};function _FindAbsolutePosition(element){var result=new Object();result.offsetLeft=0;result.offsetTop=0;var currentNode=element;while(currentNode){if((currentNode.offsetLeft)&&(!isNaN(currentNode.offsetLeft)))result.offsetLeft+=currentNode.offsetLeft;if((currentNode.offsetTop)&&(!isNaN(currentNode.offsetTop)))result.offsetTop+=currentNode.offsetTop;currentNode=currentNode.offsetParent;};return result;};function OpenIFramePopup(name,anchor,width,height,url,align,valign,onclose){var absolutePosition=_FindAbsolutePosition(anchor);if((valign!='top')&&(valign!='bottom')&&(valign!='middle'))valign='bottom';if((align!='left')&&(align!='right')&&(align!='center'))align='left';if((align)&&((align=="left")||(align=="right")||(align=="center"))){if(align=="left"){if(((absolutePosition.offsetLeft+width)>document.body.scrollWidth)&&((absolutePosition.offsetLeft+anchor.offsetWidth-width)>=0)){absolutePosition.offsetLeft+=(anchor.offsetWidth-width);}else{absolutePosition.offsetLeft=0;}}}else{if(((absolutePosition.offsetLeft+width)>document.body.scrollWidth)&&((absolutePosition.offsetLeft+anchor.offsetWidth-width)>=0)){absolutePosition.offsetLeft+=(anchor.offsetWidth-width);}};if((valign)&&((valign="bottom")||(valign="top"))){if(valign=="bottom"){if(anchor.offsetHeight==0)absolutePosition.offsetTop+=anchor.parentNode.offsetHeight;else absolutePosition.offsetTop+=anchor.offsetHeight;}else absolutePosition.offsetTop-=height;}else{if(((absolutePosition.offsetTop+anchor.offsetHeight+height)>document.body.scrollHeight)&&((absolutePosition.offsetTop-height)>0)){absolutePosition.offsetTop-=height;}else{absolutePosition.offsetTop+=anchor.offsetHeight;}};OpenIFramePopupAt(name,anchor,absolutePosition.offsetLeft,absolutePosition.offsetTop,width,height,url,onclose);};function ShowSplash(left,top,width,height,url){loadingDiv=document.createElement("div");loadingDiv.id="splash_div";loadingDiv.className="LoadingSplash";document.body.appendChild(loadingDiv);loadingDiv.style.left=left+"px";loadingDiv.style.top=top+"px";loadingDiv.style.width=width+"px";loadingDiv.style.height=height+"px";if(top>(document.body.offsetHeight+document.body.scrollTop))loadingDiv.scrollIntoView(false);};function OpenIFramePopupAt(id,anchor,left,top,width,height,url,onclose){if(document._lastOpenedIFramePopups){if(window.document._ps_autoCloseTimerId){window.clearTimeout(window.document._ps_autoCloseTimerId);window.document._ps_autoCloseTimerId=null;};CloseIFramePopup(document._lastOpenedIFramePopups);};ShowSplash(left,top,width,height);var newFrame=document.createElement("iframe");newFrame.src=url;newFrame.id=id;newFrame.className="IFRAMEPopup";newFrame.scrolling="no";newFrame.frameBorder=0;document.body.appendChild(newFrame);newFrame.style.left=left+"px";newFrame.style.top=top+"px";newFrame.style.width=width+"px";newFrame.style.height=height+"px";document._lastOpenedIFramePopups=newFrame;document._IFramePopupOpener=anchor;document._onclose=onclose;var newBottomShadow=document.createElement("div");newBottomShadow.id=id+"_bottomShadow";document.body.appendChild(newBottomShadow);newBottomShadow.className="BottomShadow";newBottomShadow.style.left=left+7+"px";newBottomShadow.style.top=top+height+2+"px";newBottomShadow.style.width=width-5+"px";newBottomShadow.innerHTML='<img src="http://www.pricespider.com/imgs/spc.gif"/>';var newRightShadow=document.createElement("div");newRightShadow.id=id+"_rightShadow";document.body.appendChild(newRightShadow);newRightShadow.className="RightShadow";newRightShadow.style.left=left+width+2+"px";newRightShadow.style.top=top+7+"px";newRightShadow.style.height=height-5+"px";newRightShadow.innerHTML='<img src="http://www.pricespider.com/imgs/spc.gif"/>';var newBottomLeftShadow=document.createElement("img");newBottomLeftShadow.id=id+"_bottomRightShadow";document.body.appendChild(newBottomLeftShadow);newBottomLeftShadow.className="BottomRightShadow";newBottomLeftShadow.style.left=left+width+2+"px";newBottomLeftShadow.style.top=top+height+2+"px";newBottomLeftShadow.src='http://www.pricespider.com/imgs/spc.gif';};function ResizePopup(deltaWidth,deltaHeight){var iframe=window.frameElement.ownerDocument._lastOpenedIFramePopups;if(iframe){var shadow=window.frameElement.ownerDocument.getElementById(iframe.id+"_rightShadow");shadow.style.left=shadow.offsetLeft+deltaWidth+"px";shadow.style.height=shadow.offsetHeight+deltaHeight+"px";shadow=window.frameElement.ownerDocument.getElementById(iframe.id+"_bottomRightShadow");shadow.style.left=shadow.offsetLeft+deltaWidth+"px";shadow.style.top=shadow.offsetTop+deltaHeight+"px";shadow=window.frameElement.ownerDocument.getElementById(iframe.id+"_bottomShadow");shadow.style.width=shadow.offsetWidth+deltaWidth;shadow.style.top=shadow.offsetTop+deltaHeight;iframe.style.width=iframe.offsetWidth+deltaWidth-2+"px";iframe.style.height=iframe.offsetHeight+deltaHeight-2+"px";}};function RenamePopup(id){var iframe=window.frameElement.ownerDocument._lastOpenedIFramePopups;if(iframe){var oldId=iframe.id;iframe.ownerDocument.getElementById(oldId+"_rightShadow").id=id+"_rightShadow";iframe.ownerDocument.getElementById(oldId+"_bottomRightShadow").id=id+"_bottomRightShadow";iframe.ownerDocument.getElementById(oldId+"_bottomShadow").id=id+"_bottomShadow";iframe.id=id;}};function ReplaceIFramePopup(iframe,id,width,height,url,onclose){if(iframe.ownerDocument._onclose){iframe.ownerDocument._onclose();iframe.ownerDocument._onclose=null;};iframe.src=url;RenamePopup(id);var deltaWidth=width?width-iframe.offsetWidth:0;var deltaHeight=height?height-iframe.offsetHeight:0;if((deltaWidth!=0)||(deltaHeight!=0))ResizePopup(deltaWidth,deltaHeight);document._onclose=onclose;};function PopupOnMouseOver(window){if((window.document._ps_autoCloseTimerId)&&(window.document._ps_autoCloseTimerId!=null)){window.clearTimeout(window.document._ps_autoCloseTimerId);window.document._ps_autoCloseTimerId=null;}};function PopupOnMouseOut(window){var lastOpenedIFramePopups;lastOpenedIFramePopups=window.frameElement?document._lastOpenedIFramePopups:window.frameElement.ownerDocument._lastOpenedIFramePopups;if(lastOpenedIFramePopups)window.document._ps_autoCloseTimerId=window.setTimeout(function(){CloseIFramePopup(lastOpenedIFramePopups);},500);};function RemoveSplash(){splashDiv=parent.loadingDiv;if((splashDiv)&&(splashDiv.parentNode))splashDiv.parentNode.removeChild(splashDiv);};function CloseIFramePopup(iframe){RemoveSplash();if(!iframe)return;var parentNode=iframe.parentNode;if(!parentNode)return;var element=parentNode.ownerDocument.getElementById(iframe.id+"_bottomShadow");if(element)parentNode.removeChild(element);element=parentNode.ownerDocument.getElementById(iframe.id+"_rightShadow");if(element)parentNode.removeChild(element);element=parentNode.ownerDocument.getElementById(iframe.id+"_bottomRightShadow");if(element)parentNode.removeChild(element);parentNode.removeChild(iframe);if(iframe.ownerDocument._lastOpenedIFramePopups==iframe){iframe.ownerDocument._lastOpenedIFramePopups=null;iframe.ownerDocument._IFramePopupOpener=null;};if(iframe.ownerDocument._onclose){iframe.ownerDocument._onclose();iframe.ownerDocument._onclose=null;}};function RefreshParentDocument(){if(window.frameElement.document)window.frameElement.document.location.reload(true);else window.parent.location.reload(true);};function LoadParentDocument(url){if(window.frameElement.document)window.frameElement.document.location.assign(url);else window.parent.location.assign(url);};function ReopenIFramePopup(){if(window.frameElement.document){var hasParams=window.frameElement.document.location.href.indexOf('?')>-1;window.frameElement.document.location.replace(window.frameElement.document.location.href+(hasParams?"&":"?")+"click="+window.frameElement.document._IFramePopupOpener);}else{var hasParams=window.parent.location.href.indexOf('?')>-1;window.parent.location.replace(window.parent.location.href+(hasParams?"&":"?")+"click="+window.parent._IFramePopupOpener);};};if(navigator.userAgent.indexOf("Firefox")!=-1){HTMLElement.prototype.click=function(){var evt=this.ownerDocument.createEvent('MouseEvents');evt.initMouseEvent('click',true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);this.dispatchEvent(evt);}};function SetHiddenField(hiddenFieldId,id,control){var selectedInput=document.getElementById(hiddenFieldId);var isModified=false;var selected;if(selectedInput.value!='')selected=selectedInput.value.split(',');else selected=new Array(0);var checked;var l=selected.length;for(var i=0;i<l;i++){if(selected[i]==id){checked=control.getAttribute('checked')==true||control.getAttribute('checked')=='true';if(!checked){selected.splice(i,1);selectedInput.value=selected.join(',');return;}}};checked=control.getAttribute('checked')==true||control.getAttribute('checked')=='true';if(checked){selected.push(id);selectedInput.value=selected.join(',');}};function s3(control){var checked=control.getAttribute('checked')!=true&&control.getAttribute('checked')!='true';control.setAttribute('checked',checked);if(checked)control.className="SelectedListItem";else control.className=null;};function s(id,control,highlightedId){s3(control);SetHiddenField(highlightedId,id,control);};function c(id,control,highlightedId){s(id,control.parentNode,highlightedId);};function CopyToClipboard(txtBox){if(Sys.Browser.agent==Sys.Browser.InternetExplorer){window.clipboardData.setData('Text',txtBox.value);}else{var copied=txtBox.value.createTextRange();copied.execCommand("Copy");}};function OpenImportProductsHelp(anchor){var importProductsHelpPopup=document.getElementById('IFramePopup_ImportProductsHelp');if((importProductsHelpPopup)&&(importProductsHelpPopup.parentNode)){CloseIFramePopup(importProductsHelpPopup);}else{OpenIFramePopup('IFramePopup_ImportProductsHelp',anchor,400,210,document._ps_ImportProductsHelpUrl,"right");}};function OpenRegisterSiteHelp(anchor){var registerSiteHelpPopup=document.getElementById('IFramePopup_OpenRegisterSiteHelp');if((registerSiteHelpPopup)&&(registerSiteHelpPopup.parentNode)){CloseIFramePopup(registerSiteHelpPopup);}else{OpenIFramePopup('IFramePopup_OpenRegisterSiteHelp',anchor,500,250,document._ps_RegisterSiteHelpUrl,"right");}};function _ps_SetTimeoutLogout(logoutUrl){if(document._ps_LogoutTimer)window.clearTimeout(document._ps_LogoutTimer);document._ps_LogoutTimer=window.setTimeout(function(){window.open(logoutUrl,'_self');},3600000);};function _ps_SetSelectedView(a,b){document.getElementById(document._ps_SelectedViewIndexHiddenFieldId).value=a._selectedIndexesJson;};


