function init() {
  document.getElementsByTagName('input')[0].focus();
}

window.onload = init;

var tick = 30;
var intervalId;

function doTimer(mp3, question, o1, o2, o3, o4, answer) {
  tick = 30;
  var strHtml = "<div style='width:250px'><div style='float: left;'><object type='application/x-shockwave-flash' data='http://www.raagabox.com/xspf_player.swf?skin_url=http://www.raagabox.com/SquareOne&autoplay=true&autoload=true&track_url=http://www.raagabox.com/media/music/000/002/" + mp3 + ".mp3' width=70 height=80><param name='wmode' value='transparent'><param name='movie' value='http://www.raagabox.com/xspf_player.swf?skin_url=SquareOne&autoplay=true&autoload=true&track_url=http://www.raagabox.com/media/music/000/002/" + mp3 + ".mp3' width=70 height=80 /><img src='noflash.gif'/></object></div><div style='margin-right:5px;'><div>" + question + "?</div><div><a href=# onclick='score(1," + answer + ")'>" + o1 + "</a></div><div><a href=# onclick='score(2, " + answer + ")'>" + o2 + "</a></div><div><a href=# onclick='score(3, " + answer + ")'>" + o3 + "</a></div><div><a href=# onclick='score(4, " + answer + ")'>" + o4 + "</a></div></div></div>";
  document.getElementById("playGame").innerHTML = strHtml;
  intervalId = setInterval("myTimer()", 1000);
}

function myTimer() {
  var strHtml = "<font style='font-size: 50px; color:#345EDF;'><b>:" + tick-- + "</b></font>";
  document.getElementById("timerDiv").innerHTML = strHtml;
  if (tick <= 0) {
    clearInterval(intervalId);
    strHtml = "Sorry, the time's up!";
    document.getElementById("playGame").innerHTML = strHtml;
  }
}

function score(response, answer) {
  var strHtml;
  var score = 0;
  if (response == answer && tick > 20) {
    score = 3;
    strHtml = "<br><font color=#E22F6B><b>Correct Answer!!</b></font><br>You earned 3 raagabox gold coins <img src=/media/images/goldcoin.png width=20 height=20 border=0 /><img src=/media/images/goldcoin.png width=20 height=20 border=0 /><img src=/media/images/goldcoin.png width=20 height=20 border=0 />";
  } else if (response == answer && tick > 10) {
    score = 2;
    strHtml = "<br><font color=#E22F6B><b>Correct Answer!!</b></font><br>You earned 2 raagabox gold coins <img src=/media/images/goldcoin.png width=20 height=20 border=0 /><img src=/media/images/goldcoin.png width=20 height=20 border=0 />";
  } else if (response == answer) {
    score = 1;
    strHtml = "<br><font color=#E22F6B><b>Correct Answer!!</b></font><br>You earned 1 raagabox gold coin <img src=/media/images/goldcoin.png width=20 height=20 border=0 />";
  } else {
    strHtml = "Sorry, wrong answer, keep playing for gold.";
  }
  document.getElementById('gameBox').innerHTML = strHtml;

  var url = "http://www.raagabox.com/controller/gameScore.php?score=" + score;
  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
}

function fadePopularity() {
  var popularity = document.getElementById('popularity');
  Effect.Fade(popularity);
}

function updatePopularity(id, direction, type) {
  var popularity = document.getElementById('popularity');
  Effect.Appear(popularity);

  var url = "http://www.raagabox.com/controller/updatePopularity.php?";

  if (type == 0) {
    url = url + "mediaId=" + id + "&direction=" + direction;
  } else if (type == 1) {
    url = url + "artistId=" + id + "&direction=" + direction;
  }

  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
  setTimeout("fadePopularity()", 2000);
}

function rerunBirthday(form, birthDay) {
  var element = document.getElementById('birthMonth');
  var selectedMonth = element.selectedIndex;
  var strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION><OPTION>30</OPTION><OPTION>31</OPTION>"; 

  switch (selectedMonth) {
    case 2:
      strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION>"; 
      break;
    case 4:
      strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION><OPTION>30</OPTION>"; 
      break;
    case 6:
      strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION><OPTION>30</OPTION>"; 
      break;
    case 9:
      strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION><OPTION>30</OPTION>"; 
      break;
    case 11:
      strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION><OPTION>30</OPTION>"; 
      break;
    default:
      strHtml = "<OPTION SELECTED VALUE=0> Day <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION><OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION><OPTION>7</OPTION> <OPTION>8</OPTION><OPTION>9</OPTION><OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION><OPTION>13</OPTION> <OPTION>14</OPTION><OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION><OPTION>20</OPTION> <OPTION>21</OPTION><OPTION>22</OPTION><OPTION>23</OPTION> <OPTION>24</OPTION><OPTION>25</OPTION><OPTION>26</OPTION><OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION><OPTION>30</OPTION><OPTION>31</OPTION>"; 
      break;
  }
  document.getElementById('birthDay').innerHTML = strHtml;
}

