/*
 STK Stars template
 Copyright (C) 2010, Nicolas Cardoso De Castro
 Contact the author: nicolas.cardoso AT altaum.com
 Author's website: <http://www.altaum.com>

 This template is provided under the terms of the Creative Commons Public
License BY-SA. The legal code of the license is available at
<http://creativecommons.org/licenses/by-sa/3.0/legalcode>. This template is
protected by copyright and/or other applicable law. Any use of this template
other than as authorized under this license or copyright law is prohibited.
 By exercising any rights to the template provided here, you accept and agree to
be bound by the terms of this license. To the extent this license may be
considered to be a contract, the licensor grants you the rights contained in the
legal code in consideration of your acceptance of such terms and conditions.
 
 STK Stars template is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

 This template is derived for the Content Manager WebsiteBaker
<http://www.websitebaker.org/> (Copyright (C) 2004-2009 Ryan Djurovich,
Copyright (C) 2009-2010 Website Baker Org. e.V.) WebsiteBaker is free software;
you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version. A copy of the GNU General
Public License is available at
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>.
*/

function toggleColDesc(actionType, iconName, displayType){
	// Set display type to 'inline' by default (other type is 'block')
	displayType = typeof(displayType) != 'undefined' ? displayType : 'inline';
	
	// If the mouve is over, display the description, otherwise, hide it
	if(actionType == 'mouseOver'){
		document.getElementById("col"+iconName+"Text").style.display=displayType;
	}
	else{
		document.getElementById("col"+iconName+"Text").style.display='none';
	}
}

function submitSearch(search_translation){
	if(document.getElementById("search_field").value != search_translation){
		document.form_search.submit();
	}
	return false;
}

function clickOnSearch(search_translation){
	// Only perform action if search field is at default value
	if(document.getElementById("search_field").value == search_translation) {
		document.getElementById("search_field").value = ""; // Erase search field value
		jQuery('.search_field').css('font-style', 'normal'); // Put text style to normal
	}
}

function deleteSearchField(search_translation){
	document.getElementById("search_field").value = search_translation; // Restore search field value
	jQuery('.search_field').css('font-style', 'italic'); // Restore italic style
}
