﻿document.writeln('<script src="http://embed.baamboo.com/searchbox/avim.js" type="text/javascript"></script>'+
'<link rel="stylesheet" type="text/css" href="http://embed.baamboo.com/searchbox/style.css" />'+
'<script src="http://embed.baamboo.com/searchbox/function.js" type="text/javascript"></script>');

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
addLoadEvent(function() {
    document.getElementById('search').onkeypress = enterRedirect;
    document.getElementById("tcontent2").style.display = 'none';  
    document.getElementById("tcontent1").style.display = 'none'; 
    document.getElementById("tcontent3").style.display = 'none';
    document.getElementById("tcontent4").style.display = 'block';
    document.getElementById("mp3").className='selected';
    document.getElementById("video").className='noselected';
    //document.getElementById("dic").className='noselected';
    document.getElementById("tra").className='noselected';
    //document.getElementById("goo").className='noselected';
});

var tablewidth ="468px"; 
var tableheight ="60px";
var searchbox_tablewidth ="448px";
var textbox_tdwidth ="335px";
var textbox_size ="45";
var tablestyle ="border:solid 1px #45BEF1; background-image:url(\'http://embed.baamboo.com/images/bgsearch.gif\');background-repeat:repeat-x; ";

var boxdiv = document.getElementById('bb_boxsearch');

var strHtml = writeTab() + writeBox() + writeOption() + writeLink();
boxdiv.innerHTML = strHtml;
//document.writeln('<script src="http://embed.baamboo.com/searchbox/tab_mau1.js" type="text/javascript"></script>'+
//'<script src="http://embed.baamboo.com/searchbox/seachbox.js" type="text/javascript"></script>'+
//'<script src="http://embed.baamboo.com/searchbox/optiontab.js" type="text/javascript"></script>'+
//'<script src="http://embed.baamboo.com/searchbox/linktop.js" type="text/javascript"></script>');
//Start Tab Content script for UL with id="maintab" Separate multiple ids each with a comma.

//initializetabcontent("maintab")


function writeTab()
{
	var strTab = '<table cellpadding="0" cellspacing="0" width='+tablewidth+' height='+tableheight+' align="center" style="'+tablestyle+'"  >'+
	''+	 
        '<tr>'+
	        '<td align="center" style="font:bold 11px Tahoma;color:#999;">	'+	
		        '<span id="mp3" class="noselected"><a href="javascript:displayrad(\'1\');getRadCheck(\'1\');document.getElementById(\'radM1\').checked=\'true\';getTab(\'2\');">MP3</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	'+	
		        '<span id="video" class="noselected"><a href="javascript:displayrad(\'2\');getRadCheck(\'1\');document.getElementById(\'radV1\').checked=\'true\';getTab(\'1\');">VIDEO</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	'+	
                //'<span id="dic" class="noselected"><a href="javascript:displayrad(\'3\');getRadCheck(\'1\');document.getElementById(\'radD1\').checked=\'true\';getTab(\'3\');">VIETDIC</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	'+	
                '<span id="tra" class="selected"><a href="javascript:displayrad(\'4\');getRadCheck(\'1\');document.getElementById(\'radT1\').checked=\'true\';getTab(\'4\');">TRA TỪ</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	'+	
                //'<span id="goo" class="noselected"><a href="javascript:displayrad(\'5\');getRadCheck(\'1\');document.getElementById(\'radG1\').checked=\'true\';getTab(\'5\');">GOOGLE</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	'+	
//                '<span id="blog" class="noselected"><a href="javascript:displayrad(\'4\');getRadCheck(\'1\');document.getElementById(\'radB1\').checked=\'true\';getTab(\'4\');">BLOG</a></span>	'+			
	        '</td>'+
        '</tr>';
		
	return strTab;
}

