//<!--
//\include\js\popout\promo_popout_mediaplex.js@@\main\24

var bPopUpWindow=true,winPopped=false;var platform=navigator.platform.toLowerCase();var surveyCookie="surveySays";var surveyValue="shown";var surveyTempPopupFile="popout/temp_survey_popup.html";var eInd=document.domain.indexOf(".ebay."),tDomain;if(eInd!=-1)
tDomain=document.domain.substr(eInd+1);function eBayIsIE4()
{var agent=navigator.userAgent.toLowerCase();var is_ie=(agent.indexOf("msie")!=-1);var minor=is_ie?parseFloat(agent.substring(agent.indexOf('msie')+5)):parseFloat(navigator.appVersion);var isie4=parseInt(minor)==4;return isie4;}
function setPopOutSwitch(bOnOrOff,myfunction)
{bPopUpWindow=bOnOrOff;}
function popupWindow(mypage,target,w,h,scroll,no,pLeft,pTop,params){if(target=="_self")
return false;LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;if(pLeft)
LeftPosition=pLeft;if(pTop)
TopPosition=pTop;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+no+'';top.win=window.open(mypage,target,settings+","+params);winPopped=true;return false;}
function checkHome(){var valueOfCheckHome=false;var agt=navigator.userAgent.toLowerCase();var myopera=(agt.indexOf("opera")!=-1);if(eBayIsIE4())
{return false;}
if(!myopera&&platform.indexOf('mac')==-1&&typeof(oHomePage)!='undefined')
{valueOfCheckHome=eval('oHomePage.isHomePage("http://"+document.location.host+"/")');}
else
{valueOfCheckHome=false;}
return valueOfCheckHome;}
function findForms()
{var formsArray=document.forms;var i;var strFormSubmit="";for(i=0;i<formsArray.length;i++)
{strFormSubmit+='<SC'+'RIPT FOR=\"'+formsArray[i].name+'\" EVENT=\"onsubmit\" LANGUAGE=\"JavaScript\">';strFormSubmit+='setPopOutSwitch(false)\;';strFormSubmit+='<\/SC'+'RIPT>';}
document.write(strFormSubmit);}
function startCounterCookie(){var now="";var countscookie="";var countcookie="";now=new Date();Year=now.getUTCFullYear();Month=now.getMonth();Day=now.getDate();now=new Date(Year,Month,Day);now.setTime(now.getTime()+24*60*60*1000);countcookie=ReadCookie("count");if(!countcookie){countcookie=1;}else{countcookie=parseInt(countcookie)+1;}
WriteCookie("count",countcookie,tDomain,"/",now);testIt();}
function popOutWindow(pURL,width,height,pSurvey,pSampleRate)
{if(typeof(width)=='undefined')
width='275';if(typeof(height)=='undefined')
width='375';var valueOfCounts=0;var valueOfCheckHome=false;var valueOfKeepMeSignIn=null;var valueOfEbaySignIn=null;if(!pSurvey)
{valueOfKeepMeSignIn=ReadCookie("keepmesignin");valueOfEbaySignIn=ReadCookie("ebaysignin");valueOfCheckHome=checkHome();valueOfCounts=ReadCookie("count");}
testIt();if(bPopUpWindow)
{if((valueOfCheckHome!=true)&&(valueOfCounts<2))
{if((valueOfEbaySignIn!="in")&(valueOfKeepMeSignIn!="in"))
{var notMac=((navigator.userAgent.toLowerCase()).indexOf("mac")==-1);if(pSurvey&&!winPopped&&notMac&&(ReadCookie(surveyCookie)!=surveyValue))
return showSurveyWindow(pURL,width,height,pSampleRate);else if(!pSurvey)
return popupWindow(pURL,'SureYouWantToLeave',width,height,'no','yes');}}}}
function showExitPollSurveyWindow(pURL,pWidth,pHeight)
{var chn=document.location.hostname;var host="http://pages"+chn.substr(chn.indexOf("."));host+="/";var sInd=host.indexOf(".stores.");if(sInd!=-1)
host=host.substring(0,sInd+1)+host.substring(sInd+8,host.length);pURL=host+surveyTempPopupFile+"?"+pURL;pURL+="&ep=&ts="+new String(new Date())+"&width=600&height=400";var pWin=popupWindow(pURL,'ebSurvey',600,400,'yes','yes','5000','5000');return pWin;}
function showSurveyWindow(pURL,pWidth,pHeight,pSampleRate)
{var rnd=Math.floor(Math.random()*10000);if((rnd%3)!=0)
return false;var reg=ReadCookie("reg");var etfc=ReadCookie("etfc");var uType="A";if(reg=="1")
{if(etfc=="1")
uType="C";else if(etfc=="2")
uType="D";else
uType="B";}
pURL+=uType;var chn=document.location.hostname;var host="http://pages"+chn.substr(chn.indexOf("."));host+="/";var sInd=host.indexOf(".stores.");if(sInd!=-1)
host=host.substring(0,sInd+1)+host.substring(sInd+8,host.length);pURL=host+surveyTempPopupFile+"?"+pURL;pURL+="&ts="+new String(new Date())+"&width=600&height=400";var pWin=popupWindow(pURL,'ebSurvey',600,400,'yes','yes','5000','5000');return pWin;}
function writeClickListener()
{var agt=navigator.userAgent.toLowerCase();var mymac=(agt.indexOf("mac")!=-1);var myopera=(agt.indexOf("opera")!=-1);if(platform.indexOf('mac')==-1&&!myopera)
{var string='';string+='<SCR'+'IPT FOR="document" EVENT="onmousedown()" LANGUAGE="JavaScript">';string+='var eventTag = window.event.srcElement.tagName.toLowerCase();';string+='if(eventTag == "a" || eventTag == "img" || eventTag == "area" || eventTag == "input")';string+='{';string+='setPopOutSwitch(false)\;';string+='}';string+='<\/SC'+'RIPT>';string+='<SCR'+'IPT FOR="document" EVENT="onkeypress()" LANGUAGE="JavaScript">';string+='var eventTag = window.event.srcElement.tagName.toLowerCase();';string+='if(eventTag == "input")';string+='{';string+='setPopOutSwitch(false)\;';string+='}';string+='<\/SC'+'RIPT>';document.write(string);}}
function eBayIsFramed()
{if(top==self)
{return false;}
else
{return true;}}
function eBayToolbarPluginDetect()
{var plugin=false;var mimetype="application/x-eBay-Toolbar-Plugin-Functions";var nsname="eBay Plugin Functions";if(typeof(navigator.mimeTypes)!='undefined'&&navigator.mimeTypes[mimetype]&&navigator.mimeTypes[mimetype].enabledPlugin)
{if(navigator.plugins)
plugin=true;}
else if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(navigator.userAgent.indexOf("Windows")>=0)){if(eBayIsIE4())
{return false;}
else if(typeof(IECheckClient)=="unknown")
{plugin=IECheckClient();}}
return plugin;}
if(eBayToolbarPluginDetect()){setPopOutSwitch(false,"toolbar");}
if(eBayIsFramed()){setPopOutSwitch(false,"framed");}
function testIt()
{}
var popWinLoaded=true;
// -->

