/*
GOOGLE CUSTOM SEARCH
Whenever you make changes in the Google Custom Search Page, don't forget to download the Latest modified scripts from http://google.com/coop/cse/brand?form=searchbox_005905209911493672351%3Azjszcaidgio

This has too much comment because i am trying to understand how the scripts works and also refreshing my javascript knowledge.
Pretty lame huh!!!

*/

(
 function() { //creating anonymous
		  var f = document.getElementById('searchbox_005905209911493672351:zjszcaidgio'); // get the form
		
		if (f && f.q) // does the searchbox form and textbox exist
		{
			  var q = f.q; 
			  var n = navigator;
			  var l = location;
			  
			  if (n.platform == 'Win32') // if running under window platform
			  {
				  q.style.cssText = 'border: 1px solid #7e9db9; padding: 2px;';  //draw a thin border round the textbox
				} 
			
			var b = function() // create another function name ' b '
			{ 
		
				if (q.value == '') // if the textbox is empty.. put the google watermark in background.
			  	{ 
				  q.style.background = '#FFFFFF url(google_custom_search_watermark.gif) left no-repeat'; 
			  	} 
			 
			 }; 

			
			var f = function() // create another function name ' f '
			{ 
				q.style.background = '#ffffff';  // put textbox background white
			}; 
			
			q.onfocus = f;	// on focus, run function 'f' i.e make the textbox background white.
			q.onblur = b; 	// on blur or onmouseout, run function 'b' i.e make the textbox background google search watermark.
			
			if (!/[&?]q=[^&]/.test(l.search)) 
			{ 
			  b();
			  } 
		} 
	}
)
(); 