function check()
{
  document.form1.option1.value ="2";
  document.form1.option.value ="1";
  document.form1.WordForm.value ="1";
 // return checkselection(); 

//checking for empty string
if (document.form1.searchtext.value == "")
    { alert("A Search String must be specified."); return false; }

//selecting actions


if(document.form1.dg.checked == true)
{

document.form1.action="http://www.alwaraq.net/Core/dg/dg_search";
document.form1.option1.value ="2";

}
else if (document.form1.exlib.checked == true)
{

document.form1.action="http://www.alwaraq.net/Core/ExLib/booksearch";

}
else if ((document.form1.author.checked == true)||
(document.form1.bookname.checked == true))
{

document.form1.action="http://www.alwaraq.net/Core/ExLib/TitlesSearchAll?begin=0";

}

else if (document.form1.qr.checked == true)
{
 

//alert("quran action-http://www.alwaraq.net/Core/AlwaraqSrv/QuranSrchAll");
document.form1.action="http://www.alwaraq.net/Core/AlwaraqSrv/QuranSrchAll" ;
  

}

else 
{
 
//alert("booksearch action-http://www.alwaraq.net/searchserver/booksearch");

document.form1.action="http://www.alwaraq.net/searchserver/booksearch" ;
 try  {
    form1.book.value = parent.contents.formG.currentbook.value;
       }
  catch(e) {
    form1.book.value = -1 ;
           } 


}
/*
else if (document.form1.qr.checked == true)
{
 


document.form1.action="http://www.alwaraq.net/Core/AlwaraqSrv/QuranSrchAll" ;
  

}

*/



}



function popupPhoto(photoID,width,height)
{
var extra=0;
if(width < 150)
extra=150;

window.open("http://www.civilizationstory.com/tharwat/contents/paintings/popupphoto/popupphoto.php?photoID="+photoID+"&width="+width+"&height="+height+"&textwidth="+(width+extra),"","width="+(width+50+extra)+"px,height="+(height+250)+",toolbar=no,menubar=no,left=50,top=50");
}
function popupquiz()
{

window.open("http://208.109.209.153/alwarraqQuizes",'AlwaraqQuiz','toolbar=no,resizeable=yes,directories=no,menubar=no,scrollbars=yes,width=750,height=600');
} ;


function checkselection()
{
  
  if(document.form1.partialword.checked == true && document.form1.idAll.checked == false )
  {
   alert('البحث "مع السوابق و اللواحق" مطبق فقط في المكتبة التراثية .');
   document.form1.wholeword.checked = true;
   return false;
  }

} ;
function LowBar()
{
parent.bottom3.location="http://www.alwaraq.net/fr_p_1_4_2_04.htm";
}

function OpenDateWin()
{
window.open("../../HistoryConverter.htm", "HelpWindow","width=410,height=400,resizable=no,scrollbars=yes");
} ;

function leapto() {
var myindex=dest.selectedIndex; 
str = new String(dest.options[myindex].value); // value of selection
str2 = new String(dest.options[myindex].id); // id of selection

if(str2== 11|| str2== 12 || str2==6)
window.open(str,"_blank");
else

window.open(str, "_self"); 
myindex = 0; // reset pulldown menu
}