////////////////////////////////////////////////////////////////////////////////
var _HOME = window.location.host+'/1_DEV/_COMMUNITY_CONNECT/'; // :: Root URL of App ::
var _ROUTE_ARG = 'rt'; // :: The _GET argument for the View Route ::
var _ROUTE_INIT = '?'+_ROUTE_ARG+'='; // :: The _GET argument for the View Route ::
var _SPLITTER = '@@@'; // :: string to demlimit data strings with. ie: use in split( _SPLITTER_ ) / explode( _SPLITTER_, .. ) ::

//:: Vistor Profile Settings :  :::::::::::::::::::::::::
//var visitorProfileCookie = 'visprof';
//var _COOKIE_SEPR = '|'; //:: Cookie 'intra' Value seperator ::

////////////////////////////////////////////////////////////////////////////////
$(document).ready(function(){
  
  //:::::::::::::::::::::::::::::::::::::::::::::::::::::
  //:: Replace all Title Attributes with qTip Tooltips ::
  //$('.qtip[title]').qtip({ style: { width: 400, background: '#e5e5e5', color: '#555', border: { width: 1, radius: 2, color: '#bbb' }, tip: true }, position: { adjust: { screen: true  } } });
  $('.qtip[title]').each( function( ) {
    if( $( this ).attr( 'href' ) != '#' ) { 
      var title = $( this ).attr( 'title' );
      $( this ).attr( 'title', title + '<br /><br /><i><b>[!: </b> Click the Icon for more help on this topic.<b>]</b></i>' );
      $( this ).click( function( ) { window.open( $( this ).attr( 'href' ).replace( '#', '&popup&hid=' ), 'qtip_window', 'width=600,height=300,scrollbars=1,resizable=1,status=1' ); return false; } );
    }
    $( this ).qtip({ style: { width: 400, background: '#fefefe', color: '#555', border: { width: 1, radius: 2, color: '#bbb' }, tip: true }, position: { adjust: { screen: true  } } });
  });
  
  //:: Superfish Menu ::
  //$('ul.sf-menu').superfish({ delay: 1000, animation: { opacity: 'show', height: 'show'}, speed: 'fast' }); 

});

//////////////////////////////////////////////////////
function jQToggleDisplay( id ) {
	var el = $( '#' + id ); 
	if ( el )	{
    if( el.is(':hidden') ) 
      { el.show( 'fast' ); } else
      { el.hide( 'fast' ); }
  }    
	return false;
} // -- function jQToggleDisplay( id ) {
//////////////////////////////////////////////////////
function jQToggleDisplayObj( obj ) { if ( obj )	{alert(obj.attr( 'class' ));  if( obj.is(':hidden') ) { obj.show( 'fast' ); } else { obj.hide( 'fast' ); } } return false; }
 
//////////////////////////////////////////////////////////////////
function isDefined( variable ) { return ( !( !( variable || false ) ) ); }
//////////////////////////////////////////////////////////////////
function isNumeric( variable ) { return !isNaN( parseInt( variable ) ); }



//////////////////////////////////////////////////////
var _GET = new Array( );
//////////////////////////////////////////////////////
//--Store Request Parameters in an Array
if( window.location.href.indexOf( '?' ) != -1 ) {
  var argArray=window.location.href.split("?")[1].split("&");
  if( argArray.length != 0 ) {
    var argNum = argArray.length;
    var arg;
    for( ai = 0; ai < argNum; ai ++ ) {
      args = argArray[ai].split("=");
      _GET[ args[0] ] = args[1];
    } //--for( ai = 0; ai < argNum; ai ++ ) {
  }
} // -- if( window.location.indexOf( '?' ) ) {

//////////////////////////////////////////////////////////////////////////////////////////////////////////
jQuery.cookie = function( cookieName, cookieValue, cookieExpireDays, cookiePath ) {
  //:::::::::::::::::::::::::::
  if ( typeof cookieValue != 'undefined' ) {
    //:: SET COOKIE ::::::::::::::::::::::::::::
    var expireDate = new Date( );
    cookieExpireDays = ( typeof cookieExpireDays == 'undefined' ? 9999 : cookieExpireDays );
    expireDate.setDate( expireDate.getDate( ) + cookieExpireDays ); //cookieExpireDays );
    //document.cookie = cookieName + "=" + escape( cookieValue ) + ( ( cookieExpireDays == null ) ? "" : ";expires=" + expireDate.toUTCString( ) );
    document.cookie = cookieName + "=" + encodeURIComponent( cookieValue ) + ( cookieExpireDays == null ? "" : ";expires=" + expireDate.toUTCString( ) ) + ( cookiePath == null ? "" : ";path=" + cookiePath );    
  } else {
    //:: GET COOKIE ::::::::::::::::::::::::::::
    if( document.cookie.length > 0 ) {
      c_start = document.cookie.indexOf( cookieName + "=" );
      if(c_start != -1 ) {
        c_start = c_start + cookieName.length + 1;
        c_end = document.cookie.indexOf( ";", c_start );
        if( c_end == -1 ) c_end = document.cookie.length;
        //return unescape( document.cookie.substring( c_start, c_end ) );
        return decodeURIComponent( document.cookie.substring( c_start, c_end ) );
      } //:: 
    } //:: 
    return "";      
  } //::   
}; //:: jQuery.cookie = function( ...




