// JavaScript Document
function gotogoogle() {
if (document.myform.q.value=='' || document.myform.q.value=="Type what you're looking for then choose the site to search") 
{
window.open('http://www.google.com.au/');return false;
}
else
{
return true;
}
}
function gotowiki() {
if (document.myform.q.value=='' || document.myform.q.value=="Type what you're looking for then choose the site to search") 
{
window.open('http://en.wikipedia.org/wiki/Main_Page');return false;
}
else
{
return true;
}
}
function gotoebay() {
if (document.myform.q.value=='' || document.myform.q.value=="Type what you're looking for then choose the site to search") 
{
window.open('http://www.ebay.com.au/');return false;
}
else
{
return true;
}
}
function gotoyoutube() {
if (document.myform.q.value=='' || document.myform.q.value=="Type what you're looking for then choose the site to search") 
{
window.open('http://www.youtube.com/');return false;
}
else
{
return true;
}
}
function gotomap() {
if (document.myform.q.value=='' || document.myform.q.value=="Type what you're looking for then choose the site to search") 
{
window.open('http://maps.google.com.au/?hl=en&source=mynthe&q=');return false;
}
else
{
return true;
}
}
function gotoimg() {
if (document.myform.q.value=='' || document.myform.q.value=="Type what you're looking for then choose the site to search") 
{
window.open('http://www.google.com.au/imghp?hl=en&source=mynthe');return false;
}
else
{
return true;
}
}
function search () {
    searchterm=document.myform.q.value;
    document.googlesearch.q.value=searchterm;
    document.wikisearch.search.value=searchterm;
    document.ebaysearch.satitle.value=searchterm;
    document.youtubesearch.search_query.value=searchterm;
    document.gimages.q.value=searchterm;
    document.gmaps.q.value=searchterm;
    return true;
}
function trylogin() {
if (document.login.username.value=='') 
{
return false;
}
else if (document.login.password.value=='') 
{
return false;
}
else
{
return true;
}
}

$(document).ready(function(){
$("area[rel^='prettyPhoto']").prettyPhoto();
$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook',autoplay_slideshow: false,allow_resize:false,default_width: 520,default_height: 520,keyboard_shortcuts: false,social_tools:false});
});

$(function(){
$('.dragbox')
.each(function(){
$(this).hover(function(){
$(this).find('h2').addClass('collapse');
}, function(){
$(this).find('h2').removeClass('collapse');
})
.find('h2').click(function(){
$(this).siblings('.dragbox-content').toggle();
})
.end()
});
});

$(function() {
$("#tags").blur(function() {
$.post("../search/addterm.php",{ searchterm:$(this).val() });
});
});
