// JS FUNCTIONS FOR WWW.WHOVISITED.COM
//    by Alex Elliott

// void codeswitch(colour)
//
// This function takes the code samples
// for the user images and modifies it
// when one of the colour buttons is
// clicked.  It also changes the demo
// image to be one of that colour.
function codeswitch(colour,id)
{
   // Variables.
   var bob = document.getElementById('codebox');
   var joe = document.getElementById('example_image');
   // Empty code sample.
   bob.innerHTML = '';
   //bob.innerHTML = '&lt;a href="http://whovisited.com/" title="WhoVisited.Com - MySpace Profile Tracking"&gt;&lt;img src="http://whovisited.com/member_images/'+id+'_'+colour+'.png" alt="WhoVisited.Com - MySpace Profile Tracking" border="0"&gt;&lt;/a&gt;&lt;a href="http://www.whovisited.com/"&gt;MySpace Tracker&lt;/a&gt;';
   bob.innerHTML = '&lt;img src="http://whovisited.com/member_images/'+id+'_'+colour+'.png" alt="WhoVisited.Com - MySpace Profile Tracking" border="0"&gt;';
   joe.src = 'http://whovisited.com/member_images/1_'+colour+'.png';
}

// void verifyid()
//
// This function modifies the page's
// iframe to make the src reflect that
// of the user's MySpace page.  It also
// makes the form to submit the id
// appear below.
function verifyid()
{
   // Variables:
   var forminput = document.getElementById('myspaceid');
   var dan = document.getElementById('iframeitem');
   var doug = document.getElementById('formbox');
   // Modify src:
   dan.innerHTML = 'If the below profile is your profile, you have sucessfully put in the correct friend ID! If it is not your profile please try and put in your correct ID again. <br /> <iframe src="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid='+forminput.value+'" id="iframe" width="100%" height="400">Your browser does not support iframes, please validate your MySpace ID manually.</iframe>';
   // Modify innerHTML:
   doug.innerHTML = '<a href="javascript:void(0)" style="font-size: 26px;" title="Continue" onclick="document.getElementById(\'getid\').submit()">Yep, that\'s my profile, continue ...</a>';
}

