function checkHover(){
	if (obj){
		obj.find('ul').fadeOut('fast');
	}
}

function show(element_id)
{
	document.getElementById(element_id).style.display = 'block';
}

function hide(element_id)
{
	document.getElementById(element_id).style.display = 'none';
}

function toggle(element_id)
{
	if (document.getElementById(element_id).style.display != 'block')
	{
		document.getElementById(element_id).style.display = 'block';
	}
	else
	{	
		document.getElementById(element_id).style.display = 'none';
	}
}

function popup(url, width, height)
{
	window.open(url,'newWin','width=' + width + ',height=' + height + ',toolbar=0,menubar=0,scrollbars=0,resizable=0');
}

function showReplyDiv(commentdiv){
    if(document.getElementById(commentdiv).style.display=='none')
    {
        document.getElementById(commentdiv).style.display='block';
    }
    else if(document.getElementById(commentdiv).style.display=='block')
    {
        document.getElementById(commentdiv).style.display='none';
    }
}
var numOpen=0;

function openWin(siteURL,siteW,siteH,statbar,scrolls){
    if(!scrolls){
        scrolls = 0;
    }
    numOpen++;
    //tmpSite = "" + siteURL;
    tmpSite = siteURL;
    newWin = window.open(tmpSite,"Home" + numOpen,"width=" + siteW + ",height=" + siteH + ",toolbar=0,menubar=0,status=" + statbar + ",scrollbars=" + scrolls + ",resizable=0");
    if(document.layers){
        newWin.resizeTo(siteW,siteH);
    }
}

jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);  
}; 

$(function() {
    $('.rollover').hover(function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    }, function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    });
});

/*
* Auto-Fill Plugin
* Written by Joe Sak
* Website: http://www.joesak.com/
* Article: http://www.joesak.com/2008/11/19/a-jquery-function-to-auto-fill-input-fields-and-clear-them-on-click/
* GitHub: http://github.com/joemsak/jQuery-AutoFill
*/
(function($){
$.fn.autofill=function(options){
var defaults={
value:'First Name',
prePopulate:'',
defaultTextColor:"#666",
activeTextColor:"#333"};


var options=$.extend(defaults,options);
return this.each(function(){
var obj=$(this);
var pfield = (obj.attr('type')=='password');
var p_obj = false;
if(pfield){
obj.hide();
obj.after('<input type="text" id="'+this.id+'_autofill" class="'+$(this).attr('class')+'" />');
p_obj = obj;
obj = obj.next();
}

obj.css({color:options.defaultTextColor})
.val(options.value);

obj.focus(function(){
if(obj.val()==options.value){
if(pfield) {
obj.hide();
p_obj.show()
.focus()
}
obj.val(options.prePopulate)
.css({color:options.activeTextColor});
}
})
.blur(function(){
if(obj.val()==options.prePopulate || obj.val() == ''){
obj.css({color:options.defaultTextColor})
.val(options.value);
}
});
if(p_obj && p_obj.length > 0){
p_obj.blur(function(){
if(p_obj.val()==""){
p_obj.hide();
obj.show()
.css({color:options.defaultTextColor})
.val(options.value);
}
});
}
});
};
})(jQuery);