function playPreview(mediaId, songUrl, songTitle, artist, image) {
  // create code for flash file and assign it to a variable
  var flashHtml = "<object type='application/x-shockwave-flash' width='340' height='140' data='http://www.raagabox.com/xspf_player.swf?autoplay=true&skin_url=http://www.raagabox.com/MiniTunes&track_url=" + songUrl + "&track_title=" + songTitle + "&creator=" + artist + "&image=" + image + "'>";
  flashHtml += "<param name='wmode' value='transparent'><param name='movie' value='http://www.raagabox.com/xspf_player.swf?autoplay=true&skin_url=http://www.raagabox.com/MiniTunes&track_url=" + songUrl + "&track_title=" + songTitle + "&creator=" + artist + "&image=" + image + "' /></object>";
  // assign the value of the variable to the innerHTML of the div
  document.getElementById('flashObject').innerHTML = flashHtml;
}

function playSong(songUrl, mid) {
  // create code for flash file and assign it to a variable
  var flashHtml = "<object type='application/x-shockwave-flash' data='http://www.raagabox.com/xspf_button.swf?autoplay=true&song_url=" + songUrl + "' width='17' height='17'>" + "/></object>";
  var buttonPlayerId = "buttonPlayer" + mid;
  // assign the value of the variable to the innerHTML of the div
  document.getElementById(buttonPlayerId).innerHTML = flashHtml;
}

function boxClear(theText) {
  if (theText.value == theText.defaultValue) {
    theText.value = ""
   }
}

function boxReset(theText) {
 theText.value = theText.defaultValue;
}

function changeSearch(num) {
  if (num == 1) {
    var searchHtml = "<form name='myform' action='search.php?m=1' method='post'>" +
         "<input name='searchterm' type='text' maxlength=1560 size=70 value='search music by artist name' onFocus='boxClear(this)'></font>" +
         "<input type='submit' value='search' name=submit  border=0>" +
    "</form>";
    // assign the value of the variable to the innerHTML of the div
    document.getElementById('container').innerHTML = searchHtml;
    var searchModesHtml = "<font size=-1>" + "<b>" + "Artist" + "</b>" + "</font>" + "&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=changeSearch(2)>" + "<font size=-1>" + "Track" + "</font>" + "</a>" + "&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=changeSearch(3)>" + "<font size=-1>" + "Tag" + "</font>" + "</a>" ;
    document.getElementById('searchModes').innerHTML = searchModesHtml;
  } else if (num == 2) {
    var searchHtml = "<form name='myform' action='search.php?m=2' method='post'>" +
         "<input name='searchterm' type='text' maxlength=1560 size=70 value='search music by track title' onFocus='boxClear(this)'></font>" +
         "<input type='submit' value='search' name=submit  border=0>" +
    "</form>";
    // assign the value of the variable to the innerHTML of the div
    document.getElementById('container').innerHTML = searchHtml;
    var searchModesHtml = "<a href='#' onclick=changeSearch(1)>" + "<font size=-1>" + "Artist" + "</font>" + "</a>" + "&nbsp;&nbsp;&nbsp;&nbsp;<font size=-1>" + "<b>" + "Track" + "</b>" + "</font>" + "&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=changeSearch(3)>" + "<font size=-1>" + "Tag" + "</font>" + "</a>" ;
    document.getElementById('searchModes').innerHTML = searchModesHtml;
  } else if (num == 3) {
    var searchHtml = "<form name='myform' action='search.php?m=3' method='post'>" +
         "<input name='searchterm' type='text' maxlength=1560 size=70 value='search music by tag' onFocus='boxClear(this)'></font>" +
         "<input type='submit' value='search' name=submit  border=0>" +
    "</form>";
    // assign the value of the variable to the innerHTML of the div
    document.getElementById('container').innerHTML = searchHtml;
    var searchModesHtml = "<a href='#' onclick=changeSearch(1)>" + "<font size=-1>" + "Artist" + "</font>" + "</a>" + "&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=changeSearch(2)>" + "<font size=-1>" + "Track" + "</font>" + "</a>" + "&nbsp;&nbsp;&nbsp;&nbsp;<font size=-1>" + "<b>" + "Tag" + "</b></font>";
    document.getElementById('searchModes').innerHTML = searchModesHtml;
  }

}