function writeBox()
{
	var strBox = '<tr>'+
	        '<td align="center">'+
	            '<table border="0" cellpadding="0" cellspacing="0" width='+searchbox_tablewidth+'  align="center" >'+
	            '<tr>'+
	                '<td style="background-image:url(\'http://embed.baamboo.com/searchbox/bg_textbox_left.jpg\');width:4px;background-repeat:no-repeat;">'+
	                    
	                '</td>'+
	                '<td style="background-image:url(\'http://embed.baamboo.com/searchbox/bg_textbox.jpg\');width:'+textbox_tdwidth+';background-repeat:repeat-x;height:25px;padding-right:10px;" align="right">	'+	
                        '<input id="utm_campaign" name="utm_campaign" type="hidden" value="Mua" >'+		                
		                 '<img style="cursor:pointer;" id="btnVietkey1" align="absMiddle" alt="Chuyển bộ gõ" border="0"'+
                            'language="javascript" onclick="btnVietkey_onclick();" src=\'http://embed.baamboo.com/searchbox/V.gif\' style="cursor: pointer;" />&nbsp;&nbsp;&nbsp;'+
		                '<input  id="search" name="search"  type="text" size='+textbox_size+'  style="background-image:url(\'http://embed.baamboo.com/searchbox/bg_textbox_in.jpg\');background-repeat:no-repeat;border:none;background-position:right;border-width:0px;" onclick="this.style.backgroundImage=\'none\';" >'+		                
	                '</td>'+
	                '<td align="center" style="background-image:url(\'http://embed.baamboo.com/searchbox/bg_button_search.jpg\');width:91px;background-repeat:no-repeat;">'+
	                    '<input style="vertical-align: middle;" type="image" src="http://embed.baamboo.com/searchbox/button_search1.jpg"  onclick="redirect();"  width="86px" >'+
//	                    '<input  type="button"  onclick="redirect();" style="cursor:pointer;border:none;background-image:url(\'http://embed.baamboo.com/searchbox/button_search1.jpg\');width:81px;background-repeat:no-repeat;background-position:right;" >'+
	                '</td>'+
                '</tr>'+
                '</table>'+
	        '</td>'+
        '</tr>'; 
		
	return strBox;
}

