 // Called only the first time after textbox is clicked
function firstTimeClick(InputBoxId) {
    
    //alert(InputBoxId);
    var textBoxObj = document.getElementById(InputBoxId);
    
    textBoxObj.setAttribute("value","");
    textBoxObj.onclick = function(){return false;};
    
}

// Adding default content into textboxes and binding onfocus to the firstTimeClick
function addDefaultContent() {
    
 //   var IBIds = new Array ("Name", "EmailAddress", "Phone", "AddressLine1", "AddressLine2","Town","PostCode","DayOfBirth","MonthOfBirth","YearOfBirth");
 //   var DefaultContents = new Array ("Name", "Email Address", "Telephone Number","Address line 1" ,"Address line 2","Town","PostCode","DD","MM","YYYY");
      
    try {
        
         var tmpObj = document.getElementById("Name");
         tmpObj.setAttribute("value", "Name");
         tmpObj.onclick= function(){firstTimeClick("Name");};
         
         var tmpObj = document.getElementById("EmailAddress");
         tmpObj.setAttribute("value", "Email Address");
         tmpObj.onclick= function(){firstTimeClick("EmailAddress");};
         
         var tmpObj = document.getElementById("Phone");
         tmpObj.setAttribute("value", "Telephone Number");
         tmpObj.onclick= function(){firstTimeClick("Phone");};
         
         var tmpObj = document.getElementById("AddressLine1");
         tmpObj.setAttribute("value", "Address line 1");
         tmpObj.onclick= function(){firstTimeClick("AddressLine1");};
         
         var tmpObj = document.getElementById("AddressLine2");
         tmpObj.setAttribute("value", "Address line 2");
         tmpObj.onclick= function(){firstTimeClick("AddressLine2");};
         
         var tmpObj = document.getElementById("Town");
         tmpObj.setAttribute("value", "Town");
         tmpObj.onclick= function(){firstTimeClick("Town");};
         
         var tmpObj = document.getElementById("PostCode");
         tmpObj.setAttribute("value", "Post Code");
         tmpObj.onclick= function(){firstTimeClick("PostCode");};
         
         var tmpObj = document.getElementById("DayOfBirth");
         tmpObj.setAttribute("value", "DD");
         tmpObj.onclick= function(){firstTimeClick("DayOfBirth");};
         
         var tmpObj = document.getElementById("MonthOfBirth");
         tmpObj.setAttribute("value", "MM");
         tmpObj.onclick= function(){firstTimeClick("MonthOfBirth");};
         
         var tmpObj = document.getElementById("YearOfBirth");
         tmpObj.setAttribute("value", "YYYY");
         tmpObj.onclick= function(){firstTimeClick("YearOfBirth");};
   
   } catch (err) {}
}

// Function which is called when the Reset button is pressed
function onClear(){
    document.getElementById('frmDataCapture').reset(); 
    addDefaultContent();
    return clearError();
}


// Do some initialization stuff on page load


addDefaultContent(); //Add default text into the text boxes


// Bind the onClear function to the Reset button
var obj0 = document.getElementById('FormInputs').lastChild.firstChild;
if(obj0!=null) 
{
	if (navigator.appName != 'Microsoft Internet Explorer')
	{ // e.g. Firefox, Opera, Safari
	        obj0.href="javascript:void(0)";
        	obj0.setAttribute("onclick", "onClear();");
	}
	else
	{ // e.g. Internet Explorer (also would work on Opera)
	        obj0.attachEvent("onclick", onClear);
	}
}

// Adding privacy text

var obj0 = document.getElementById('FormInputs');
if(obj0!=null) {

    var theNewDiv = document.createElement('div');
    theNewDiv.id='Privacy';
    obj0.appendChild(theNewDiv);
    document.getElementById('Privacy').innerHTML='Your information will be used solely for the fulfillment of this offer, and will not be associated with any Microsoft may have previously collected from you. The information collected will not be retained following the conclusion of this offer. <STRONG><A href="http://go.microsoft.com/fwlink/?LinkId=74170" target="_blank"><FONT color="#ffffff">Privacy</FONT></A></STRONG>';
   
    //var theTextOfTheParagraph = document.createTextNode('Your information will be used solely for the fulfillment of this offer, and will not be associated with any Microsoft may have previously collected from you. The information collected will not be retained following the conclusion of this offer. <STRONG><A href="http://go.microsoft.com/fwlink/?LinkId=74170" target="_blank"><FONT color="#ffffff">Privacy</FONT></A></STRONG>');
    //theNewDiv.appendChild(theTextOfTheParagraph);
    

}
//----------------------3rd party tracking 2--------------------

//<!-- Start of DoubleClick Spotlight Tag: Please do not remove-->
//<!-- Activity Name for this tag is:Poll -->
//<!-- Web site URL where tag should be placed: http://www.MSN.com -->
//<!-- This tag must be placed within the opening <body> tag, as close to the beginning of it as possible-->
//<!-- Creation Date:4/22/2009 -->

var axel = Math.random()+"";
var a = axel * 10000000000000;
document.write('<IMG SRC="http://fls.uk.doubleclick.net/activityi;src=1001566;type=2009n403;cat=compe781;ord='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0></IMG>');
