var scripts = document.getElementsByTagName('script');
var myScript = scripts[ scripts.length - 1 ];

var queryString = myScript.src.replace(/^[^\?]+\??/,'');

var params = parseQuery( queryString );

function parseQuery ( query ) {
   var Params = new Object ();
   if ( ! query ) return Params; // return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) continue;
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}
function platsponsors(fid,fpid,tscript,ftype)
   {
   //path|image|name|state|city|contact email|contact phone
//   images.push('Brown Safe|www.brownsafe.com|blank.jpg|San Marcos, CA|sales@brownsafe.com|(760) 233-2293|Brown Safe Manufacturing is the preeminent builder of innovative, rugged, and luxurious safes and vaults.');
   images.push('Cavallino Jewelers|www.cavallinojewelers.com|blank.jpg|Vail, CO|David@CavallinoJewelers.com|(970)476-9282|');
   images.push('Gems By J.Wade|www.GemsByJWade.com|blank.jpg||jason@gemsbyjwade.com|(202) 409-6788|Simply stated, we create the highest quality custom jewelry at the most competitive prices. We have eliminated the cost of the traditional storefront and concentrated our efforts into manufacturing exceptional pieces combined with unparalleled service and satisfaction. With an emphasis on the classics with a contemporary twist, we create fine jewelry using your design ideas or ours. Our award-winning design team can make any piece of jewelry imaginable.');
   images.push('Willow Bend Tactical|www.wbtactical.com|blank.jpg||mitch@wbtactical.com|(214) 714-8410|');
   }

