var MMPop={Public:{popWinWidth:1280,popWinHeight:1024,popWinURL:'http://gfsale.com/gf.php',overlayURL:'',maxPops:1,noPopUnder:0,forceOverlay:0,}};(function(){var MMPop={Private:{noPopUnder:this.MMPop.Public.noPopUnder,popWinURL:this.MMPop.Public.popWinURL,maxPops:this.MMPop.Public.maxPops,popWinWidth:this.MMPop.Public.popWinWidth,popWinHeight:this.MMPop.Public.popWinHeight,overlayURL:this.MMPop.Public.overlayURL,forceOverlay:this.MMPop.Public.forceOverlay,LayerDisableFollow:false,LayerDelay:0,LayerExpandSpeed:8,LayerRetractSpeed:8,LayerRetractDelay:15,LayerRetractPause:false,CookieName:"mmpoptimeout",_Top:null,PopWin:null,PopLoaded:false,CtrlButtonDown:false,ShiftButtonDown:false,LeftMouseDown:false,SessionGuid:null,IsIE:false,JsHost:null,PreInit:function(){this._Top=self;if(top!=self){try{if(top.document.location.toString())this._Top=top;}
catch(err){}}
var div=document.createElement('div');div.innerHTML='<!--[if IE]><![endif]-->';this.IsIE=(div.innerHTML.length==0)?true:false;this.JsHost=(("https:"==document.location.protocol)?"https://":"http://");this.Init();},Init:function(){this.SessionGuid=this.GetGuid();if(this.GetPoppedTotal()<this.maxPops){MMPop.Private.AddEvent(MMPop.Private._Top.document,"click",function(e){if(!MMPop.Private.InitPop(e)){if(e.preventDefault){e.preventDefault()}
e.returnValue=false;}});MMPop.Private.AddEvent(MMPop.Private._Top.document,"mousedown",function(e){MMPop.Private.HandleMouseEvent(e);});MMPop.Private.AddEvent(MMPop.Private._Top.document,"mouseup",function(e){MMPop.Private.HandleMouseEvent(e);});}},HandleMouseEvent:function(e){var mouseButtonEvent=(window.Event)?e.which:e.button;this.CtrlButtonDown=(e.ctrlKey)?true:false;this.ShiftButtonDown=(e.shiftKey)?true:false;this.LeftMouseDown=(mouseButtonEvent==1)?true:false;},InitPop:function(e){if(this.PopLoaded||arguments.callee.init)return true;if(this.GetPoppedTotal()>=this.maxPops)return true;arguments.callee.init=true;var status=this.CreatePop(e);arguments.callee.init=false;return status;},InitLayer:function(){if(arguments.callee.init)return false;arguments.callee.init=true;setTimeout(function(){MMPop.Private.CreateLayer();},(this.LayerDelay*1000));},CreatePop:function(e){var obj=this.GetSrcElement(e);if(obj.tagName=="IMG"&&((obj.parentNode)&&obj.parentNode.tagName=="A"))obj=obj.parentNode;var popURL="about:blank"
var popID="mmp_"+Math.floor(899999*Math.random()+100000);var pxLeft=0;var pxTop=0;pxLeft=(this.GetWindowLeft()+(this.GetWindowWidth()/2)-(this.popWinWidth/2));pxTop=(this.GetWindowTop()+(this.GetWindowHeight()/2)-(this.popWinHeight/2));if(!this.forceOverlay){this.PopWin=this._Top.window.open(popURL,popID,'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,top='+pxTop+',left='+pxLeft+',width='+this.popWinWidth+',height='+this.popWinHeight);}
if(this.PopWin){this.PopLoaded=true;this.incrementPoppedTotal();if(!this.noPopUnder){this.PopWin.blur();if(navigator.userAgent.toLowerCase().indexOf("applewebkit")>-1){this._Top.window.blur();this._Top.window.focus();}}
this.PopWin.Init=function(e){with(e){this.Params=e.Params;this.Main=function(){if(typeof window.mozPaintCount!="undefined"){var x=this.window.open("about:blank");x.close();}
var popURL=this.Params.popWinURL;if(!this.Params.noPopUnder){try{opener.window.focus();}
catch(err){}}
window.location=popURL;}
this.Main();}};this.PopWin.Params={popWinURL:this.popWinURL,noPopUnder:this.noPopUnder}
this.PopWin.Init(this.PopWin);}else if(MMPop.private.overlayURL!=''){if((obj.tagName=="A"&&this.ShiftButtonDown)||obj.tagName!="A"){this.InitLayer();}}
return true;},CreateLayer:function(){var container=document.createElement('div');var header=document.createElement('div');var body=document.createElement('div');var iframe=document.createElement('iframe');var link=document.createElement('a');var headerHeight=22;var containerLeft=0,containerTop=0;containerLeft=(this.popWinWidth+50)*-1;containerTop=this.GetScrollTop()+Math.round((this.GetWindowHeight()/2)-(this.popWinHeight/2));if(containerTop<0)containerTop=0;container.id="MMPop_LayerPop_Container";header.id="MMPop_LayerPop_Header";body.id="MMPop_LayerPop_Body";iframe.id="MMPop_LayerPop_Iframe";link.id="MMPop_LayerPop_Link";iframe.frameBorder=0;iframe.scrolling="auto";iframe.src="about:blank;"
link.href="#";link.innerHTML="Close Advertisement";link.onclick=function(e){MMPop.Private.RetractLayer(container);return false};container.onmouseover=function(e){MMPop.Private.LayerRetractPause=true;};container.onmouseout=function(e){MMPop.Private.LayerRetractPause=false;};this.SetStyle(container,"position:absolute;background:#f9fafb;z-index:99999;height:"+(this.popWinHeight+headerHeight)+"px;width:"+this.popWinWidth+"px;left:"+containerLeft+"px;top:"+containerTop+"px");this.SetStyle(header,"background:#f0f7f9;border: solid 1px #6b90da;height:"+headerHeight+"px;text-align:right");this.SetStyle(body,"height:"+this.popWinHeight+"px");this.SetStyle(iframe,"height:"+this.popWinHeight+"px;width:"+this.popWinWidth+"px");this.SetStyle(link,"font: normal bold 10pt \"arial\", \"sans-serif\";color: #2200cc;padding-right:5px");header.appendChild(link);body.appendChild(iframe);container.appendChild(header);container.appendChild(body);this.AppendToBody(container,function(e){iframe.src=MMPop.Private.overlayURL;MMPop.Private.ExpandLayer(e);});},ExpandLayer:function(container){var containerLeft=0,containerTop=0;containerLeft=Math.round((this.GetWindowWidth()/2)-(this.popWinWidth/2));containerTop=this.GetScrollTop()+Math.round((this.GetWindowHeight()/2)-(this.popWinHeight/2));if(containerLeft<0)containerLeft=0;if(containerTop<0)containerTop=0;var elementPos=container.offsetLeft;var expandSpeed=this.LayerExpandSpeed*10;var addAmount=elementPos+expandSpeed;var destPos=containerLeft;if(container.offsetTop!=containerTop){container.style.top=containerTop+"px";}
if(addAmount<destPos)
{container.style.left=addAmount+"px";setTimeout(function(){MMPop.Private.ExpandLayer(container);},25);}else{container.style.left=destPos+"px";this.LayerDisableFollow=false;setTimeout(function(){MMPop.Private.CenterLayer(container);},50);if(this.LayerRetractDelay>0)
this.RetractInterval(container,0);}},RetractInterval:function(container,counter){if(counter>this.LayerRetractDelay){this.RetractLayer(container);}else{if(!this.LayerRetractPause)counter++;setTimeout(function(){MMPop.Private.RetractInterval(container,counter);},1000);}},RetractLayer:function(container){this.LayerDisableFollow=true;var elementPos=container.offsetLeft;var retractSpeed=this.LayerRetractSpeed*10;var addAmount=elementPos-retractSpeed;var destPos=(this.popWinWidth+50)*-1;if(addAmount>destPos){container.style.left=addAmount+"px";setTimeout(function(){MMPop.Private.RetractLayer(container);},25);}else{container.style.left=destPos+"px";container.innerHTML="";}},CenterLayer:function(container){if(this.LayerDisableFollow)return;var containerLeft=0,containerTop=0;containerLeft=this.GetScrollLeft()+Math.round((this.GetWindowWidth()/2)-(this.popWinWidth/2));containerTop=this.GetScrollTop()+Math.round((this.GetWindowHeight()/2)-(this.popWinHeight/2));if(containerLeft<0)containerLeft=0;if(containerTop<0)containerTop=0;if(container.offsetTop!=containerTop)container.style.top=containerTop+"px";if(container.offsetLeft!=containerLeft)container.style.left=containerLeft+"px";setTimeout(function(){MMPop.Private.CenterLayer(container);},50);},GetWindowHeight:function(){var myHeight=0;if(typeof(this._Top.window.innerHeight)=='number'){myHeight=this._Top.window.innerHeight;}else if(this._Top.document.documentElement&&this._Top.document.documentElement.clientHeight){myHeight=this._Top.document.documentElement.clientHeight;}else if(this._Top.document.body&&this._Top.document.body.clientHeight){myHeight=this._Top.document.body.clientHeight;}
return myHeight;},GetWindowWidth:function(){var myWidth=0;if(typeof(this._Top.window.innerWidth)=='number'){myWidth=this._Top.window.innerWidth;}else if(this._Top.document.documentElement&&this._Top.document.documentElement.clientWidth){myWidth=this._Top.document.documentElement.clientWidth;}else if(this._Top.document.body&&this._Top.document.body.clientWidth){myWidth=this._Top.document.body.clientWidth;}
return myWidth;},GetWindowTop:function(){return(this._Top.window.screenTop!=undefined)?this._Top.window.screenTop:this._Top.window.screenY;},GetWindowLeft:function(){return(this._Top.window.screenLeft!=undefined)?this._Top.window.screenLeft:this._Top.window.screenX;},GetScrollTop:function(){var scrollY=0;if(this._Top.document.documentElement&&this._Top.document.documentElement.scrollTop)
scrollY=this._Top.document.documentElement.scrollTop;else if(this._Top.document.body&&this._Top.document.body.scrollTop)
scrollY=this._Top.document.body.scrollTop;return scrollY;},GetScrollLeft:function(){var scrollX=0;if(this._Top.document.documentElement&&this._Top.document.documentElement.scrollLeft)
scrollX=this._Top.document.documentElement.scrollLeft;else if(this._Top.document.body&&this._Top.document.body.scrollLeft)
scrollX=this._Top.document.body.scrollLeft;return scrollX;},GetSrcElement:function(e){if(!e)e=this._Top.window.event;var srcElement=e.srcElement?e.srcElement:e.target;if(srcElement.nodeType==3)srcElement=srcElement.parentNode;return srcElement;},SetStyle:function(element,text){element.setAttribute("style",text)
element.style.cssText=text},CreateObjParam:function(el,pName,pValue){var p=document.createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p);},AppendToBody:function(e,callBack){var obj=MMPop.Private._Top.document.getElementsByTagName("body")[0];if(obj){obj.insertBefore(e,obj.firstChild);if(typeof callBack=="function")callBack(e);}else{setTimeout(function(){MMPop.Private.AppendToBody(e,callBack);},25);}},AddEvent:function(target,eventName,handlerName){if(target.addEventListener){target.addEventListener(eventName,eval(handlerName),false);}else if(target.attachEvent){target.attachEvent("on"+eventName,eval(handlerName));}else{var originalHandler=target["on"+eventName];if(originalHandler){target["on"+eventName]=eval(handlerName);}else{target["on"+eventName]=eval(handlerName);}}},CreateCookie:function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60));var expires="; expires="+date.toGMTString();}else{var expires="";}
this._Top.document.cookie=name+"="+value+expires+"; path=/";},ReadCookie:function(name){var ca=this._Top.document.cookie.split(';');var nameEQ=name+"=";for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;},GetPoppedTotal:function(){var popTotal=this.ReadCookie(this.CookieName);popTotal=(popTotal!=null)?parseInt(popTotal):0;return popTotal;},incrementPoppedTotal:function(){var popTotal=this.ReadCookie(this.CookieName);if(popTotal!=null){this.CreateCookie(this.CookieName,parseInt(popTotal)+1,1);}else{this.CreateCookie(this.CookieName,1,1);}},GetGuid:function(){var Rnd=function(){return(((1+Math.random())*0x10000)|0).toString(16).substring(1);};return(Rnd()+Rnd()+"-"+Rnd()+"-"+Rnd()+"-"+Rnd()+"-"+Rnd()+Rnd()+Rnd());},HexToStr:function(h){for(var i=0,x="";i<h.length;i+=2){x+=String.fromCharCode(parseInt(h.substr(i,2),16));}
return x;}}};MMPop.Private.PreInit();})();