function fadeAdd2Playlist() {
  var add2playlist = document.getElementById('add2playlist');
  Effect.Fade(add2playlist);
}

function add2Playlist(mediaid, username) {
  if (username == 0) {
    window.location = "http://www.raagabox.com/account/signIn.php";
  } else {
    var add2playlist = document.getElementById('add2playlist');
    Effect.Appear(add2playlist);
    var url = "http://www.raagabox.com/controller/playlist.php?mediaid=" + mediaid;
    //  var xmlHttp = new XMLHttpRequest();
    var xmlHttp = zXmlHttp.createRequest();
    // Open a connection to the server
    xmlHttp.open("POST", url, true);
    // Setup a function for the server to run when it's done
    xmlHttp.onreadystatechange = showPlayer;
   // Send the request
    xmlHttp.send(null);
    setTimeout("fadeAdd2Playlist()", 2000);
  }
}

function removeFromPlaylist(mediaid) {
  var url = "http://www.raagabox.com/controller/playlist.php?remove=1&mediaid=" + mediaid;
//  var xmlHttp = new XMLHttpRequest();
  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
}

function postComment(myform, mediaid, txt) {
  var comment = document.getElementById(txt).value;
  var url = "http://www.raagabox.com/controller/addComment.php?mediaid=" + mediaid + "&comment=" + comment;
//  var xmlHttp = new XMLHttpRequest();
  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
  Effect.toggle(mediaid, 'appear');
}

function postBlogComment(myform, postId, txt) {
  var comment = document.getElementById(txt).value;
  var url = "/controller/addComment.php?postId=" + postId + "&comment=" + comment;

  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
  Effect.toggle(postId, 'appear');
}

function postFeedback(myform, txt, state) {
  var comment = document.getElementById(txt).value;
  var fbEmail = document.getElementById('fbEmail').value;
  var url = "http://www.raagabox.com/controller/feedback.php?comment=" + comment + "&state=" + state + "&email=" + fbEmail;
//  var xmlHttp = new XMLHttpRequest();
  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
  var feedbackdiv = document.getElementById('feedbackdiv');
  Effect.toggle(feedbackdiv, 'appear');
}

function showPlayer(){
}

function createRequest(){    
    try {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
        xmlHttp = false;
      }
    }
    if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
      xmlHttp = new XMLHttpRequest();
    }
    return xmlHttp;
}

function viewComments(loggedin, mediaid, comments, medianame, artist) {
  Effect.toggle(mediaid, 'appear');
  var shtml = "<div style='position:relative;background-color:#F2F2F2;width:450px;border:2px solid red;padding:10px;z-index:25'>";

  if (loggedin == 1) {
    shtml +=  "<p>" + artist + " - " + medianame + "<hr><br>" + "<b>User comments:</b><br>" + comments + "<form name='" + mediaid + "form'" + " action='" + "http://www.raagabox.com/controller/addComment.php?mediaid=" + mediaid + "' method='post'><b>Post your comment:</b><textarea rows=5 cols=50 name='" + mediaid + "txt'" + " id='" + mediaid + "txt'></textarea><br><input type='button' onclick=" + "\"" + "postComment('" + mediaid + "form'" + ", '" + mediaid + "', '" +  mediaid + "txt')" + "\"" + " value='Ok' name='Ok'  border=0 /><input type='button' onclick=" + "\"" + "Effect.toggle('" + mediaid + "','appear'); return false;" + "\"" + " value='Cancel' name='Cancel'  border=0 /></form>" + "</p>";
    shtml += "</div>";
  } else {
    shtml +=  "<p>" + artist + " - " + medianame + "<hr><br>" + "<b>User comments:</b><br>" + comments + "<hr>To post a comment please <a href=http://www.raagabox.com/account/signIn.php?mid=" + mediaid + "><font size=+1 color=#E22F6B>sign in</font></a>" + "<form method='post'><input type='button' onclick=" + "\"" + "Effect.toggle('" + mediaid + "','appear'); return false;" + "\"" + " value='Close' name='Cancel'  border=0 /></form>" + "</p>";
    shtml += "</div>";
  }
  document.getElementById(mediaid).innerHTML = shtml;
}

