function renderImage(imageName, folderName, position) {

    document.write("<table border='0' width=100% align='center'>");
    document.write("<tr>");
    document.write("<td id='verysmall' align='center'>");
    var image = "<img src='http://www.tamilscrap.com/images/" + folderName + "/" + imageName + "'>";
    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>");
    document.write("</tr>");
    document.write("</table>");
    return;
}

function renderFooter() {
    document.write('<div class="clear"></div>');
    document.write('</body>');
    document.write('</html>');
    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('<!DOCTYPE html>');
    document.write('<html>');
    document.write('<head>');
    document.write('<title>tamilscrap(beta)</title>');
    document.write('<link type="text/css" rel="stylesheet" href="reset.css" />');
    document.write('<link type="text/css" rel="stylesheet" href="style.css" />');
    document.write('<META NAME="Keywords"');
    document.write('CONTENT="orkut, orkut scraps, orkut tamil scraps, tamilscrap, tamil scrap">');
    document.write('<META NAME="Description"');
    document.write('CONTENT="Get tamil orkut scraps, graphics.">');
    document.write('<meta name="description" content="" />');
    document.write('<link rel="canonical" href="http://www.tamilscrap.com/" />');
    document.write('<script src="jquery.js"></script>');
    document.write('<script src="jquery.slidegrid.js"></script>');
    document.write('<script src="tamilscrap.js"></script>');

    document.write('<script type="text/javascript">');
    document.write('$(document).ready(function() {');
    document.write('document.createElement("header");');
    document.write('document.createElement("section");');
    document.write('document.createElement("article");');
    document.write('document.createElement("nav");');
    document.write('$(".list article a").hover(function(){');
    document.write('$(this).find("img").animate({top:"-0px"},{queue:false,duration:300});');
    document.write('}, function(){');
    document.write('$(this).find("img").animate({top:"0px"},{queue:false,duration:500});');
    document.write('});');
    document.write('});');

    document.write('</script>');
    document.write('</head>');

    document.write('<body class="home blog">');
    document.write('<header>');
    document.write('<h1>tamilscrap(beta) </h1>');
    document.write('<nav><a href="welcome.html">HOME</a>');
    document.write('<a href="festivals.html" class="festivals">FESTIVALS</a>');
    document.write('<a href="love.html" class="haiko">LOVE</a>');
    document.write('<a href="mokka.html" class="mokkai">MOKKAI</a>');
    document.write('<a href="haiku.html" class="love">HAIKU</a>');
    document.write('</nav>');

    document.write('</header>');

    document.write('<br>');
    document.write('<h4>best viewed with Firefox,Chrome and Safari.</h4>');

}

function showImage(imageName,folderName,pos) {
    document.write('<article id="post-'+pos+'">');
    document.write('<span class="cat ShowImage"></span>');
    var aHref = '<img width="310" height="225" src="images/'+folderName+'/'+imageName+'" class="" alt="" title="" />';
    var siteURL = "http://www.tamilscrap.com/images/"+folderName+"/"+imageName;
    var twitURL = 'http://twitter.com/home?status=Greetings from tamilscrap '+siteURL;
    var facebookURL = 'http://facebook.com/sharer.php?u='+siteURL+'&t=tamilscrap greetings';
    var orkutURL='http://promote.orkut.com/preview?nt=orkut.com&tt=tamilscrap.com&du='+siteURL;
    var mySpaceURL='http://www.myspace.com/index.cfm?fuseaction=postto&t=tamilscrap.com&c=Greetings&u='+siteURL+'&l=';

    document.write(aHref);
    document.write('<header>');
    document.write('<a href="'+facebookURL+'" target="parent"><img width="20" height="20" src="images/facebook-32x32.png" alt=""></a>');
    document.write('&nbsp;&nbsp;<a href="'+twitURL+'" target="parent"><img width="20" height="20" src="images/twitter-32x32.png" alt=""></a>');
    document.write('&nbsp&nbsp;<a href="'+orkutURL+'" target="parent"><img width="20" height="20"src="images/orkut-32x32.png" alt=""></a>');
    document.write('&nbsp;&nbsp;<a href="'+mySpaceURL+'" target="parent"><img width="20" height="20"src="images/myspace-32x32.png" alt=""></a>');
    document.write('</header>');
    document.write('</article>');

}

function showMe(id,index) {

    document.getElementById(id+index).style.visibility="visible";
    var arrayOfDivs = document.getElementsByTagName('span');
    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="";
        }
    }
}

