escape double quotes javascript
<p>I'm trying to run a certain image format when viewed on iphone and some flash video when otherwise</p>

<pre><code>var uagent = navigator.userAgent.toLowerCase();

 if (uagent.search("iphone") &gt; -1){

  document.write("&lt;img src=http://www.demiads.com/images/bc-1300119669-722.gif /&gt;");    }
else{   

document.write("&lt;object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0 width=728 height=90 id=lang align=middle style=margin-left:3px;&gt;   
 &lt;param name=allowScriptAccess value=sameDomain /&gt;      
 &lt;param name=allowFullScreen value=false /&gt;         
 &lt;param name=movie value=http://koha.net//repository/reklamat/17_05_12_131575_koha.net_hej_reveal_675x88px.swf /&gt; 
 &lt;param name=quality value=high /&gt; 
 &lt;param name=bgcolor value=#ffffff /&gt; 
 &lt;param name=wmode value=transparent /&gt;     
&lt;embed src=http://koha.net//repository/reklamat/17_05_12_131575_koha.net_hej_reveal_675x88px.swf 
quality=high WMODE=transparent bgcolor=#ffffff width=728 height=90 
name=ifm_al align=middle allowScriptAccess=sameDomain 
allowFullScreen=false type=application/x-shockwave-flash 
pluginspage=http://www.macromedia.com/go/getflashplayer /&gt; 
&lt;/object&gt;"); 

 }
</code></pre>

<p>It works fine when tested, but the ad system doesn't show it in the publishers website. I checked the source code of a website and I noticed that a \ is added whenever either " or ' found, thus making it non-functional! I have tried to minimize the use of " or ' , but this is a far as I could go. Is there any way to get around this?  thank you in advance.</p>

<p>Result </p>

<pre><code> if (uagent.search(\"iphone\") &gt; -1){

 document.write(\"&lt;img src=http://www.demiads.com/images/bc-1300119669-722.gif /&gt;\");    }
 else{   

   document.write(\"&lt;object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 
   codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0      width=728 height=90 id=lang align=middle style=margin-left:3px;&gt;   
   &lt;param name=allowScriptAccess value=sameDomain /&gt;      
   &lt;param name=allowFullScreen value=false /&gt;         
   &lt;param name=movie value=http://koha.net//repository/reklamat/17_05_12_131575_koha.net_hej_reveal_675x88px.swf /&gt; 
   &lt;param name=quality value=high /&gt; 
   &lt;param name=bgcolor value=#ffffff /&gt; 
   &lt;param name=wmode value=transparent /&gt;     
   &lt;embed src=http://koha.net//repository/reklamat/17_05_12_131575_koha.net_hej_reveal_675x88px.swf 
   quality=high WMODE=transparent bgcolor=#ffffff width=728 height=90 
   name=ifm_al align=middle allowScriptAccess=sameDomain 
   allowFullScreen=false type=application/x-shockwave-flash 
   pluginspage=http://www.macromedia.com/go/getflashplayer /&gt; 
   &lt;/object&gt;\"); 

     }
</code></pre>
