function renderImage(imageName, folderName, position) {
    if(position == 1) {
        document.write("<table border='0' width=100% align='center'>");
    }
    if(position % 5 == 1 || position == 1) {
        document.write("<tr><td>&nbsp;</td></tr>");
        document.write("<tr>");
    }

    document.write("<td id='verysmall' align='center'>");
    var image = "<a href='javascript:viewBigImage(\""+ imageName + "\",\"" + folderName + "\")'>" +
                "<img src='http://www.tamilscrap.com/images/" + folderName + "/" + imageName + "' width='100' " +
                "height='100' border='0'> </a>";
    document.write(image);
    //var valForTA = "<a href=www.tamilscrap.com>" + image + "</a>";
    //document.write("<br>copy and paste on your orkut scrapbook textbox");
    //document.write('<br><textarea id="orkutVal" cols=50 rows="4">' +
                   //'' + valForTA +
                   //'</textarea>');
    document.write("</td>");
    if(position % 5 == 0 || position == -1) {
        document.write("</tr>");
    }
    if(position == -1) {
        document.write("</table>");
    }
    return;
}

function viewBigImage(bimageName,bfolderName) {
    var win =window.open("", "newwin","width=500,height=600");
    image = "<img src='http://www.tamilscrap.com/images/" + bfolderName + "/" + bimageName + "'>";
    win.document.write(image);
    var valForTA = "<a href=www.tamilscrap.com>" + image + "</a>";
    win.document.write("<br>copy and paste on your orkut scrapbook textbox");
    win.document.write('<br><textarea id="orkutVal" cols=55 rows="5">' +
                   '' + valForTA +
                   '</textarea>');
}

function renderFooter() {
    document.write('<tr height="23" valign="top">');
    document.write('<td colspan="8" id="small">This website is best viewed in screen resolution 1024x768 and above.');
    document.write('tamilscrap.com (c) 2008-09.');
    document.write('All Rights Reserved. <a href="mailto:admin@tamilscrap.com">admin@tamilscrap.com</a></td>');
    document.write('</tr>');
    return;
}

function trackCode() {
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    try {
        var pageTracker = _gat._getTracker("UA-3370597-2");
        pageTracker._trackPageview();
    } catch(err) {
    }
}

function renderMenu() {

      document.write('<tr height="5%">');
      document.write('<td>');
      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,40,0"');
      document.write('WIDTH="800" HEIGHT="100" id="myMovieName">');
      document.write('<PARAM NAME=movie VALUE="flashmo_114_horizontal_01.swf">');
      document.write('<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>');
      document.write('<EMBED src="flashmo_114_horizontal_01.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="100"');
      document.write('flashvars="flashmo_menu_item_list.xml" NAME="myMovieName"');
      document.write('ALIGN="" TYPE="application/x-shockwave-flash"');
      document.write('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
      document.write('</EMBED></OBJECT>');
      document.write('</td>');
      document.write('</tr>');
}

function renderHeader() {
    document.write('&nbsp;');
    document.write('<table border="0" align="left" width="800" height="900">');
    document.write('<tr valign="top" align="left" height="100">');
    document.write('<td>');
    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,40,0"');
    document.write('WIDTH="800" HEIGHT="90" id="myMovieName">');
    document.write('<PARAM NAME=movie VALUE="logo.swf">');
    document.write('<PARAM NAME=quality VALUE=high><PARAM>');
    document.write('<EMBED src="logo.swf" quality=high WIDTH="800" HEIGHT="90"');
    document.write('"NAME="myMovieName"');
    document.write('ALIGN="" TYPE="application/x-shockwave-flash"');
    document.write('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
    document.write('</EMBED></OBJECT>');
    document.write('</td>');
    document.write('</tr>');
}

function showMe(id,index) {
    document.getElementById(id+index).style.visibility="visible";
    var arrayOfDivs = document.getElementsByTagName('div');
    var howMany = arrayOfDivs.length;
    for (var i=0; i < howMany; i++) {
        var thisDiv = arrayOfDivs[i];
        var thisName = thisDiv.id;
        if(id+index != thisName) {
            document.getElementById(thisName).style.visibility="hidden";
            document.getElementById(thisName).style.display="none";
        } else {
            document.getElementById(thisName).style.visibility="visible";
            document.getElementById(thisName).style.display="";
        }
    }
}
