﻿function newWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}
 
function newWindowQuick(theURL, myWidth, myHeight) { 
	var winName = "newWindowQuick"
	var isCenter = 'true'
	var features = 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes'
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function logOut() {
	bodyTags = document.getElementsByTagName("body");
	bodyTags[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	var agree = confirm("Are you sure you wish to logout?");
	if (agree) {
	   return true;	
	} else {
		bodyTags[0].style.filter = "";
		return false;
	}
}
 
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function toggleElementDisplay(theElementID) {
	var theElement = document.getElementById(theElementID);	
	var displayStyle = theElement.style.display
	if (displayStyle == '') {
		theElement.style.display = "none";
	} else {
		theElement.style.display = "";
	}
}

$(document).ready(function() {
    // get keyword text from data source
    //var tip = getKeywordText($(this), kw);
    // Create content using url as base
    //var kw = jQuery.trim($(this).html());
    $("div#forum div.forumAuthor a").each(function() {
        $(this).qtip(
                  {
                    content: {
                        text: "loading...",
                        ajax: { url: $(this).attr('href'), data: { c: 'memberInfo', i: $(this).attr('title'), ct: '3' } },
                        title: {
                            text: 'Member Details', // Give the tooltip a title using each elements text
                            button: true
                        }
                    },
                    show: {
                        solo: true,
                        event: "click"
                    },
                    hide: {
                        event: "click"
                    },
                    position: {
                        at: "top center",
                        my: "bottom center",
                        adjust: { screen: true} // Keep the tooltip on-screen at all times
                    },
                    style: {
                        tip: "bottomMiddle",
                        classes: "ui-tooltip-light centergy-ajax-box"
                    }
                })

        // turn off href if we get this far
        .click(function () { return false; });
    });

});

