var i=0,ab=0,f=0,e=0,r=0,q=0,b=0,s=0,d="",y=0,p=0,o=0,timerRunning,ML=0,ah=0,counter=0;
function SetSite(am)
{
ah=am
}
function SetCookie(cookieName,cookieValue,ae)
{
var bc=new Date()
var expire=new Date()
if(ae==null||ae==0)ae=1;
expire.setTime(bc.getTime()+3600000*24*ae);
document.cookie=cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString();
}
function showtime()
{
if(document.getElementById("TheClock")){
var now=new Date()
var hours=now.getHours();
var minutes=now.getMinutes();
var seconds=now.getSeconds();
var bf=""+((hours>12)?hours-12:hours);
bf+=((minutes<10)?":0":":")+minutes;
bf+=((seconds<10)?":0":":")+seconds;
bf+=(hours>=12)?" P.M.":" A.M.";
document.getElementById("TheClock").innerText=bf;
timerID=setTimeout("showtime()",1000);
timerRunning=true;
}
}
function al(){
if(typeof(window.pageYOffset)=='number'){
r=window.pageXOffset;
q=window.pageYOffset;
ab=1;
}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
r=document.body.scrollLeft;
q=document.body.scrollTop;
ab=2;
}else if(document.documentElement&&
(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
r=document.documentElement.scrollLeft;
q=document.documentElement.scrollTop;
ab=3;
}
}
function MagicOffSet(au,at,intRN){
counter=intRN;
if(au==0){
return;
}
p=au;
if(at==0){
return;
}
o=at;
}
function aj(){
if(typeof(window.innerWidth)=='number'){
f=window.innerWidth;
e=window.innerHeight;
}else if(document.documentElement&&
(document.documentElement.clientWidth||document.documentElement.clientHeight)){
f=document.documentElement.clientWidth;
e=document.documentElement.clientHeight;
}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
f=document.body.clientWidth;
e=document.body.clientHeight;
}
SetCookie("f",f,30);
SetCookie("e",e,30);
}
function InfoMagic(obj,bi,z,w)
{
var bc=0,bb=0;
var k=0,j=0;
var n=0,m=0;
var ar=0;
if(i==1)
{
return;
}
if(f==0)
{
aj();
}
al();
k=(f-z)/2+r;
k=k+'';
k=parseInt(k);
j=(e-w)/2+q;
j=j+'';
j=parseInt(j);
ar=ao(obj);
n=k+z;
m=j+w;
if(k<p){
bc=p-k;
k=p;
}
if(j<o){
bb=o-j;
j=o;
}
n=n+bc;
m=m+bb;
bc=0;
bb=0;
if(z<750){
if(n>(f+r)){
bc=m-f-r;
}
}
if(w<590){
if(m>(e+q)){
bb=n-e-q;
}
}
MoveBase(bi,k,j);
SetiFrame(z,w);
y=k;
}
function MoveBase(ap,bh,bg)
{
var x=new aw(ap);
x.style.top=bg+'px';
x.style.left=bh+'px';
}
function ao(obj)
{
var ah=0;
if(obj.offsetParent)
{
while(obj.offsetParent)
{
ah+=obj.offsetTop;
obj=obj.offsetParent;
}
}
else if(obj.y)
ah+=obj.y;
return ah;
}
function aw(Stuff)
{
if(document.getElementById)
{
this.obj=document.getElementById(Stuff);
this.style=document.getElementById(Stuff).style;
}
else if(document.all)
{
this.obj=document.all[Stuff];
this.style=document.all[Stuff].style;
}
else if(document.layers)
{
if(document.layers[Stuff])
{
this.obj=document.layers[Stuff];
this.style=document.layers[Stuff];
}
}
}
function SetiFrame(bm,bl)
{
var u=this.document.getElementById('TravelBase');
u.height=bl+'px';
u.width=bm+'px';
}
function MagicPopUp(l,as)
{
var SID=String(l).search('tid=');
var EID=String(l).search('&');
var strRN="";
if(SID>0){
SID=SID+4;
if(EID==-1){
EID=String(l).length;
}
strRN=String(l).substring(EID,SID);
counter=parseInt(strRN);
}
i=1;
if(as==0){
a('../images/BeginTab.gif');
}
else{
s=as;
a('../images/DetailTab.gif');
}
g();
var h=document.getElementById('TravelBase');
h.src=l;
}
function g()
{
var TheFrame=document.getElementById('iBase');
TheFrame.style.display="";
var TabPIX=document.getElementById('Tab2');
TabPIX.style.display="";
}
function PopDownMagic()
{
i=0;
var TheFrame=document.getElementById('iBase');
TheFrame.style.display="none";
var TabPIX=document.getElementById('Tab2');
TabPIX.style.display="none";
var h=document.getElementById('TravelBase');
h.src="blank.htm";
}
function SetLinkImage(ak){
var ag=document.getElementById('GoSite');
ag.src=ak;
}
function a(an){
var ag=document.getElementById('Tab2');
ag.src=an;
}
function SiteInfo()
{
var c=document.getElementById("message");
if(c.style.display=="none"){
c.style.display="";
}
if(ML>190){
c.style.height=155;
}
else if(ML>180){
c.style.height=150;
}
else if(ML>170){
c.style.height=145;
}
else if(ML>160){
c.style.height=140;
}
else if(ML>145){
c.style.height=135;
}
else if(ML>125){
c.style.height=120;
}
else if(ML>100){
c.style.height=100;
}
}
function WhatBut(bk){
if(bk==ah){
SetLinkImage('../images/URhere.gif');
}
else{
SetLinkImage('../images/GoThere.gif');
}
}
function WriteMess(af)
{
var c=document.getElementById("Purpose");
ML=String(af).length
c.innerHTML=af;
}
function ad(){
var ax=document.getElementById('Tab2');
var aa=ax.src;
b=0;
if(aa=='http://www.shopbymetro.com/images/DetailTab.gif'){
b=1;
}
if(aa=='http://www.shopbymetro.com/images/BuyTab.gif'){
b=2;
}
if(aa=='http://www.shopbymetro.com/images/CheckOutTab.gif'){
b=3;
}
if(aa=='http://www.shopbymetro.com/images/SearchTab.gif'){
b=4;
}
if(aa=='http://www.metroyellowpage.com/images/SearchTab.gif'){
b=5;
}
}
function FindWhat(bq)
{
i=1;
MoveBase('iBase',180,y);
SetiFrame(300,75);
d="\Search.asp?tid="+String(counter)+"&Store="+bq;
a('../images/SearchTab.gif');
g();
var h=document.getElementById('TravelBase');
h.src=d;
}
function FindAd()
{
i=1;
MoveBase('iBase',180,y);
SetiFrame(350,300);
d="\Search.asp?tid="+String(counter);
a('../images/SearchTab.gif');
g();
var h=document.getElementById('TravelBase');
h.src=d;
}
function CheckOut(){
PopDownMagic();
document.location.href="https://ssl122.securefastssl.com/shopbymetro.com/SecureShop/Shipping.asp?tid="+String(counter);
}
function MetroMall(){
PopDownMagic();
document.location.href="http://www.shopbymetro.com/Default.asp?tid="+String(counter);
}
function MetroFYI(){
PopDownMagic();
document.location.href="http://www.metrofyi.com/Default.asp?tid="+String(counter);
}
function SearchFor(){
var bj=document.getElementById('TravelBase');
if(bj.contentDocument){
var IFrameDoc=bj.contentDocument;
}else if(bj.contentWindow){
var IFrameDoc=bj.contentWindow.document;
}else if(bj.document){
var IFrameDoc=bj.document;
}
var aq=IFrameDoc.searchitem.Search.value;
var Store=IFrameDoc.searchitem.Store.value;
PopDownMagic();
document.location.href="\includes/StoreSearch.asp?tid="+String(counter)+"&StoreID="+Store+"&Stuff="+aq;
}
function MagicCart()
{
i=1;
MoveBase('iBase',180,y);
SetiFrame(580,300);
d="https://ssl122.securefastssl.com/shopbymetro.com/SecureShop/Basket.asp?tid="+String(counter);
a('../images/CheckOutTab.gif');
g();
var h=document.getElementById('TravelBase');
h.src=d;
}
function SearchAd(){
var bj=document.getElementById('TravelBase');
if(bj.contentDocument){
var IFrameDoc=bj.contentDocument;
}else if(bj.contentWindow){
var IFrameDoc=bj.contentWindow.document;
}else if(bj.document){
var IFrameDoc=bj.document;
}
var aq=IFrameDoc.NameSearch.Cat.value;
var ai=IFrameDoc.NameSearch.name.value;
var Addrs=IFrameDoc.NameSearch.addrs.value;
PopDownMagic();
document.location.href="\includes/Searching.asp?tid="+String(counter)+"&Cat="+aq+"&Name="+ai+"&Addrs="+Addrs
}
function BuyIt()
{
ad();
if(b==5){
SearchAd();
}
else if(b==4){
SearchFor();
}
else if(b==3){
CheckOut();
}
else if(b==2){
MoveBase('iBase',180,y);
SetiFrame(580,300);
a('../images/CheckOutTab.gif');
d="https://ssl122.securefastssl.com/shopbymetro.com/SecureShop/AddItem.asp?tid="+String(counter)+"&ProductID="+s;
var h=document.getElementById('TravelBase');
h.src=d;
}
else if(b==1){
if(s<1){
MetroMall();
}
SetiFrame(450,400);
a('../images/BuyTab.gif');
d="https://ssl122.securefastssl.com/shopbymetro.com/SecureShop/details.asp?tid="+String(counter)+"&ProductID="+s;
var h=document.getElementById('TravelBase');
h.src=d;
}
}
