function do_search(){
	var val = $("#search_textbox").val().replaceAll( " ", "+" );
	window.location = "/index/search/" + val;
}
function clear_text_box(){

	var val = $("#search_textbox").val();
	
	if( val == 'Enter Your Search Phrase' )
		$("#search_textbox").val("");
}
function delete_category( id ){
	if( !confirm( "Delete?" ) ) return;
	window.location = "/index.php/index/admin_delete_cat/" + id;
}
function delete_offer( id ){
	if( !confirm( "Delete?" ) ) return;
	window.location = "/index.php/index/admin_delete_offer/" + id;
}
function delete_image( id ){
	if( !confirm( "Delete?" ) ) return;
	window.location = "/index.php/index/admin_delete_image/" + id;
}
function delete_aff_offer( id ){
	if( !confirm( "Delete?" ) ) return;
	window.location = "/index.php/index/admin_delete_aff_offer/" + id;
}
function delete_mylink( id ){
	if( !confirm( "Delete?" ) ) return;
	window.location = "/index.php/links/member_delete_link/" + id;
}
function admin_list_offer_change_category(el){
	var category_id = $(el).val();
	window.location = "/index.php/index/admin_list_offers/" + category_id;
}
function admin_list_link_change_category(el){
	var category_id = $(el).val();
	window.location = "/index.php/index/admin_list_links/" + category_id;
}
function select_images(image_index){
	window.open( "index.php/index/admin_select_images/" + image_index, "","scrollbars=1,width=550,height=500"  );
}
function add_image_to_parent(id, image_index, src, link){
	window.opener.$("#image_" + image_index).attr( "src", "/" + src );
	window.opener.$("#image_path_" + image_index).attr( "value", id );
	window.opener.$("#image_path_link_" + image_index).attr( "href", "/" + link );
	window.close();
}
function bookmark(){
var title = 'Gonzobaby - Free Offers for You Daily';
var url = 'http://gonzobaby.kindev.org';
   if (document.all)
     window.external.AddFavorite(url, title);
   else if (window.sidebar)
     window.sidebar.addPanel(title, url, "")
   else if (window.sidebar&&window.sidebar.addPanel)
     window.sidebar.addPanel(title,url,"");
}
function onread(){
	var max_height = $('#side_bar').height() > $('#content').height() ? $('#side_bar').height() : $('#content').height();
	var max_height = $('#side_bar_right').height() > max_height ? $('#side_bar_right').height() : max_height;
	max_height += 200;
	$('#main').height( max_height + 58 );
	$('#side_bar').height( max_height  );
	$('#side_bar_right').height( max_height  );
	$('#content').height( max_height  );
	
}
var ready = onread;