function dspl4pads(fid,fpid,tscript,ftype)
   {
   //do not display the following if fids are equal to below
   //www.luxury4play.com/forumdisplay.php?f=69

   if (fid == 83 || fpid == 83)
      {
      //detail section only
	  //path|image|name|state|city|contact email|contact phone

//      images.push('AC Detailing|www.acdetailing.net|AC-AD2.jpg');
//      images.push('Auto Concierge|www.justwaxed.net|AUTOC-AD.jpg|Fremont, CA|rambert3@comcast.net|');
//      images.push('Presidential Details|presidentialdetails.com|Presidential-AD.jpg|Manheim, PA|barry@presidentialdetails.com|');
//      images.push('Sullys Detailing|www.sullysdetailing.com|SULLYS-AD2.jpg');
      images.push('Jason\'s Auto Spa|www.jasonsautospa.com|JASONS-AD.jpg|Lake Zurich, IL|Jason@jasonsautospa.com|(847) 343-4180');
      images.push('Gloss-It|www.gloss-it.net|GLOSS-IT-AD.jpg|Las Vegas, NV|info@gloss-it.net|(877) Gloss-Me');
      images.push('NorthWest Auto Salon|www.northwestautosalon.com|NWAS-AD.jpg|Seattle, WA|detail@nwautosalon.com|');
      images.push('Auto Lavish|www.autoLavish.com|Lavish-AD.jpg|Metro-Detroit, MI|jacobbunyan@gmail.com|');
      images.push('Envious Auto Detailing|www.enviousautodetailing.com|Envious-Detailing-AD.jpg|Orange County, CA|EnviousDetailing@gmail.com');
      images.push('Detailers Domain|www.detailersdomain.com|Domain-Detailing-AD.jpg|Norwood, NJ|phil@detailersdomain.com');
      images.push('Street Dreams Detail|www.streetdreamsdetail.com|Street-Dreams-AD2.jpg');
      images.push('MPM Detailing|#|MPM-AD2.jpg|Streamwood, IL|Mike@mpmdetailing.com|');
      images.push('Detailing Dynamics|www.detailingdynamics.com|Detailing-Dynamics.jpg|');
      images.push('Premier Protective Films International|www.premiermobilegroup.com|PREMIER-AD.jpg|Fremont, CA|sales@premiermobilegroup.com|(510) 406-1500');
      images.push('Unique Car Care|www.unique-car-care.com|UNIQUECAR-AD.jpg');
      images.push('Mobile Car Touch Up|www.lmcartouchup.com|Mobile-Car-AD.jpg');
      images.push('Reflections Detailing|www.reflectionsdetailing.org|D-Reflections-AD.jpg');
      images.push('Tailored Automotive Detailing|www.djbibiloni.com|Bibiloni-AD2.jpg');
      images.push('Pro Mobile Auto Detailing|www.promobileautodetail.com|Pro-Mobile-AD.jpg');
      images.push('Oaks Automotive Detailing|www.oakesdetail.com|Oakes-AD.jpg|West Chester, PA|oakesdetail@gmail.com|');
      //detailers above
      }
   else
      {
      //everyone else
//      images.push('Spring Mountain Motorsport|www.springmountainmotorsports.com|SpringMountain-AD.jpg|Pahrump, NV|Sales@springmountainmotorsports.com|(888) 856-5870|');
//      images.push('Rever Clothing|www.reverclothing.com|REVER-AD.jpg|Las Vegas, NV|service@reverclothing.com|(702) 253-6081|');

      images.push('Gloss-It|www.gloss-it.net|GLOSS-IT-AD.jpg|Las Vegas, NV|info@gloss-it.net|(877) Gloss-Me|');
      images.push('HRE Performance Wheels|www.hrewheels.com|HRE-AD.jpg|Vista, California|info@hrewheels.com|(760) 598-1960|');
      images.push('The Strap Smith|www.thestrapsmith.com|STRAP-AD.jpg|CA|ristirob@mac.com||');
      images.push('Wheels Boutique|www.wheelsboutique.com|WB-AD.jpg|Miami, FL|info@wheelsboutique.com|(866)-51wheel|');
      images.push('Vossen Wheels|www.vossenwheels.com|VOSSEN-AD.jpg|Miami, FL|info@vossenwheels.com|(888) 463-7778|');
      images.push('Mobile Addictions|www.mobile-addictions.com|MOBILEA-AD.jpg|Staten Island, NY|info@mobile-addictions.com|(718) 887-2910|');
      images.push('Premier Protective Films International|www.premiermobilegroup.com|PREMIER-AD.jpg|Fremont, CA|sales@premiermobilegroup.com|(510) 406-1500|');
      images.push('503 Motoring|www.503motoring.com|503MOTORING-AD.jpg|Beaverton, Oregon|info@503motoring.com|(503) 469-9821|');
      images.push('Lamborghini Beverly Hills|www.ogaracoach.com|LAMBO-BH-AD.jpg|Beverly Hills, CA|sales@ogaracoach.com|(888) 291-5533|');
      images.push('Revved Automotive Concepts|www.revvedautoconcepts.com|REVVED-AD.jpg||Customerservice@revvedautoconcepts.com ||');
      images.push('Streetwerke|www.streetwerke.com|STREETWERKE-AD.jpg|Palo Alto, CA|info@streetwerke.com|(650) 739-0820|');
      images.push('FamousAutosports|www.famousautosports.com|FAMOUS-AUTO-AD.jpg|Canoga Park, CA|FamousAutosports@gmail.com|818.341.2786|Experience, focus and commitment to excellence have made Famous Autosports the leading independent Lamborghini & Exotic Automotive shop. Our mission is to provide our customers with professional, efficient services, the highest quality in products, and incomparable workmanship, which result in ultimate customer satisfaction. We take great pride in being your one stop shop for any and all of your audio/video, fabrication, performance & service needs. We are confident that your experience with us will be a very rewarding one, as we believe that our customers deserve only the best, and we are continually honored to earn your business and loyalty.');
      images.push('Davis Exotics|www.davisexotics.com|DAVISEXOTICS-AD.jpg||||');
      images.push('D2 Forged|www.d2forged.com|D2FORGED-AD.jpg|Plainview, NY|SALES@D2AUTOSPORT.com|877-361-0296|');
      images.push('Forgiato Designs|www.forgiato.com|FORGIATO-AD.jpg|Sun Valley, CA|Gary@Forgiato.com|818-771-9779|');
      images.push('Broadway Performance|www.broadway-performance.com|BROADWAY-AD.jpg|Passaic, NJ|john@broadway-performance.com|973-779-8405|');
      images.push('Finest Watches|www.finestwatches.com|FW-AD.jpg|Encino, CA|ken@finestwatches.com|888.313.8463|');
      images.push('Al & Eds Autosound|www.ae54.com|AE-AD.jpg|West Hollywood, CA|elie@al-eds.com|310.920.5454|');
      images.push('Giovanna|www.wtwcorp.com/giovanna.html|Giovanna-AD1.jpg||info@wtwcorp.com|(800) 307-8708|');
      images.push('Gianelle|wtwcorp.com/gianelle.html|Giovanna-AD2.jpg||info@wtwcorp.com|(800) 307-8708|');
      images.push('GFG|wtwcorp.com/gfg.html|Giovanna-AD3.jpg||info@wtwcorp.com|(800) 307-8708|');
      images.push('Koko Kuture|www.wtwcorp.com/kokokuture.html|Giovanna-AD4.jpg||info@wtwcorp.com|(800) 307-8708|');
      images.push('Tecnocraft|www.tecnocraft.com|Tecnocarft-AD.jpg|Pico Rivera, CA|webmaster@tecnocraft.com|562.801.6213|');
      images.push('Specialty Car Craft|www.specialtycarcraft.com|SCC-AD.jpg|Los Angeles, CA||(310) 838-5551|');
      images.push('Sonbol Watches|www.sonbol-watches.com|Sonbol-AD2.jpg|Northfield, IL||888-440-4402|');
      images.push('Carbon Fiber Gear|www.carbonfibergear.com/direct|CF-AD2.jpg|||(443)270-1603|');
      images.push('Heffner Performance|www.heffnersperformance.com|Heffner-AD2.jpg|Sarasota, FL|sales@heffnersperformance.com|941-359-0900|');
      images.push('Roark Industrial Solutions|roarkindustrialsolutions.indoff.com|ROARK-AD2.jpg|Newport News, VA|james.roark@indoff.com|804-684-8655|I specialize in helping my clients find solutions for their industrial, material handling, and storage needs. You get personal care from me everytime. I will work with you, one on one, to provide product sourcing, design recommendations, preliminary budget pricing, leasing services and installation if needed. Solutions from brand names such as RaceDeck, Lista, Bendpack, Folding Guard, Rubbermaid Commercial, Stronghold, Quantum Storage, Pflow, Goff\'s Curtain Walls and many, many more…..');
      images.push('Underground Racing|www.undergroundracing.com|UR-AD.jpg|Charlotte, NC|info@undergroundracing.com|704-361-3443|');
      images.push('Active Autowerke|www.activeautowerke.com|Active-AD.jpg|Miami, FL|info@activeautowerke.com|305 233 9300|');
      images.push('Fabspeed Motorsports|www.fabspeed.com|FABSPEED-AD.jpg|Ambler, PA|info@fabspeed.com |(215) 646-4945|');
      images.push('JP Logistics|www.jplogistics.net|JP-AD.jpg|Suny Valley, CA|info@jplogistics.net|(888) 725-7555|Simply said, we are the auto transportation company of choice, we offer door to door service across the US and Worldwide, we can move your vehicle via air freight or ocean containers, We offer expedite services in the states ranging from a 24 hour delivery via air, or 96 hour service coast to coast via ground services. Feel free to contact us if you have any questions. ');
      images.push('NTT Transport|www.nttcorp.net|NTT-AD.jpg|Downey, CA|info@nttcorp.net|(800) 595-4869|Specializing in highline automotive transport. We have a carrier that will suit your needs. This will be the best automotive transport decision you\'ll ever make!');
      images.push('GUNPAL|www.gunpal.net|GUNPAL.jpg||support@gunpal.com||GUNPAL is the rights-friendly to pay anyone with an email address, and accept credit cards online. Accounts at GUNPAL are FDIC insured and it\'s free to sign up and send money.');
      images.push('Platinum Motorsport|www.platinummotorsport.com|Platinum-AD.jpg|Los Angeles, CA|info@platinummotorsport.com|(323) 935-9222|');
      images.push('DC Motors|www.shopdcmotors.com|DC-Side-AD.jpg|Anaheim Hills, CA||714 695-0102|');
      images.push('DC Performance|www.dcperformance.com|DCPer-AD.jpg|Los Angeles, CA||310.841.6996|');
      images.push('Vorsteiner|www.vorsteiner.com|VORSTEINER-AD.jpg||sales@vorsteiner.com|(800) 601-7615|');
      images.push('Martino Auto Concepts|www.martinoautoconcepts.com|Martino-AD.jpg|Glen Cove, New York|joe@martinoautoconcepts.com|(516) 676-7985|');
      images.push('CXC Simulations|www.cxcsimulations.com|CXC-AD.jpg|Marina Del Rey, CA||(310) 306-7878 |');
      images.push('Brown Safe|www.brownsafe.com|BROWN-SAFE-AD.jpg|San Marcos, CA|sales@brownsafe.com|(760) 233-2293|Brown Safe Manufacturing is the preeminent builder of innovative, rugged, and luxurious safes and vaults.');
      images.push('BFXautosport|www.bfxauto.com|BFXAUTO-AD.jpg|Costa Mesa, CA|Sales@BFXenon.com|714-624-8790|BFxautosports is the best choice for all your online motorsport needs. Give us the opportunity to earn your trust in customizing your car, truck, SUV, exotic, and race car. We are Quality, Service, and Perfection for your auto!.');
      images.push('ADV.1|www.adv1wheels.com|ADV1.jpg|Coral Gables, FL|info@adv1wheels.com|305-238-0058|Our goal is to build a company that runs like a well-oiled machine, growing only as fast as we allow it to. We’re dedicated to maintaining a 1 on 1 relationship with our select clientele and providing them with a wheel that meets their expectations. ADV.1 is a design company first and foremost, and our focus is in automotive design blended with performance.');
      images.push('Exotics Boutique|www.exoticsboutique.com|Exotics-AD.jpg||||');
      images.push('Black and White Car Rental|www.bwrac.com|BWCarRental-AD.jpg|Beverly Hills, CA|sam@brac.com|(310) 612-5557|');
      images.push('Vivid Racing|www.vividracing.com|VIVID-AD.jpg||||');
      images.push('Symbolic Motor Car Company|www.symbolicmotors.com|Symbolic-AD.jpg|San Diego, CA||(858) 454-1800|Symbolic Motor Car Company is San Diego County’s only factory authorized sales dealership and service center for Bentley, Bugatti, Lamborghini, Lotus, and Rolls Royce automobiles. A La Jolla institution since 1985, Symbolic Motor Car Company is a worldwide sales leader in legendary classic, historic, and competition race cars.');
      images.push('Shark Werks|www.sharkwerks.com|Sharkwerks.jpg||||');
      images.push('OE tunning|www.oetuning.com|OE-Side-AD.jpg||||');
      images.push('BBI Autosport|www.bbiautosport.com|BBI-AD.jpg||||');

//      images.push('Arcane 13|www.arcane13inc.com|ARCANE-AD.jpg|Trinity, FL|info@arcane13inc.com|(727) 859-6347|');

      }
 
   if ((fid == 53 || fpid == 53 || tscript == 'index') || ftype == 'dir')
      {
      // images.push('Portola Valley Garage|www.pvgarage.com/id11.html|PVGWEST-AD.jpg|Portola Valley, Ca|tramies@pvgarage.com;tharris@pvgarage.com|(650) 851-7442|');
      }
   if ((fid == 3 || fpid == 3) || ftype == 'dir')
      {
      images.push('Speed and Motion|www.speedandmotion.com|SPEED-AD.jpg|CA|sales@speedandmotion.com||');
      }

   if ((fid == 11 || fpid == 11) || ftype == 'dir')
      {
//      images.push('CT Designs|www.CTDesigns.us|CT-DESIGNS-AD.jpg|Corona,CA|CTdesigns@me.com||CTDesigns is your premier one stop shop for unique and custom made luxury watch straps and accessories.');
      }

   if ((fid == 53 || fpid == 53) || ftype == 'dir')
      {
      images.push('L & M Mobile Car Touch Up|www.lmcartouchup.com|Mobile-Car-AD.jpg|CA|lmcartouchup@yahoo.com|(408) 230-5440|');
      }
   }