function viewBlogComments(loggedin, postId, comments) {
  Effect.toggle(postId, 'appear');
  var shtml = "<div style='position:relative;background-color:#F2F2F2;width:450px;border:2px solid red;padding:10px;z-index:25'>";

  if (loggedin == 1) {
    shtml +=  "<p>" + "<b>User comments:</b><br>" + comments + "<form name='" + postId + "form'" + " action='" + "http://www.raagabox.com/controller/addComment.php?postId=" + postId + "' method='post'><b>Post your comment:</b><textarea rows=5 cols=50 name='" + postId + "txt'" + " id='" + postId + "txt'></textarea><br><input type='button' onclick=" + "\"" + "postBlogComment('" + postId + "form'" + ", '" + postId + "', '" +  postId + "txt')" + "\"" + " value='Ok' name='Ok'  border=0 /><input type='button' onclick=" + "\"" + "Effect.toggle('" + postId + "','appear'); return false;" + "\"" + " value='Cancel' name='Cancel'  border=0 /></form>" + "</p>";
    shtml += "</div>";
  } else {
    shtml +=  "<p>" + "<b>User comments:</b><br>" + comments + "<hr>To post a comment please <a href=http://www.raagabox.com/account/signIn.php?postId=" + postId + "><font size=+1 color=#E22F6B>sign in</font></a>" + "<form method='post'><input type='button' onclick=" + "\"" + "Effect.toggle('" + postId + "','appear'); return false;" + "\"" + " value='Close' name='Cancel'  border=0 /></form>" + "</p>";
    shtml += "</div>";
  }
  document.getElementById(postId).innerHTML = shtml;
}

function playRadio() {
  var flashHtml = "<object type='application/x-shockwave-flash' width=340 height=140 data='/xspf_player.swf?playlist_url=/playlist.xspf'><param name='movie' value='/xspf_player.swf?playlist_url=/playlist.xspf&autoload=true' /></object>";
  document.getElementById('flashObject').innerHTML = flashHtml;
}

function showDetails(text) {
  show(text);
}

// notify the user that their password has been changed
function tellafriend(mediaid) {
  var friendemail = document.getElementById('friendemail').value;
  var myemail = document.getElementById('myemail').value;
  var msg = document.getElementById(mediaid + 'txt').value;
  var url = "http://www.raagabox.com/controller/tellAFriend.php?mediaid=" + mediaid + "&friendemail=" + friendemail + "&myemail=" + myemail + "&msg=" + msg;
  var xmlHttp = zXmlHttp.createRequest();
  // Open a connection to the server
  xmlHttp.open("POST", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = showPlayer;
    
 // Send the request
  xmlHttp.send(null);
  Effect.toggle(mediaid, 'appear');
}

function sendIt(mediaid, comments, medianame, artist) {
  Effect.toggle(mediaid, 'appear');
  var shtml = "<div style='position:relative;background-color:#F2F2F2;width:450px;border:2px solid red;padding:10px;z-index:25'>";
  shtml +=  "<p>" + "<form name='" + mediaid + "form'" + " action='" + "http://www.raagabox.com/controller/tellAFriend.php?mediaid=" + mediaid + "' method='post'><b>Send to your friend:</b><br><hr>Your Email <input style='border-width: thin;' name='myemail' id='myemail' type='text' maxlength=64 size=40 /><br><hr>Friend's Email<input style='border-width: thin;'  name='friendemail' id='friendemail' type='text' maxlength=64 size=40 /><br><hr>Message<textarea rows=5 cols=50 name='" + mediaid + "txt'" + " id=" + mediaid + "txt></textarea><br><input type='button' onclick=" + "\"" + "tellafriend('" + mediaid + "')" + "\"" + " value=Ok name=Ok  border=0 /><input type='button' onclick=" + "\"" + "Effect.toggle('" + mediaid + "','appear'); return false;" + "\"" + " value=Cancel name=Cancel  border=0 /></form>" + "</p>";
  shtml += "</div>";
  document.getElementById(mediaid).innerHTML = shtml;
}

<!--
google_ad_client = "pub-9705358192189854";
//728x90, created 1/9/08
google_ad_slot = "7621718284";
google_ad_width = 728;
google_ad_height = 90;
//-->