function toggle(id) {
var toggleit = document.getElementById(id);
if(toggleit.style.display == '')
toggleit.style.display = 'none';
else
toggleit.style.display = '';
}

function remCart() { var answer = confirm("Are you sure you want to remove this item from your cart?"); if (answer){ } else{ return false; }}
function emptyCart() { var answer = confirm("Are you sure you want to empty your cart?"); if (answer){ } else{ return false; }}

$(document).ready(function(){

$('.brwseImage img').each(function() { $(this).qtip( { content: { text: 'Loading...', title: { text: 'More options', button: '(x)' } }, api: { onRender: function() { var url = this.elements.target.attr('alt'); if (url != '') { this.loadContent(url); } }, onContentLoad: function() { this.elements.target.attr('alt', ''); } }, position: { corner: { target: 'center', tooltip: 'leftMiddle' }, adjust: { screen: true, x: 50 } }, hide: { fixed: true}, style: { width: 225, padding: 5, button: { 'color': '#333333', 'font-weight': 'bold' }, tip: 'bottomLeft', name: 'cream' } }); });
   
$('.actHead a[href][title]').qtip({ content: { text: false }, position: { corner: { target: 'topMiddle', tooltip: 'bottomLeft'}, adjust: { screen: true} }, style: {width: 200, tip: 'bottomMiddle', name: 'light', color: 'black', border: { width: 1, radius: 1, color: '#aaa'}}});

$('.members [title]').qtip({ content: { text: false }, position: { corner: { target: 'topMiddle', tooltip: 'bottomLeft'}, adjust: { screen: true} }, style: {width: 150, tip: 'bottomMiddle', name: 'light', color: 'black', border: { width: 1, radius: 1, color: '#aaa'}}});
$('.general [title]').qtip({ content: { text: false }, position: { corner: { target: 'leftMiddle', tooltip: 'rightMiddle'}, adjust: { screen: true} }, style: {'font-size': 12, width: 200, tip: 'bottomMiddle', name: 'dark', color: 'white', border: { width: 1, radius: 1, color: '#aaa'}}});

$("#chkForm").validate({errorElement: "em", errorPlacement: function(error,element) { error.appendTo(element.prev());}})
$('#chkForm input').each(function(){ if(!$(this).attr('title')){ return; } $(this).qtip({ content: { text: false }, position: { corner: { target: 'leftMiddle', tooltip: 'rightMiddle'}, adjust: { screen: true} }, show: {	when: { event: 'focus' } }, hide: {	when: { event: 'blur' } }, style: {width: 150, tip: 'bottomMiddle', name: 'dark'} }); });

//$("#stdForm").validate({errorElement: "em", errorPlacement: function(error,element) { error.appendTo(element.prev());}})
$("#stdForm").validate();
	
if (jQuery.browser.msie === true) { jQuery('input') .bind('focus', function() { $(this).addClass('ieFocusHack'); }).bind('blur', function() { $(this).removeClass('ieFocusHack'); }); }

if (jQuery.browser.msie === true) { jQuery('textarea') .bind('focus', function() { $(this).addClass('ieFocusHack'); }).bind('blur', function() { $(this).removeClass('ieFocusHack'); }); }

function formatItem(row) {return row[0];}
function formatResult(row) {return row[0].replace(/(<.+?>)/gi, '');}
$("#ac_a").autocomplete("1.php?p=search_auto&s=1", { delay:10, width:273, minChars:3, matchSubset:1, matchContains:1, cacheLength:10, max:20, scrollHeight: 220, formatItem:formatItem, selectFirst: false, formatResult: formatResult, autoFill:false });
$("#ac_a").result(function(event, data, formatted) { if (data) $(this).parent().next().find("input").val(data[1]);});
$("#clear").click(function() { $(":input").unautocomplete(); });
$("#ac_a").Watermark("eg: hobbies, boat or printing ...");

}); //endReadyFunc

function changeOptions(){ $("#ac_a").setOptions({ extraParams: { cOpt: function() { return $('input[name=cOpt]:checked').val(); }} });}