function l4padsmain()
   {
   document.write("<style>.adimgs{margin-bottom:1px;}</style>");
   document.write('<a href="/sendmessage.php"><img src="http://www.luxury4play.com/images/l4p/ads/L4P-AD.jpg" border="0"></a>');
   document.write('<A HREF=http://www.lum-tec.com></A> <!-- text used in the movie-->');
   document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
   document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
   document.write('WIDTH="150" HEIGHT="150" id="lumtec5" ALIGN="center">');
   document.write('<PARAM NAME=movie VALUE="/images/l4p/ads/lumtec5.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="/images/l4p/ads/lumtec5.swf" quality=high bgcolor=#000000  WIDTH="150" HEIGHT="150" NAME="lumtec5" ALIGN=""');
   document.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
   document.write('</OBJECT>');

   function randOrd()
      {
      return (Math.round(Math.random())-0.5);
      }
   images.sort( randOrd );
   for (var i = 0; i < loops; i++)
      {
      currentad = images[i].split("|");
      document.write('<a target="_blank" href="http://'+ currentad[1] +'" onClick="javascript: pageTracker._trackPageview(\'http://'+ currentad[1] +'\');"><img border="0" src="http://www.luxury4play.com/images/l4p/ads/'+ currentad[2] +'" class="adimgs"></a>');
      }
   }
   
