ï»¿    google.setOnLoadCallback(OnLoad); 

    google.load("search", "1", {"language" : "TR"});	
	
	
	function OnLoad() {
		
		var options = new google.search.SearcherOptions();
		options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
		options.setNoResultsString("HiÃ§ bir ÅŸey bulunamadÄ±...."); 
		
		var drawOptions = new google.search.DrawOptions();
		drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
        /*drawOptions.setInput(document.getElementById('query'));*/
		drawOptions.setSearchFormRoot(document.getElementById("searchcontrol"));
		
		var searchControl = new google.search.SearchControl();
		
		var searcher = new google.search.WebSearch();		
		searcher.setRestriction(google.search.Search.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
		searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);	
		searcher.setSiteRestriction("5265323049489168:150qm-7rr25");
		searchControl.addSearcher(searcher, options);
		
		//var searcher = new google.search.LocalSearch();		
		//searcher.setRestriction(google.search.Search.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
		//searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		//searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);	
		//searcher.setSiteRestriction("5265323049489168:150qm-7rr25");
		//searchControl.addSearcher(searcher, options);
		
		var searcher = new google.search.ImageSearch();		
		searcher.setRestriction(google.search.Search.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
		searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);	
		searcher.setSiteRestriction("5265323049489168:150qm-7rr25");
		searchControl.addSearcher(searcher, options);

		var searcher = new google.search.BlogSearch();		
		//searcher.setRestriction(google.search.Search.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
		searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);	
		//searcher.setSiteRestriction("5265323049489168:150qm-7rr25");
		searchControl.addSearcher(searcher, options);

		var searcher = new google.search.VideoSearch();
		searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);
		searchControl.addSearcher(searcher, options);

		var searcher = new google.search.NewsSearch();		
		searcher.setRestriction(google.search.Search.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
		searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);	
		searcher.setSiteRestriction("5265323049489168:150qm-7rr25");
		searchControl.addSearcher(searcher, options);		
		
		var searcher = new google.search.BookSearch();
		searcher.setRestriction(google.search.Search.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
		searcher.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
		searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET);
		searchControl.addSearcher(searcher, options);		
		
		searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
		searchControl.setSearchStartingCallback(this, OnLoad.prototype.OnSearchStarting);
		searchControl.setSearchCompleteCallback(this, OnLoad.prototype.OnSearchComplete);
		searchControl.draw(document.getElementById("searchFormresult"), drawOptions);
		/*FireFox & Chrome*/		
		if(document.forms[0].search!=null) document.forms[0].search.focus();
		/*IE*/
		if(document.getElementsByTagName('input')[0] != null) document.getElementsByTagName('input')[0].focus();		
		/*google.search.getBranding(document.getElementById("branding"));*/
	
	}

	OnLoad.prototype.OnSearchStarting = function(sc, searcher, query) { 
		document.getElementById("searchPub").style.display = "none";	
		document.getElementById("searchClearBar").style.display = "none";		
		//
		//document.getElementById("beforeSearch").style.display = "none";
		//document.getElementById("afterSearch").style.display = "";
		//document.getElementById("searchcontrol").className = "afterSearchStyle";
		//document.getElementById("searchlocal").className = "afterSearchlocalStyle";
	}
	
	OnLoad.prototype.OnSearchComplete = function(sc, searcher) {  
		document.getElementById("searchPub").style.display = "";		
		document.getElementById("searchClearBar").style.display = "";		
	}	
	
/**
* @param string param
* nom du paramètre dont on souhaite avoir la valeur
* @param url
* url dans laquel on souhaite récupérer le paramètre ou rien si l'on souhaite travailler sur l'url courante
* @return String
* @author Labsmedia
* @see http://www.labsmedia.com
* @licence GPL
*/
function getParamValue(param,url)
{
    var u = url == undefined ? document.location.href : url;
    var reg = new RegExp('(\\?|&|^)'+param+'=(.*?)(&|$)');
    matches = u.match(reg);
	if(matches==null) return 'en';
    return matches[2] != undefined ? decodeURIComponent(matches[2]).replace(/\+/g,' ') : 'TR';
}	