Boogeyman001
Registered
Здравейте.
Опитвам се да направя удобно и бързо търсене на моя сайт, и така стигнах то този проблем. Сабрах най ползваните търсачки и ги разделих на 4 групи. Всяка група от търсачки си работи нормално но когато ги сабера в таб меню при търсене страницата само се рефрешва. Сигурен съм че е нещо много елементарно но немога да го оправя.
http://demosait.hit.bg вижте за какво става на въпрос
Ето го и кода
Опитвам се да направя удобно и бързо търсене на моя сайт, и така стигнах то този проблем. Сабрах най ползваните търсачки и ги разделих на 4 групи. Всяка група от търсачки си работи нормално но когато ги сабера в таб меню при търсене страницата само се рефрешва. Сигурен съм че е нещо много елементарно но немога да го оправя.
http://demosait.hit.bg вижте за какво става на въпрос
Ето го и кода
Код:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder - http://www.wysiwygwebbuilder.com">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="wb_Html1" style="position:absolute;left:143px;top:104px;width:421px;height:201px;z-index:0" align="left">
<style type="text/css">
#tablist{
padding: 3px 0;
margin-left: 0;
margin-bottom: 0;
margin-top: 0.1em;
font: bold 12px Verdana;
}
#tablist li{
list-style: none;
display: inline;
margin: 0;
}
#tablist li a{
padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #778;
border-bottom: none;
background: white;
}
#tablist li a:link, #tablist li a:visited{
color: navy;
}
#tablist li a.current{
background: lightyellow;
}
#tabcontentcontainer{
width: 400px;
/* Insert Optional Height definition here to give all the content a unified height */
padding: 5px;
border: 1px solid black;
}
.tabcontent{
display:none;
}
</style>
<script type="text/javascript">
/***********************************************
* Tab Content script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]
////////Stop editting////////////////
function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}
var previoustab=""
function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}
function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}
function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}
function do_onload(){
var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
collecttablinks()
initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck){
var cookieparse=get_cookie(cookiename).split("|")
var whichtab=cookieparse[0]
var tabcontentid=cookieparse[1]
expandcontent(tabcontentid, tabobjlinks[whichtab])
}
else
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
</script>
<ul
id="tablist">
<li><a href="http://www.dynamicdrive.com" class="current"
onClick="return expandcontent('sc1', this)">Търсачки</a></li>
<li><a href="new.htm" onClick="return expandcontent('sc2',
this)" theme="#EAEAFF">Субтитри</a></li>
<li><a href="hot.htm" onClick="return expandcontent('sc3',
this)" theme="#FFE6E6">Клипчета</a></li>
<li><a href="search.htm" onClick="return expandcontent('sc4',
this)" theme="#DFFFDF">Уикипедиа</a></li>
</ul>
<DIV id="tabcontentcontainer">
<div id="sc1" class="tabcontent">
<script language="JavaScript">
current_site = "Google1"
var set_def = false
function fetch() {
if (set_def == true) {
set_default = "t"
}else{
set_default = ""
}
tmp = document.SearchForm1.Search.value;
stmp = "";
for (i=0 ; i <= tmp.length ; i++) {
if (tmp.charAt(i) == " ") {
stmp = stmp + "+";
} else {
stmp = stmp + tmp.charAt(i);
}
}
if (current_site == "Google") {
top.location.href = "http://www.google.bg/search?hl=bg&q=" + document.SearchForm.Search.value
}
if (current_site == "Jabse") {
top.location.href = "http://jabse.bg/searchmachine.php?query=" + document.SearchForm.Search.value
}
if (current_site == "Search.bg") {
top.location.href = "http://web.search.bg/search.php?query=" + document.SearchForm.Search.value
}
if (current_site == "Yahoo") {
top.location.href = "http://search.yahoo.com/bin/search?p=" + document.SearchForm.Search.value + "&mode=blended&tag=multiz-20"
}
return false;
}
function toggle_setdef() {
set_def = !(set_def);
}
function setsite(sitenow) {
current_site = sitenow;
}
</script>
<center>
<h2></h2>
</center>
<form method="GET" name="SearchForm1" onsubmit="return fetch()">
<center>
<font size="-1">Google</font>
<input type="radio" name="SITE" value="Google" checked onclick="setsite('Google')">
<font size="-1">Jabse</font>
<input type="radio" name="SITE" value="Jabse" onclick="setsite('Jabse')">
<font size="-1">Search.bg</font>
<input type="radio" name="SITE" value="Search.bg" onclick="setsite('Search.bg')">
<font size="-1">Yahoo</font>
<input type="radio" name="SITE" value="Yahoo" onclick="setsite('Yahoo')">
</center>
<br>
<center><input type="Text" name="Search" size=40>
</center>
<br>
<center><input name="Submit" type="Submit" value="Search">
</center></form><br>
</div>
<div id="sc2" class="tabcontent">
<script language="JavaScript">
current_site = "Google2"
var set_def = false
function fetch() {
if (set_def == true) {
set_default = "t"
}else{
set_default = ""
}
tmp = document.SearchForm2.Search.value;
stmp = "";
for (i=0 ; i <= tmp.length ; i++) {
if (tmp.charAt(i) == " ") {
stmp = stmp + "+";
} else {
stmp = stmp + tmp.charAt(i);
}
}
if (current_site == "Subs.unacs") {
top.location.href = "http://subs.unacs.bg/search.php?task=Submit&umovie=" + document.SearchForm.Search.value
}
if (current_site == "Subs.sab") {
top.location.href = "http://subs.sab.bz/index.php?act=search&movie=" + document.SearchForm.Search.value
}
if (current_site == "Subtitrite.com") {
top.location.href = "http://subs.sab.bz/index.php?act=search&movie=" + document.SearchForm.Search.value
}
if (current_site == "Subsmania") {
top.location.href = "http://subsmania.com/forum/upload/index.php?act=Search&CODE=simpleresults&sid=9ffad662daaea647a8a5ac4030e4a625&highlite=" + document.SearchForm.Search.value + "&mode=blended&tag=multiz-20"
}
return false;
}
function toggle_setdef() {
set_def = !(set_def);
}
function setsite(sitenow) {
current_site = sitenow;
}
</script>
<center>
<h2></h2>
</center>
<form method="GET" name="SearchForm2" onsubmit="return fetch()">
<center>
<font size="-1">Subs.unacs</font>
<input type="radio" name="SITE" value="Subs.unacs" checked onclick="setsite('Subs.unacs')">
<font size="-1">Subs.sab</font>
<input type="radio" name="SITE" value="Subs.sab" onclick="setsite('Subs.sab')">
<font size="-1">Subtitrite.com</font>
<input type="radio" name="SITE" value="Subtitrite.com" onclick="setsite('Subtitrite.com')">
</center>
<br>
<center><input type="Text" name="Search" size=40>
</center>
<br>
<center><input name="Submit" type="Submit" value="Search">
</center></form><br>
</div>
<div id="sc3" class="tabcontent">
<script language="JavaScript">
current_site = "Google3"
var set_def = false
function fetch() {
if (set_def == true) {
set_default = "t"
}else{
set_default = ""
}
tmp = document.SearchForm3.Search.value;
stmp = "";
for (i=0 ; i <= tmp.length ; i++) {
if (tmp.charAt(i) == " ") {
stmp = stmp + "+";
} else {
stmp = stmp + tmp.charAt(i);
}
}
if (current_site == "Youtube") {
top.location.href = "http://www.youtube.com/results?search_query=" + document.SearchForm.Search.value
}
if (current_site == "Vbox7") {
top.location.href = "http://vbox7.com/search/?offline=1&vbox_q=" + document.SearchForm.Search.value
}
if (current_site == "Metacafe") {
top.location.href = "http://www.metacafe.com/tags/" + document.SearchForm.Search.value
}
if (current_site == "Clip4e") {
top.location.href = "http://clip4e.com/search.php?srchtxt=" + document.SearchForm.Search.value + "&mode=blended&tag=multiz-20"
}
return false;
}
function toggle_setdef() {
set_def = !(set_def);
}
function setsite(sitenow) {
current_site = sitenow;
}
</script>
<center>
<h2></h2>
</center>
<form method="GET" name="SearchForm3" onsubmit="return fetch()">
<center>
<font size="-1">Youtube</font>
<input type="radio" name="SITE" value="Youtube" checked onclick="setsite('Youtube')">
<font size="-1">Vbox7</font>
<input type="radio" name="SITE" value="Vbox7" onclick="setsite('Vbox7')">
<font size="-1">Metacafe</font>
<input type="radio" name="SITE" value="Metacafe" onclick="setsite('Metacafe')">
<font size="-1">Clip4e</font>
<input type="radio" name="SITE" value="Clip4e" onclick="setsite('Clip4e')">
</center>
<br>
<center><input type="Text" name="Search" size=40>
</center>
<br>
<center><input name="Submit" type="Submit" value="Search">
</div>
<div id="sc4" class="tabcontent">
<script language="JavaScript">
current_site = "Google4"
var set_def = false
function fetch() {
if (set_def == true) {
set_default = "t"
}else{
set_default = ""
}
tmp = document.SearchForm4.Search.value;
stmp = "";
for (i=0 ; i <= tmp.length ; i++) {
if (tmp.charAt(i) == " ") {
stmp = stmp + "+";
} else {
stmp = stmp + tmp.charAt(i);
}
}
if (current_site == "WikiBG") {
top.location.href = "http://bg.wikipedia.org/wiki/Специални:Търсене?search=" + document.SearchForm.Search.value
}
if (current_site == "Wiki") {
top.location.href = "http://en.wikipedia.org/wiki/" + document.SearchForm.Search.value
}
if (current_site == "Subtitrite.com") {
top.location.href = "http://subs.sab.bz/index.php?act=search&movie=" + document.SearchForm.Search.value
}
if (current_site == "Subsmania") {
top.location.href = "http://subsmania.com/forum/upload/index.php?act=Search&CODE=simpleresults&sid=9ffad662daaea647a8a5ac4030e4a625&highlite=" + document.SearchForm.Search.value + "&mode=blended&tag=multiz-20"
}
return false;
}
function toggle_setdef() {
set_def = !(set_def);
}
function setsite(sitenow) {
current_site = sitenow;
}
</script>
<center>
<h2></h2>
</center>
<form method="GET" name="SearchForm4" onsubmit="return fetch()">
<center>
<font size="-1">WikiBG</font>
<input type="radio" name="SITE" value="WikiBG" checked onclick="setsite('WikiBG')">
<font size="-1">Wiki</font>
<input type="radio" name="SITE" value="Wiki" onclick="setsite('Wiki')">
</center>
<br>
<center><input type="Text" name="Search" size=40>
</center>
<br>
<center><input name="Submit" type="Submit" value="Search">
</center></form><br>
</div>
</DIV>
<script type="text/javascript">
//Dynamicdrive.com persistence feature add-on
var enablepersistence=true //true to enable persistence, false to turn off (or simply remove this entire script block).
var persisttype="local" //enter "sitewide" for Tab content order to persist across site, "local" for this page only
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function savetabstate(){
var cookiename=(persisttype=="sitewide")? "tabcontent" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? tabsourceindex+"|"+previoustab+";path=/" : tabsourceindex+"|"+previoustab
document.cookie=cookiename+"="+cookievalue
}
window.onunload=savetabstate
</script>
</div>
</body>
</html>