﻿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... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...',
                      url: "/ams/uc/memberdirectory/render.ashx",
                      title: { text: 'Member Details', button: 'Close' }, 
                      data: { c: 'memberInfo', i: $(this).attr('title'), ct: '3' } 
                        
                        },
                      show: { when: 'click', solo: true },
                      hide: { when: { event: 'unfocus' } }, 
                      position: {
                          corner: {
                              target: 'topMiddle',
                              tooltip: 'bottomMiddlet'
                          }
                      },
                      style: {
                          title: { 'font-size': 11, 'font-weight': 'bold', 'padding': 3 }, 
                          tip: 'bottomMiddle',
                          width: 'auto',
                          name: 'light', // Inherit from preset style
                          border: {
                              width: 2,
                              radius: 3,
                              color: '#185184'
                          }
                      }
                  }
                  );
                  // turn off href if we get this far
                  $(this).attr("href", "javascript:void (0)");
                  $(this).attr("target", "_self");
              });


});