function l4padsinfo()
   {
   //no rightside ads
   platsponsors(params['fid'],params['fpid'],params['tindex'],params['ftype']);
   //reinitialize loops, since we added some above
   loops = images.length;
   document.write('<style>');
   document.write('.table_detail');
   document.write('{');
   document.write('color:#000000;');
   document.write('font-family:arial;');
   document.write('font-size:12px;');
   document.write('line-height:17px;');
   document.write('padding:5px;');
   document.write('background:#ffffff;');
   document.write('border-bottom:1px solid #D8DAE7;');
   document.write('}');
   document.write('.table_detail td');
   document.write('{');
   document.write('border-right:1px solid #D8DAE7;');
   document.write('border-top:1px solid #D8DAE7;');
   document.write('padding-top:20px;');
   document.write('padding-left:8px;');
   document.write('padding-bottom:20px;');
   document.write('}');
   document.write('.table_detail th');
   document.write('{');
   document.write('padding-left:8px;');
   document.write('}');
   document.write('.table_biotr td a, .table_biotr td a:visited');
   document.write('{');
   document.write('color:#FF6600;');
   document.write('font-family:arial;');
   document.write('font-size:11px;');
   document.write('font-weight:bold;');
   document.write('text-decoration: none;');
   document.write('}');
   document.write('.table_nb');
   document.write('{');
   document.write('border-left:1px solid #D8DAE7;');
   document.write('border-right:0px solid #000000 !important;');
   document.write('}');
   document.write('</style>');
   document.write('<table border="0" cellpadding="0" cellspacing="0" class="table_bio1" width="100%" bgcolor="#090D10" height="1">');
   document.write('   <tr>');
   document.write('      <td class="alt1Active"  align="left">');
   document.write('<table border="0" cellpadding="0" cellspacing="0" class="table_detail" width="100%" bgcolor="#ffffff" height="1">');
   document.write('   <th><img src="http://www.luxury4play.com/images/statusicon/forum_new.gif"></th>');
   document.write('   <th><strong>Sponsor</th>');
   document.write('   <th><strong>City, State</th>');
   document.write('   <th><strong>Website/URL/Contact</th>');
   document.write('   <th><strong>Expertise</th>');
   images.sort();
   for (var i = 0; i < loops; i++)
      {
      currentad = images[i].split("|");
	  if (i % 2 == 0)
	     {
         document.write('<tr bgcolor=#f1f1f1>');
		 }
	  else
	     {
         document.write('<tr>');
		 }	  
      document.write('      <td width="10" class="table_nb"><img src="http://www.luxury4play.com/images/statusicon/forum_new.gif"></td>');
      document.write('      <td><strong>'+ currentad[0] +'</strong>&nbsp;</td>');
      document.write('      <td>'+ currentad[3] +'&nbsp;</td>');
      document.write('      <td><a target="_blank" href="http://'+ currentad[1] +'">'+ currentad[1] +'</a><br><a href="mailto:'+ currentad[4] +'">'+ currentad[4] +'</a>&nbsp;</td>');
      document.write('      <td width=400>'+ currentad[6] +'&nbsp;</td>');
      document.write('</tr>');
      }	  
   document.write('</table>');
   document.write('</td>');
   document.write('</tr>');
   document.write('</table>');
   }   

//global vars
images = new Array();
//populate array
dspl4pads(params['fid'],params['fpid'],params['tindex'],params['ftype']);
loops = images.length;
   
   if (params['ftype'] == 'l')
      {
      l4padsmain();	
      }
   else
      {
      l4padsinfo();
      }

	  