function writeOption()
{
	var strOption = '<tr>'+
        '<td style="font:12px Verdana; ">'+
            '<input id="choice" name="choice" type="hidden" value="1">'+
            '<input id="tab" name="tab" type="hidden" value="2">'+
        '<div id="tcontent1" style="text-align:center;display:none; color:#000;font:11px Tahoma;">'+
        '<input name="raVideo" id="radV1" type="radio" value="1" checked onclick="getRadCheck(this.value)" >&nbsp;YouTube&nbsp;&nbsp;'+
        '<input name="raVideo" type="radio" value="5" onclick="getRadCheck(this.value)">&nbsp;Việt nam&nbsp;&nbsp;'+
        '<input name="raVideo" type="radio" value="3" onclick="getRadCheck(this.value)" >&nbsp;Phim'+
        '</div>'+
        '<div id="tcontent2" style="color:#000;text-align:center;display:block;font:11px Tahoma;" >'+
        '<input name="raMP3" id="radM1" type="radio" value="1"  onclick="getRadCheck(this.value)" checked>&nbsp;Việt nam &nbsp;&nbsp;'+
        //'<input name="raMP3" type="radio" value="2" onclick="getRadCheck(this.value)">&nbsp;Quốc tế'+
        '<input name="raMP3" type="radio" value="3" onclick="getRadCheck(this.value)">&nbsp;Lời bài hát &nbsp;&nbsp;'+
        //'<input name="raMP3" type="radio" value="4" onclick="getRadCheck(this.value)">&nbsp;Nghệ sỹ &nbsp;&nbsp;'+
        '</div>'+
            '<div id="tcontent3" style="text-align:center;display:none; color:#000;font:11px Tahoma;">'+
        '<input name="raDic" id="radD1" type="radio" value="1" onclick="getRadCheck(this.value)" checked>&nbsp;Anh-Việt&nbsp;&nbsp;'+          
            '<input name="raDic" type="radio" value="3" onclick="getRadCheck(this.value)">&nbsp;Pháp-Việt&nbsp;&nbsp;'+
            '<input name="raDic" type="radio" value="9" onclick="getRadCheck(this.value)">&nbsp;Đức-Việt&nbsp;&nbsp;'+
        '</div>'+
        '<div id="tcontent4" style="text-align:center;display:none; color:#000;font:11px Tahoma;">'+
        '<input name="raTra" id="radT1" type="radio" value="en_vn" onclick="getRadCheck(this.value)" checked>&nbsp;Anh-Việt&nbsp;&nbsp;'+          
		'<input name="raTra" id="radT1" type="radio" value="vn_en" onclick="getRadCheck(this.value)" checked>&nbsp;Việt-Anh&nbsp;&nbsp;'+          
            '<input name="raTra" type="radio" value="fr_vn" onclick="getRadCheck(this.value)">&nbsp;Pháp-Việt&nbsp;&nbsp;'+
            '<input name="raTra" type="radio" value="vn_vn" onclick="getRadCheck(this.value)">&nbsp;Việt-Việt&nbsp;&nbsp;'+
        '</div>'+
        '<div id="tcontent5" style="text-align:center;display:none; color:#000;font:11px Tahoma;">'+
        '<input name="raGoo" id="radG1" type="radio" value="1" onclick="getRadCheck(this.value)" checked>&nbsp;Web&nbsp;&nbsp;'+          
            '<input name="raGoo" type="radio" value="2" onclick="getRadCheck(this.value)">&nbsp;Viết bằng tiếng việt&nbsp;&nbsp;'+
            '<input name="raGoo" type="radio" value="3" onclick="getRadCheck(this.value)">&nbsp;Từ Việt Nam&nbsp;&nbsp;'+
        '</div>'+
         '<div id="tcontent6" style="text-align:center;display:none; color:#000;font:11px Tahoma;">'+
        '<input name="raRao" id="radR1" type="radio" value="1" onclick="getRadCheck(this.value)" checked>&nbsp;Tìm chính xác&nbsp;&nbsp;'+          
            '<input name="raRao" type="radio" value="0" onclick="getRadCheck(this.value)">&nbsp;Có một trong các từ trên&nbsp;&nbsp;'+           
        '</div>'+
//        '<div id="tcontent5" style="text-align:center;display:none; color:#000;font:11px Tahoma;">'+
//        '<input name="raBlog" id="radB1" type="radio" value="1" onclick="getRadCheck(this.value)" checked>&nbsp;Tìm toàn bộ&nbsp;&nbsp;'+          
//            '<input name="raBlog" type="radio" value="2" onclick="getRadCheck(this.value)">&nbsp;Tìm theo tên&nbsp;&nbsp;'+
//            '<input name="raBlog" type="radio" value="3" onclick="getRadCheck(this.value)">&nbsp;Tìm theo blog entry&nbsp;&nbsp;'+
//            '<input name="raBlog" type="radio" value="4" onclick="getRadCheck(this.value)">&nbsp;Tìm theo tên (test)&nbsp;&nbsp;'+
//        '</div>'+
        '</td>'+
          ' </tr>';
		
	return strOption;
}


function writeLink()
{
	var strLink = '<tr>'+
//            '<td align="center" style="font:bold 10px Tahoma;padding-bottom:3px;">'+
  //              '<a href="http://video.baamboo.com/searchbox/Redirection.aspx?s=top100ToDay" target="_blank" class="top" >Top 100 Mp3 VN</a> |'+ 
    //            '<a href="http://video.baamboo.com/searchbox/Redirection.aspx?s=top100FR" target="_blank" class="top"  >Top 100 Mp3 quốc tế</a> | '+
      //          '<a href="http://video.baamboo.com/searchbox/Redirection.aspx?s=b_md" target="_blank" class="top" >Top 100 video</a>'+
        //    '</td>'+
          //'</tr>'+
    '</table>';
	return strLink;
}

