/*rev:512*/    // check if one is already instantiated
    if (typeof DIALOGIC === 'undefined' || !DIALOGIC) {

        /**
        * The DIALOGIC global namespace object.  If DIALOGIC is already defined, the
        * existing DIALOGIC object will not be overwritten so that defined
        * namespaces are preserved.  
        */

        /*global DIALOGIC*/
        // Make our object
        DIALOGIC = {
            version: '1.0'
        };
    }
if(typeof(DIALOGIC) == 'undefined')
{
    DIALOGIC = {base: 'www.dialogic.com'};
}
else
{
    DIALOGIC.base = 'www.dialogic.com';
}
/**  
* 'load' namespace. Contains functions that allow us to load external assets that jQuery doesn't handle.
*/

DIALOGIC.load = {
    /**  
    * Load a css file into the page. It verifies if a link tag already exists with the same href.
    * @param url: the css file to load
    * @param media: media attribute of the link tag
    */
    css: function (url, /*optional*/ media) {
        // We are preventing loading a file already loaded
        if ($('link[href=' + url + ']').length > 0 ) { 
			return;
		}

        // Optional parameters check
        var _media = media === undefined || media === null ? "all" : media;
        
        $('<link>').appendTo('head').attr({
            rel: 'stylesheet',
            type: 'text/css',
            media: _media,
            href: url
        });
    }
};

/** 
* Create function in the global DIALOGIC scope.
* It is necessay to create these functions in this scope so that the callback function can see them
*/
DIALOGIC.reloadMe = function(){
	if (DIALOGIC.renderLogin.defaults.redirect != '')
	{
		location.href = DIALOGIC.renderLogin.defaults.redirect;
	}
	else
	{
		location.reload();
	}
};
/** 
* renderLogin creates a login and registration link on the page.
* The login link will make an Ajax call (JSONP) to the authentication page.
* The returned json data object contains the following members:
    -fname: the logged in user's first name
    -lname: the logged in user's last name
    -returnUrl:  if not empty, the page to redirect to after succesful login
    -error: if not empty, the error message to display to the user in #dialog-form .msg
	-msg: if not empty, a message to display to the user in #dialog-form .msg
*/
DIALOGIC.renderLogin = function(options){
	var D = DIALOGIC;
	var Drd = D.renderLogin.defaults;
    // extend the defaults with passed object
	var opts = $.extend(true, Drd, options);
	// init called below
    var init = function(){
	
        // check if the element to prepend login exists
        if ($(opts.prependTo).length === 0){
            opts.prependTo = 'body';
        }
		// check if login widget is already there
        // if it's not there we generate it dynamically
        var $loginw = $('.' + opts.container);
		if ($loginw.length === 0) {
			opts.container = 'loginw';
			$(opts.prependTo).prepend('<div class="' + opts.container + '" style="display:none"><a class="loginlink" href="">Login</a> | <a class="register" href="https://' + D.base + '/profile/register.htm?ReturnURL=' + location.href + '">Register</a></div>');
            $loginw = $('.' + opts.container);
			$loginw.css(Drd.position);
		}
        // check if login form is already there
        // if it's not there we generate it dynamically
		if ($('#dialog-form').length === 0)
		{
			$dialogForm = $('<div id="dialog-form" title="" style="display:none">' +
			'<div class="msg">&nbsp;</div>' +
			'<form action="' + opts.url + '" method="post" name="dialoglform" id="dialoglform">' +
					'<label for="loginid">Email/Username</label><input type="text" name="loginid" id="loginid" value="" class="text ui-widget-content ui-corner-all" /><label for="password">Password</label><input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />' + 
                    '<div><input type="checkbox" id="remlogin" name="remlogin" /><label for="remlogin"> Remember my login</label></div>' +
                    '<div style="display:none;"><input type="checkbox" id="rempass" name="rempass" /><label for="rempass"> Remember my password</label></div>' +
					'<input type="hidden" name="redirect" value="' + opts.redirect + '" />' +
					'<div style="margin-top:10px;"><a href="https://' + D.base + '/profile/forgot-my-password.htm?ReturnURL=' + location.href + '" >Forgot My Password</a> | <a class="reg" href="https://' + D.base + '/profile/register.htm?ReturnURL=' + location.href + '">Register</a></div>' +
			'</form>' + 
			'</div>').appendTo ($('body'));	
	
			// 1. cookie content to javascript object TODO move this to DIALOGIC.min.js
			var cookie = {};
			
			if ($.cookie ('saveAuth'))
			{
				var toks = $.cookie ('saveAuth').split ('&');
			
				for (var i in toks)
				{
					var sep = toks[i].indexOf ('=');
					var attr = toks[i].substr (0, sep);
					var val = toks[i].substr (sep + 1);

					cookie[attr] = val;
				}
			}

			// 2. remember options handling
			$('#remlogin').click (function ()
			{
				if ($(this).attr ('checked'))
					$('#rempass').parent ().slideDown ('fast');
				else
				{
					$('#password').val ('');
					$('#rempass').attr ('checked', null);
					$('#rempass').parent ().slideUp ('fast');
				}
			});

			$('#rempass').click (function ()
			{
				if (! $(this).attr ('checked'))
				{
					$('#password').val ('');
				}
			});

			// 3. previous state restore from cookie
			if (cookie.l)
			{
				$('#loginid').val (cookie.l);
				$('#remlogin').attr ('checked', 'checked');
				$('#rempass').parent ().css ('display', 'block');
			}

			if (cookie.p && ! isNaN (parseInt (cookie.pl)))
			{
				var holder = '';

				var i = cookie.pl;
				while (i > 0)
				{
					holder += '*';
					
					-- i;
				}

				$('#password').val (holder);
				$('#rempass').attr ('checked', 'checked');
			}
		}
		
		// attach click event to login button
		$('.loginlink').click(function(){
			$dialogForm.dialog('open');
			$('#loginid').focus();
			return false;
		});
		
		$dialogForm.dialog({
			autoOpen: false,
			dialogClass: 'dialogloginw',
			width: 400,
			position: 'center',
			modal: false,
			buttons: {
				// clicking the Login button launches the ajax function below
				// hitting Enter while in the form 
				'Login': function() {
					if($('#dialoglform').validate().form()) {

						var datas = {
							'loginid' : $('#loginid').val(), 
							'password' : $('#password').val (),
							'remlogin' : $('#remlogin').attr ('checked'),
							'rempass' : $('#rempass').attr ('checked'),
							'ajax' : 1,
							'r' : opts.role
						};

						if (cookie.p && $('#rempass').attr ('checked'))
						{
							datas.password = cookie.p;
							datas.enc = 1;
						}

						setLoginButtons.processing();
						
						$.ajax({
							url: opts.url,
							dataType: 'jsonp',
							type: 'GET',
							data: datas,
							error: function (XMLHttpRequest, textStatus, errorThrown) {
								$('#dialog-form .msg').append('<div class="error">A communication error occured.<br /> ' + textStatus + '</div>');
                                setLoginButtons.login();
							},
							/**
							 * This method will be called by the Ajax callback.
							 * If there is an error, the error message will be displayed, otherwise the DIALOGIC.renderLogin.defaults.successMessage will be displayed.
							 * @param  d the root json object returned by the server.
							 *           d contains the following members:
							 *				-fname: the logged in user's first name
							 *				-lname: the logged in user's last name
							 *				-returnUrl:  if not empty, the page to redirect to after succesful login
							 *				-msg: if not empty, the additional message to display to the user when successfully logged in #msg
							 *				-error: if not empty, the message to display to the user in #msg
							 */
							success: function(d){
								if (d.error != ''){
									$('#dialog-form .msg').html('<div class="error">' + d.error + '</div>');
									setLoginButtons.login();
								}
								else
								{
									var msg = eval(Drd.successMessage);
									$('#dialoglform').hide('fast');
									$dialogForm.find('.msg').html('<div class="loginsuccess">' + msg + '</div>').show('fast');
									setLoginButtons.reload();
									setTimeout ( D.reloadMe, Drd.reloadTime );
								}
							}
						});
					}
					else
					{
						$('#dialoglform').validate();
					}
				},
				'Cancel': function() {
					$(this).dialog('close');
                    setLoginButtons.login();
				}
			}
		});
        
		/** 
        * Used to change the button states of the two buttons of the login popup.
		* We can then call the nested functions which will have the variables buttons, button0, button1 and msg in scope for easy use.
        * setLoginButtons.login() creates the first state with the Cancel and Login buttons
        * --> this function executes itself on first step through!
        */
		var setLoginButtons = function(){
			var buttons = $('.dialogloginw .ui-dialog-buttonpane').children('button');
			var buttons0 = $(buttons[0]);
			var buttons1 = $(buttons[1]);
			var msg = $('#dialog-form .msg');
            // make the buttons icon buttons
			buttons.removeClass('ui-button-text-only').addClass('ui-button-text-icon');
            buttons0.append("<span class='ui-icon ui-icon-check'></span>");
            buttons1.append("<span class='ui-icon ui-icon-close'></span>");
            
			return	{
                //  two buttons, both enabled
				login : function() {
					buttons0.attr('disabled','');
					buttons0.find('span').removeClass('ui-icon-transfer-e-w').addClass('ui-icon-check').text('Login');
				},
                // two buttons, first button disabled while awaiting server response
				processing: function()
				{
					msg.html('Logging in...').show('fast');
					buttons0.attr('disabled','disabled');
					buttons0.find('span').removeClass('ui-icon-check').addClass('ui-icon-transfer-e-w').text('Processing');
				},
                // one button to reload after successful login, remove second button
				reload : function()
				{
					buttons0.attr('disabled','');
					buttons0.find('span').removeClass('ui-icon-transfer-e-w').addClass('ui-icon-refresh').text('Reload');
					buttons1.remove();
					buttons0.unbind();
					buttons0.click(D.reloadMe);
				}
			};
		}(); // executes the function.
		
		// set the starting button state
		setLoginButtons.login();


		// binds the ENTER key to the Login button's click trigger which contains the Ajax call
		$('#dialog-form input').keyup(function(e){ 
			if (e.keyCode == 13) {                         
				$('.ui-dialog-buttonpane button').eq(0).trigger('click'); 
				return false;
			}
			return false;
		});
				
        // we have all we need in place to display the login links
        // show login link with fancy fadeIn to raise awareness of the new functionality
		$loginw.fadeIn('slow');

		// validate signup form on keyup and submit
		// Clicking ENTER on the form passes through this function rather than the Login button click
		var validator = $('#dialoglform').validate({
			rules: {
				loginid: {
					required: true,
					minlength: 4
				},
				password: {
					required: true,
					minlength: 4
				}
			},
			messages: {
				loginid: 
				{
					required: ' invalid',
					minlength: ' invalid, not long enough'
				},
				password: {
					required: ' invalid',
					minlength: ' invalid, not long enough'
				}
			},
			errorClass: 'error',
			validClass: 'checked',
			errorPlacement: function(error, element) {
					element.prev('label').append(error);
			},
			success: function(label) {
				label.addClass('checked').html('&nbsp;');
			},
			submitHandler: function(){
                
            }
            
		});
	
	},
	
	loadScripts = function(){
		var preloaded = 0;
		var preload = function(){
			preloaded++;
			if (preloaded == Drd.load.length) { 
				init();
			}
		};
		// loop through the files listed in DIALOGIC.renderLogin.defaults.load and load them 
		for (x=0;x<Drd.load.length;x++)
		{
			var f = Drd.load[x];
			if (f.indexOf('.css') > -1)
			{
				D.load.css(f);
				preload();
			}else{
				$.getScript(f, preload);
			}
		}
	};
	
	// load any scripts that are not already there
	if (Drd.loadScripts)
	{
		loadScripts();
	} else {
        // no scripts to load. Call the init method to draw the login
		init();
	}

};

DIALOGIC.renderLogin.defaults = {
    container: 'loginw',
    /**
    * the login url
    */
	url: 'https://' + DIALOGIC.base + '/profile/loginp.htm',
    /**
    * the url to redirect the user to after successful login
    */
    redirect: '',
    /**
    * the amount of time before the page reloads or redirects after successful login
    */
	reloadTime: 4000,
    /**
    * verify if the user has the role specified 
    */
	role: 'Registration',
    /** 
    * the css used to place the 'Login' and 'Register' links. To alter the placement of the login links,
    * you can add or modify the css that will be applied to .loginw
    */
	position: {
		position: 'absolute',
        width: '960px',
        'text-align': 'right',
		top: '8px',
        'right': '50px'
	},
    /**
    * The element that .loginw will be prepended to
    */
    prependTo: 'div.header-holder',
    /**
    * If the page already has the required scripts loaded, set this value to false so that the script does not attempt to load them.
    */
	loadScripts: true,
    /**
    * CSS and JS files required for the script to work. If you wish to load files from another location, alter the items in this array.
    */
	load: [	'//www.dialogic.com/static/css/jquery-ui-1.8.custom.fer.css',
    '//www.dialogic.com/static/js/jq/jquery.validate.min.js',
    '//www.dialogic.com/static/js/jq/ui/js/jquery-ui-1.8.2.custom-login.min.js'],
    /**
    * The text that will be evaluated when the success message is displayed. The string must be within double quotes. Put variables in single quotes.
    */
	successMessage: "'<b>Login successful!</b><br /><br />Welcome ' + d.fname + '  ' + d.lname + '.<br /><br />This page will reload in ' + (DIALOGIC.renderLogin.defaults.reloadTime/1000) + ' seconds.<br /><br />'",
    /**
    * The text that will be evaluated when the success message is displayed. The string must be within double quotes. Put variables in single quotes.
    */
	successRedirectMessage: "'<b>Login successful!</b><br /><br />Welcome ' + d.fname + '  ' + d.lname + '.<br /><br />You will be redirected in ' + (DIALOGIC.renderLogin.defaults.reloadTime/1000) + ' seconds.<br /><br />'"
};
/*
 * jqModal - Minimalist Modaling with jQuery
 *   (http://dev.iceburg.net/jquery/jqModal/)
 *
 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 * 
 * $Version: 03/01/2009 +r14
 */
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 50,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};

$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};

$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
 if(c.modal) {if(!A[0])L('bind');A.push(s);}
 else if(c.overlay > 0)h.w.jqmAddClose(o);
 else o=F;

 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
 if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}

 if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
  r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
 else if(cc)h.w.jqmAddClose($(cc,h.w));

 if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);	
 (c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
 if(A[0]){A.pop();if(!A[0])L('unbind');}
 if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
 if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
 if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);/* 
 * flowplayer.js 3.1.4. The Flowplayer API
 * 
 * Copyright 2009 Flowplayer Oy
 * 
 * This file is part of Flowplayer.
 * 
 * Flowplayer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Flowplayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Date: 2009-02-25 21:24:29 +0000 (Wed, 25 Feb 2009)
 * Revision: 166 
 */
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.substring(0,q)||"*";var o=s.substring(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).substring(2,10)}var h=function(t,r,s){var q=this;var p={};var u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.substring(0,v.length-1);var w="onBefore"+v.substring(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var s={};var o=this;var u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var y=q._api().fp_getPlugin(p);if(!y){return}i(o,y);delete o.methods;if(!u){m(y.methods,function(){var A=""+this;o[A]=function(){var B=[].slice.call(arguments);var C=q._api().fp_invoke(p,A,B);return C==="undefined"||C===undefined?o:C}});u=true}}var z=s[w];if(z){z.apply(o,v);if(w.substring(0,1)=="_"){delete s[w]}}}})};function b(o,t,z){var E=this,y=null,x,u,p=[],s={},B={},r,v,w,D,A,q;i(E,{id:function(){return r},isLoaded:function(){return(y!==null)},getParent:function(){return o},hide:function(F){if(F){o.style.height="0px"}if(y){y.style.height="0px"}return E},show:function(){o.style.height=q+"px";if(y){y.style.height=A+"px"}return E},isHidden:function(){return y&&parseInt(y.style.height,10)===0},load:function(F){if(!y&&E._fireEvent("onBeforeLoad")!==false){m(a,function(){this.unload()});x=o.innerHTML;if(x&&!flashembed.isSupported(t.version)){o.innerHTML=""}flashembed(o,t,{config:z});if(F){F.cached=true;j(B,"onLoad",F)}}return E},unload:function(){if(x.replace(/\s/g,"")!==""){if(E._fireEvent("onBeforeUnload")===false){return E}try{if(y){y.fp_close();E._fireEvent("onUnload")}}catch(F){}y=null;o.innerHTML=x}return E},getClip:function(F){if(F===undefined){F=D}return p[F]},getCommonClip:function(){return u},getPlaylist:function(){return p},getPlugin:function(F){var H=s[F];if(!H&&E.isLoaded()){var G=E._api().fp_getPlugin(F);if(G){H=new l(F,G,E);s[F]=H}}return H},getScreen:function(){return E.getPlugin("screen")},getControls:function(){return E.getPlugin("controls")},getConfig:function(F){return F?k(z):z},getFlashParams:function(){return t},loadPlugin:function(I,H,K,J){if(typeof K=="function"){J=K;K={}}var G=J?e():"_";E._api().fp_loadPlugin(I,H,K,G);var F={};F[G]=J;var L=new l(I,null,E,F);s[I]=L;return L},getState:function(){return y?y.fp_getState():-1},play:function(G,F){function H(){if(G!==undefined){E._api().fp_play(G,F)}else{E._api().fp_play()}}if(y){H()}else{E.load(function(){H()})}return E},getVersion:function(){var G="flowplayer.js 3.1.4";if(y){var F=y.fp_getVersion();F.push(G);return F}return G},_api:function(){if(!y){throw"Flowplayer "+E.id()+" not loaded when calling an API method"}return y},setClip:function(F){E.setPlaylist([F]);return E},getIndex:function(){return w}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var F="on"+this;if(F.indexOf("*")!=-1){F=F.substring(0,F.length-1);var G="onBefore"+F.substring(2);E[G]=function(H){j(B,G,H);return E}}E[F]=function(H){j(B,F,H);return E}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed").split(","),function(){var F=this;E[F]=function(H,G){if(!y){return E}var I=null;if(H!==undefined&&G!==undefined){I=y["fp_"+F](H,G)}else{I=(H===undefined)?y["fp_"+F]():y["fp_"+F](H)}return I==="undefined"||I===undefined?E:I}});E._fireEvent=function(O){if(typeof O=="string"){O=[O]}var P=O[0],M=O[1],K=O[2],J=O[3],I=0;if(z.debug){g(O)}if(!y&&P=="onLoad"&&M=="player"){y=y||c(v);A=y.clientHeight;m(p,function(){this._fireEvent("onLoad")});m(s,function(Q,R){R._fireEvent("onUpdate")});u._fireEvent("onLoad")}if(P=="onLoad"&&M!="player"){return}if(P=="onError"){if(typeof M=="string"||(typeof M=="number"&&typeof K=="number")){M=K;K=J}}if(P=="onContextMenu"){m(z.contextMenu[M],function(Q,R){R.call(E)});return}if(P=="onPluginEvent"){var F=M.name||M;var G=s[F];if(G){G._fireEvent("onUpdate",M);G._fireEvent(K,O.slice(3))}return}if(P=="onPlaylistReplace"){p=[];var L=0;m(M,function(){p.push(new h(this,L++,E))})}if(P=="onClipAdd"){if(M.isInStream){return}M=new h(M,K,E);p.splice(K,0,M);for(I=K+1;I<p.length;I++){p[I].index++}}var N=true;if(typeof M=="number"&&M<p.length){D=M;var H=p[M];if(H){N=H._fireEvent(P,K,J)}if(!H||N!==false){N=u._fireEvent(P,K,J,H)}}m(B[P],function(){N=this.call(E,M,K);if(this.cached){B[P].splice(I,1)}if(N===false){return false}I++});return N};function C(){if($f(o)){$f(o).getParent().innerHTML="";w=$f(o).getIndex();a[w]=E}else{a.push(E);w=a.length-1}q=parseInt(o.style.height,10)||o.clientHeight;if(typeof t=="string"){t={src:t}}r=o.id||"fp"+e();v=t.id||r+"_api";t.id=v;z.playerId=r;if(typeof z=="string"){z={clip:{url:z}}}if(typeof z.clip=="string"){z.clip={url:z.clip}}z.clip=z.clip||{};if(o.getAttribute("href",2)&&!z.clip.url){z.clip.url=o.getAttribute("href",2)}u=new h(z.clip,-1,E);z.playlist=z.playlist||[z.clip];var F=0;m(z.playlist,function(){var H=this;if(typeof H=="object"&&H.length){H={url:""+H}}m(z.clip,function(I,J){if(J!==undefined&&H[I]===undefined&&typeof J!="function"){H[I]=J}});z.playlist[F]=H;H=new h(H,F,E);p.push(H);F++});m(z,function(H,I){if(typeof I=="function"){if(u[H]){u[H](I)}else{j(B,H,I)}delete z[H]}});m(z.plugins,function(H,I){if(I){s[H]=new l(H,I,E)}});if(!z.plugins||z.plugins.controls===undefined){s.controls=new l("controls",null,E)}s.canvas=new l("canvas",null,E);t.bgcolor=t.bgcolor||"#000000";t.version=t.version||[9,0];t.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function G(H){if(!E.isLoaded()&&E._fireEvent("onBeforeClick")!==false){E.load()}return f(H)}x=o.innerHTML;if(x.replace(/\s/g,"")!==""){if(o.addEventListener){o.addEventListener("click",G,false)}else{if(o.attachEvent){o.attachEvent("onclick",G)}}}else{if(o.addEventListener){o.addEventListener("click",f,false)}E.load()}}if(typeof o=="string"){flashembed.domReady(function(){var F=c(o);if(!F){throw"Flowplayer cannot access element: "+o}else{o=F;C()}})}else{C()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";var i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function j(){if(c.done){return false}var l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var k=0;k<c.ready.length;k++){c.ready[k].call()}c.ready=null;c.done=true}}var c=e?jQuery:function(k){if(c.done){return k()}if(c.timer){c.ready.push(k)}else{c.ready=[k];c.timer=setInterval(j,13)}};function f(l,k){if(k){for(key in k){if(k.hasOwnProperty(key)){l[key]=k[key]}}}return l}function g(k){switch(h(k)){case"string":k=k.replace(new RegExp('(["\\\\])',"g"),"\\$1");k=k.replace(/^\s?(\d+)%/,"$1pct");return'"'+k+'"';case"array":return"["+b(k,function(n){return g(n)}).join(",")+"]";case"function":return'"function()"';case"object":var l=[];for(var m in k){if(k.hasOwnProperty(m)){l.push('"'+m+'":'+g(k[m]))}}return"{"+l.join(",")+"}"}return String(k).replace(/\s/g," ").replace(/\'/g,'"')}function h(l){if(l===null||l===undefined){return false}var k=typeof l;return(k=="object"&&l.push)?"array":k}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function b(k,n){var m=[];for(var l in k){if(k.hasOwnProperty(l)){m[l]=n(k[l])}}return m}function a(r,t){var q=f({},r);var s=document.all;var n='<object width="'+q.width+'" height="'+q.height+'"';if(s&&!q.id){q.id="_"+(""+Math.random()).substring(9)}if(q.id){n+=' id="'+q.id+'"'}if(q.cachebusting){q.src+=((q.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(q.w3c||!s){n+=' data="'+q.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(q.w3c||s){n+='<param name="movie" value="'+q.src+'" />'}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+='<param name="'+l+'" value="'+q[l]+'" />'}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='<param name="flashvars" value=\''+o+"' />"}n+="</object>";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="<h2>Flash version "+q+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(m.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})();
/**  
* @author Claude Berube
* @addon  This is a JQ plugin used to centralize FlowPLayer instanciation
* @constructor override default value with values passed at instanciation
* 
* @param {String} backgroundUrl : used to reset BG image when url passed in instanciation
* @param {String} controls : can be used to reset default value to target a different skin player
* How : Controls are nested : {key :value, controls : {key :value}}
* Use : $("#firstTabPlayer").video({backgroundUrl : "/static/images/newVoice_splash.jpg"});
* A reference can be stored into DIALOGIC namespace.  Use DIALOGIC.thisVideo = $("element").video();
*/
DIALOGIC.players = {}; // stores a reference to each of the players on the page

(function($) {

    $.fn.video = function(options) {
        var defaults = {
            _div: $(this).attr('id'),
            backgroundUrl: "",
            background: "#0E309B url(/static/videos/flowplayer.bg.swf) no-repeat 0pct 0pct",
            plugins: {
                // skin
                controls: {
                    stop: true,
                    autoBuffering: false,
                    durationColor: '#ffffff',
                    progressGradient: 'medium',
                    volumeSliderColor: '#000000',
                    tooltipColor: '#0E309B',
                    sliderGradient: 'none',
                    backgroundGradient: '10',
                    borderRadius: '0',
                    backgroundColor: '#0E309B',
                    bufferGradient: 'none',
                    sliderColor: '#000000',
                    buttonOverColor: '#0090CF',
                    timeBgColor: '#0E309B',
                    timeColor: '#666666',
                    progressColor: '#0090CF',
                    bufferColor: '#0E309B',
                    volumeSliderGradient: 'none',
                    buttonColor: '#0E309B',
                    tooltipTextColor: '#ffffff',
                    height: 20,
                    opacity: 1.0
                }
            },
            _SMILPlugins: {
                // our CDN uses SMIL playlists ..        
                smil: { url: '/static/js/flowplayer/flowplayer.smil-3.1.3.swf' },
                // .. and RTMP streaming
                rtmp: { url: '/static/js/flowplayer/flowplayer.rtmp-3.1.3.swf' }
            },
            _SMILProvider: {
                provider: 'rtmp'
            },

            clip: {
                autoPlay: false,
                autoBuffering: false,
                scaling: 'fit',

                onStart: function(clip) {
					_gaq.push(['_trackEvent', 'Videos', 'Play', clip.originalUrl]);
                },

                onPause: function(clip) {
                    _gaq.push(['_trackEvent', 'Videos', 'Pause', clip.originalUrl, parseInt(this.getTime())]);
                },

                onResume: function(clip) {
                    _gaq.push(['_trackEvent', 'Videos', 'Resume', clip.originalUrl, parseInt(this.getTime())]);
                },

                onStop: function(clip) {
                    _gaq.push(['_trackEvent', 'Videos', 'Stop', clip.originalUrl, parseInt(this.getTime())]);
                },

                onFinish: function(clip) {
                    _gaq.push(['_trackEvent', 'Videos', 'Finish', clip.originalUrl]);
                }
            }
        }
        var isRTMP = $(this).attr('href').indexOf('.smil') > -1 ? true : false;

        /**  
        * JQ extend method overwrites defaults with when passed values or add new values
        * @ options : passed object{key:value}
        * @ default : default skin setup
        * @ _SMILPlugins : adds RTMP facilities to plugins
        * @ _SMILProvider : adds RTMP facilities to clip
        */

        if (isRTMP) {
            $.extend(true, defaults.plugins, defaults._SMILPlugins);
            $.extend(true, defaults.clip, defaults._SMILProvider);
        }
        
        $.extend(true, defaults, options);

        /**  
        * replaces BGimage when passed	- aims to shortens the passed values
        * @ backgroundUrl : BG URL value
        */

        if (defaults.backgroundUrl != "") {
            defaults.background = "#0E309B url(" + defaults.backgroundUrl + ") no-repeat 50pct 50pct";
        };

        /**  
        * @returns a $f object with default values or reset values passed
        * @requires jQuery 1.3, flowPlayer 3.1.4 
        * @param {String} defaults.param
        * Sets video behavior here : key, SWF, delivery, Google analytics, FullScreen, Logo, Canvas 
        */
        var o = {
            key: '#$ed7be423c754867c89f',
            // skin
            canvas: {
                background: defaults.background,
                backgroundGradient: "none"
            },
            logo: {
                url: '/static/images/dialogic_logo_fp.png',
                top: 45,
                right: 5,
                fullscreenOnly: true,
                displayTime: 0,
                opacity: 0.6,
                linkUrl: 'http://www.dialogic.com'
            },
            clip: defaults.clip,
            plugins: defaults.plugins
        }
        
        var f = $f(
            defaults._div,
            {
                src: "/static/js/flowplayer/flowplayer.commercial-3.1.4.swf",
                wmode: 'transparent'
            },
            o
        );
        DIALOGIC.players[defaults._div] = f;
        return f;
    };
})(jQuery);

/**
* Callback method working with jQmodal for video popUp modal
* Takes parameters from URL string
* @requires DIALOGIC namespace > d.debug.js
* @param play, href, width, height. Values passed via DIALOGIC.modal
*/

DIALOGIC.doPopPlayer = function() {

    var m = DIALOGIC.modal;
    var options = { clip: { autoPlay: true} };
    
    // sets clip object to video method - overrides autoPlay defaults params
    if (m.play === "false") {
        options = { clip: { autoPlay: false} };
    }

    try {
		
        $('#popPlayer').attr('href', m.video); // sets both modal popup video types URL
        $('#popPlayer').css("width", m.width + 'px'); // set video dimensions from URL instead of inline CSS for content modal
        $('#popPlayer').css("height", m.height + 'px');
        
        $("#playerContainer").css("height", m.height + 'px'); // set video container dimensions for video only modal
        $("#playerContainer").css("width", m.width + 'px');
        // align videopopup with body of the page
		var pageBody = $("body").width();
        var video = $("#videoPopUp").width();
        var center = parseInt( (pageBody - video)/2);
        $("#videoPopUp").css("margin-left", center)

        // overriding video options with passed params
        $("#popPlayer").video(options);

    }
    catch (e) {
        return false;
    }
} 


/**
* Delegation for setting DIALOGIC.modal properties
* @param (string) str - passes string to be parsed
* @sets DIALOGIC.modal.properties;
* @requires : utils.js - getHashValue method
*/
DIALOGIC.setModalParams = function(str) {
    var params = DIALOGIC.getHashValue(str);
    DIALOGIC.modal = { play: params.play, video: params.video, width: params.width, height: params.height };
    return false; // avoid page swap
}



DIALOGIC.setUpModal = function() {
    $('#videoPopUp').jqm({
        ajax: '@href', 
        trigger: 'a.videoTrigger',
        onLoad: function() {
            DIALOGIC.doPopPlayer();
        },
        onHide: function(h){
            $('#videoPopUp').html("");
            h.w.hide();
            h.o.remove();
        }
    });
}

/** 
* function called for instantiating video from Hero Banner
* Append elements then triggers a click event on <a>
**/
DIALOGIC.callHeroVideo = function(options) {
    var defaults = {
        container : "/include/heroContainer.htm",
        play: "true",
        video : "http://hwcdn.net/c9w4g7p8/fms/corp/Dialogic_FINAL_MASTER-h265-512-high.f4v.smil", 
        width : "640", 
        height : "380"
    }
    $.extend(true, defaults, options); // resets default to passed values

    var link = defaults.container+'?video='+defaults.video+'&play='+defaults.play+'&width='+defaults.width+'&height='+defaults.height;

    if (!DIALOGIC.JqmWindowExists()) { // if not already created 
        $("body").append('<a href="'+link+'" class="videoTrigger heroTrigger"></a>');
        $("body").append('<div class="jqmWindow" id="videoPopUp"></div>');
    }
    else {
        $(".heroTrigger").attr("href", link);
        $("#videoPopUp").show();
    }
    var trigger = $('.heroTrigger');
    trigger.click(function() { // stores href in spacename modal.href to set video parameters on callback
        DIALOGIC.setModalParams($(this).attr('href'));
        return false;
    });
    DIALOGIC.setUpModal();
    trigger.click();
}


/**
* checks if the videoPopup container already exists on the page 
**/
DIALOGIC.JqmWindowExists = function ()
{
	return ($('#videoPopUp').length > 0) ? true : false; 
}

/**
* Inits video modal video 
* It is initted automatically on page load for every element containing the .videoTrigger class.
* @param {String} Video : url of the video with some params below
* @equires DIALOGIC namespace > d.debug.js
* @param play, href, width, height. Values passed via DIALOGIC.modal
**/
$(document).ready(function () {
    var trigger = $('a.videoTrigger');
    if (trigger.length > 0) // Appends popVideo holder & set video triggers 
    {
        if (!DIALOGIC.JqmWindowExists()) $("body").append('<div class="jqmWindow" id="videoPopUp"></div>');
        
        trigger.click(function (){ // stores href in spacename modal.href to set video parameters on callback
            var v = $(this);
            var p = DIALOGIC.getHashValue(v.attr('href'));
            if (typeof(p.video) == 'string' && typeof(p.x) == 'undefined') {
                v.attr( 'href', '/include/heroContainer.htm?video=' + p.video + '&play='+ p.play +'&width=' + p.width + '&height=' + p.height );
            }
            DIALOGIC.setModalParams(v.attr('href'));
            return false;
        });
        DIALOGIC.setUpModal();
    }
    $('a.inlineVideoDisplay').each(function(){ 
        var v = $(this);
        var p = DIALOGIC.getHashValue(v.attr('href'));
        var play = p.play == 'true' ? true : false;
        if (typeof(p.video) == 'string') {
            v.attr( 'href', p.video );
            v.css('width', p.width + 'px'); 
            v.css('height', p.height + 'px');
        }
        $("#" + v.attr('id')).video({ clip: { autoPlay: play} });
    });
});
 


/**
* Inits first tab and apply an onclick behavior on tabs for show/hide behavior.
* Use : adding a CCS display: nons to DIV in HTML page makes it work better. e.g. #tabs1, #tabs1 {display: none}.
* It is initted automatically on pageLoad for every element containing the .tabs-nav class.
**/
$(document).ready(function () {
		if ($("#newtabs").length > 0 && $(".tabHolder").length > 0) { 
		// inits tabs
			$('[id^=tabs]').hide();
			$('[id^=tabs]:first').show();
		// modified from Homepage version in order to not change CSS
			var tabs = $('.tabs-nav li a');
			tabs.click(function () 
			{
				tabs.parent().removeClass('tabs-selected');
				$(this).parent().addClass('tabs-selected');
				$('[id^=tabs]').hide();
				var href = $(this).attr('href');
				$(href).show();
				return false;
			});	
		}

/**
* targets the previous tab show/hide behavior on link click.
* Use : applu class getTab to links with the correct HREF value.  e.g. href=#tabs1.
* It is inited automatically on pageLoad for every element containing the .getTab class.
**/
	
		// Targeting tab feature
		if ($('.getTab').length > 0 ) 
			{
				var getTab = $('a.getTab');
				
				getTab.click(function () 
				{	
				var tab = $(this).attr('href');
				$('.tabs-nav li a[href='+tab+']').click(); // triggers the show/hide tab onclick behavior
				return false;
			});
			}
});


	
	
/**
* *********************************************** *
*                     Utilities                   *
* *********************************************** *
*/

/**
* URL parser to pass configuration parameter into URL
* @ returns an array with key:value pairs from a URL string using ?-& pattern
* Use: get value with args.property object;
* @ param str- the string to parse
*/

DIALOGIC.getHashValue = function (str) {
	var args = {};
    str = str.replace(/&amp;/g, "&");
	// Get Hash
	var hashes = str.slice(str.indexOf('?') + 1).split('&');

	// Splits Hash 
	var pairs = hashes.slice('=');

	// Begin loop through the Hash
	for (var i = 0; i < pairs.length; i++) {

		// Look for "key:value"
		var pos = pairs[i].indexOf("="); 
		// if not found, skip to next
		if (pos === -1) continue;
		// Extract the name
		var argname = pairs[i].substring(0, pos); 
		// Extract the value
		var value = pairs[i].substring(pos + 1); 
		// Store as a property
		args[argname] = unescape(value);
	}
	return args;
}

/**
* Image preloader
* @requires  jQuery 1.3.2, $(document).ready method
* Use: $.preloadImages("http://www.dialogic.com/static/images/lightbox_panel.png");
*/

jQuery.preloadImages = function ()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}

if (typeof (DIALOGIC.utils) == 'undefined')
{
    DIALOGIC.utils = {
		'check_link' : function (_in)
		{
			if (_in.indexOf ('http://') != 0)
			{
				return 'http://' + _in;
			}

			return _in;
		},

		/**
		 * This is a static function that will take an array of objects as input and return a new array containing those of the latter for which the attribute _attr exists and has the value _val
		 *
		 * @static
		 * @argument {[]} _data This is the javascript array containing the objects to filter
		 * @argument {string} _attr This is the attribute to look for
		 * @argument {string} _val This is the value the attribute needs to be equal to in order to output the object
		 * @returns [] This is the new array containing the objects with _attr.toLowerCase () == _val.toLowerCase ()
		 */
		'filter' : function (_data, _attr, _val)
		{
			var selection = [];

			for (var i in _data)
			{
				if (_data[i][_attr] && _data[i][_attr].length)
				{
					for (var j in _data[i][_attr])
					{
						if (_data[i][_attr][j].toLowerCase () == _val.toLowerCase ())
						{
							selection.push (_data[i]);
							break;
						}
					}
				}
				else
				{
					if (_data[i][_attr] && _data[i][_attr].toLowerCase () == _val.toLowerCase ())
					{
						selection.push (_data[i]);
					}
				}
			}

			return selection;
		},

		/**
		 * This is a static function that will take an array of objects as input and return an array containing all distinct values for a specific attribute found in the objects
		 *
		 * @static
		 * @argument {[]} _data This is the javascript array containing the objects to filter
		 * @argument {string} _attr This is the attribute to look for
		 * @returns [] This is the array containing all distinct values for the attribute found in the objects
		 */
		'distinct_attr' : function (_data, _attr)
		{
			var unique = {};
			var out = [];
		
			for (var i in _data)
			{
				if (_data[i][_attr])
				{
					for (var j in _data[i][_attr])
					{
						if (_data[i][_attr][j].length > 0)
						{
							unique[_data[i][_attr][j]] = true;
						}
					}
				}
			}

			for (i in unique)
			{
				out.push (i);
			}
		
			return out;
		},

		/**
		 * This is a class that will change a provided button element while loading, it will:
		 * - disable the button
		 * - change its label for a certain provided text
		 *
		 * @constructor
		 * @argument {$()} $_btn This is the jquery object for the button to modify
		 * @argument {text} _label This is the text that will show up on the disabled button while loading
		 */
		'loading' : function ($_btn, _label)
		{
			var origin = $_btn.html ();
		
			$_btn.css ({'text-align' : 'left'}).attr ('disabled', 'disabled').html (_label + ' ');
			
			dots = 0;

			var interval = setInterval (function ()
			{
				var label = _label + ' ';

				var i = dots;
				while (i > 0)
				{
					label += '.';
					-- i;
				}

				$_btn.css ({'text-align' : 'left'}).html (label);

				if (dots == 5)
				{
					dots = 0;
				}
				else
				{
					++ dots;
				}
			}, 100);

			/**
			 * This is a public method that will rollback the loading modification, should be triggered when the loading process is over
			 *
			 * @public
			 * @member loading
			 * @returns void
			 */
			this.stop = function ()
			{
				clearInterval (interval);

				$_btn.css ({'text-align' : 'center'}).attr ('disabled', null).html (origin);
			}

			return this;
		}
	};
}
/* Ints World menu for IE6 - oterhs work with CSS */
function initPage()
{
	var ul = document.getElementById("nav");
	if (ul)
	{
			var nodes = ul.getElementsByTagName("li");
			for (var i = 0; i < nodes.length; i++)
			{
				nodes[i].onmouseover = function () 
				{
					if (this.className.indexOf("hover" == -1))
					this.className += " hover";
				}
				nodes[i].onmouseout = function ()
				{
					this.className = this.className.replace("hover", "");
				}
			}
		}
}
if (window.attachEvent)
    window.attachEvent("onload", initPage);
	
	if (typeof (DIALOGIC) == 'undefined')
{
    DIALOGIC = {};
}

DIALOGIC.init_audio = function ($_to, _data)
{
	$('a.audio').each (function ()
	{
		$(this).replaceWith ('<object onclick="DIALOGIC.track_audio (\'' + $(this).html () + '\')" type="application/x-shockwave-flash" data="/static/swf/audioplayer.swf" id="audioplayer1" height="24" width="290"><param name="movie" value="/static/swf/audioplayer.swf"><param name="FlashVars" value="playerID=1&amp;bg=0xCDDFF3&amp;leftbg=0x357DCE&amp;lefticon=0xF2F2F2&amp;rightbg=0xa8b400&amp;rightbghover=0xdc7902&amp;righticon=0xF2F2F2&amp;righticonhover=0xFFFFFF&amp;text=0x357DCE&amp;slider=0x357DCE&amp;track=0xFFFFFF&amp;border=0xFFFFFF&amp;titles=' + $(this).html () + '&amp;loader=0xa8b400&amp;soundFile=' + $(this).attr ('href') + '"><param name="quality" value="high"><param name="menu" value="false"><param name="wmode" value="transparent"></object>');
	});
};

DIALOGIC.trackAudio = {};

DIALOGIC.track_audio = function (_title)
{ 
	if (! this.trackAudio[_title])
	{
		this.trackAudio[_title] = false;
	}

	if (! this.trackAudio[_title])
	{
		_gaq.push (['_trackEvent', 'Audio', 'Play', _title]);
		this.trackAudio[_title] = true;
	}
	else
	{
		_gaq.push (['_trackEvent', 'Audio', 'Stop', _title]);
		this.trackAudio[_title] = false;
	}
};


/**
 * @version 1.0
 */
if (typeof (DIALOGIC) == 'undefined')
{
    DIALOGIC = {};
}

/**
 * This is a class making an autocomplete input from a javascript object
 * It requires:
 *
 * - AUTOCOMPLETE.css style content being added to the document
 * - AUTOCOMPLETE.js script content being added to the document
 *
 * - an <input type="text" ... />
 *
 * - a javascript object built according to the following rules:
 * -- property 'v' (required)  holding the value of the option (value submitted by the form)
 * -- property 'l' (required) holding the label of the option (the label in the list)
 * -- property 'c' (optional) holding an array containing child objects built according to the same rules
 * -- each object can have any other properties as the selected option's related object will be accessible through the selected method
 *
 * @constructor
 * @argument {jQuery object} $_to This is the jQuery object containing the <input type="text" ... /> on which the class will apply
 * @argument {Object} _data This is the javascript object containing the parsed data
 */
DIALOGIC.AUTOCOMPLETE = function ($_to, _data)
{
	/**
	 * This is a private RECURSIVE method which will convert an javascript object and its children as a DOM node
	 *
	 * @private
	 * @member AUTOCOMPLETE
	 * @argument {Object} _root This is the javascript object to render
	 * @argument {integer} _level This is the recursion level (or hierarchy level) used for styling purpose
	 * @returns $group, the jquery object containing the newly created DOM node
	 */
	this.populate_group = function (_root, _level)
	{
		var $group = $('<div class="AUTOCOMPLETE_choice group level_' + _level + '"><span style="padding-left:' + (5 + (_level - 1) * 15) + 'px;">' + _root.nl + '</span></div>').bind ('mouseover.AUTOCOMPLETE', function (_e)
		{
			_e.stopPropagation ();
			inst.select ($(this));
		});

		for (var i in _root.c)
		{
			if (_root.c[i].c && _root.c[i].c.length)
			{
				$group.append (inst.populate_group (_root.c[i], _level + 1)); // recursive call
			}
			else
			{
				$group.append ($('<div class="AUTOCOMPLETE_choice"><span style="padding-left:' + (5 + _level * 15) + 'px;">' + _root.c[i].nl + '</span></div>').bind ('mouseover.AUTOCOMPLETE', function (_e)
				{
					_e.stopPropagation ();
					inst.select ($(this));
				}));
			}
		}

		return $group;
	};

	/**
	 * This is a private method for which will 
	 *
	 * @private
	 * @member AUTOCOMPLETE
	 * @argument {Object} _choices This is the recursion level (or hierarchy level) used for styling purpose
	 * @returns $group, the jquery object containing the newly created DOM node 
	 */
	this.populate_hint = function (_choices)
	{
		$hint.html ('');
		var $choice;
		var simple = true;

		for (var i in _choices)
		{
			if (_choices[i].c && data[i].c.length)
			{
				simple = false;

				$hint.append (inst.populate_group (_choices[i], 1));
			}
			else
			{
				$choice = $('<div class="AUTOCOMPLETE_choice"><span>' + _choices[i].nl + '</span></div>').bind ('mouseover.AUTOCOMPLETE', function (_e)
				{
					_e.stopPropagation ();
					inst.select ($(this));
				});

				$hint.append ($choice);
			}
		}

		if (simple && $hint.children ().size () < 10)
		{
			$hint.css ({'height' : $hint.children ().size () * 20 + 'px'});
		}
		else
		{
			$hint.css ({'height' : '200px'});
		}
	};

	this.show_hint = function ()
	{
		$hint.show ();
		
		if (onHintShow)
		{
			onHintShow ();
		}
	};

	this.hide_hint = function ()
	{
		$hint.hide ();
	};
	
	this.hint_is_shown = function ()
	{
		return ($hint.css ('display') != 'none');
	};

	this.build_group = function (_str, _root) 
	{
		var pos;
		var group = jQuery.extend ({}, _root, {'c':[]}); // object copy

		if ((pos = _root.l.toLowerCase ().indexOf (_str)) > -1)
		{
			group.nl = _root.l.substr (0, pos) + '<span class="highlighted">' + _root.l.substr (pos, _str.length) + '</span>' + _root.l.substr (pos + _str.length);
		}
		else
		{
			group.nl = _root.l;
		}
		
		for (var i in _root.c)
		{
			if (_root.c[i].c && _root.c[i].c.length)
			{
				group.c.push (inst.build_group (_str, _root.c[i])); // recursive call
			}
			else if ((pos = _root.c[i].l.toLowerCase ().indexOf (_str)) > -1)
			{
				_root.c[i].nl = _root.c[i].l.substr (0, pos) + '<span class="highlighted">' + _root.c[i].l.substr (pos, _str.length) + '</span>' + _root.c[i].l.substr (pos + _str.length);
				group.c.push (_root.c[i]);
			}
		}

		return group;
	};

	this.build_choices = function (_str)
	{
		choices = [];
		var pos;
		var str = _str.toLowerCase ();

		for (var i in data)
		{
			if (data[i].c && data[i].c.length)
			{
				choices.push (inst.build_group (str, data[i]));
			}
			else if ((pos = data[i].l.toLowerCase ().indexOf (str)) > -1)
			{
				data[i].nl = data[i].l.substr (0, pos) + '<span class="highlighted">' + data[i].l.substr (pos, str.length) + '</span>' + data[i].l.substr (pos + str.length);
				choices.push (data[i]);
			}
		}

		return choices;
	};

	this.select = function ($_choice)
	{
		if ($selected)
		{
			$selected.removeClass ('selected');
		}

		$selected = $_choice;
		$_choice.addClass ('selected');
	};

	this.select_first = function ()
	{
		inst.select ($hint.children ().first ());
		
		// hint scrolling
		$hint.scrollTop (0);
	};

	this.select_last = function ()
	{
		var $last = $hint.children ('div').last ();
		
		while ($last.children ('div').size ())
		{
			$last = $last.children ('div').last ();
		}

		inst.select ($last);
		
		// hint scrolling
		$hint.scrollTop ($selected.offset ().top);
	};
	
	this.select_next = function ()
	{
		if (inst.hint_is_shown ())
		{
			if (! $selected)
			{
				inst.select_first ();
			}
			else
			{
				if ($selected.children ('div').size ())
				{
					inst.select ($selected.children ('div').first ());	
				}
				else if ($selected.next ('div').size ())
				{
					inst.select ($selected.next ('div'));
				}
				else
				{
					var $current = $selected.parent ('.AUTOCOMPLETE_choice');
					var hasNext = false;

					while ($current.size ())
					{
						if ($current.next ('div').size ())
						{
							inst.select ($current.next ('div'));
							hasNext = true;
							break;
						}
					
						$current = $current.parent ('.AUTOCOMPLETE_choice');
					}

					if (! hasNext)
					{
						inst.select_first ();
					}
				}
			}
			
			if ($selected.children ('span').position ().top > ($hint.innerHeight () - $selected.children ('span').outerHeight ()))
			{
				$hint.scrollTop ($hint.scrollTop () + $selected.children ('span').outerHeight ());
			}
		}
	};

	this.select_previous = function ()
	{
		if (inst.hint_is_shown ())
		{
			if (! $selected)
			{
				inst.select_last ();
			}
			else
			{
				if ($selected.prev ('div').size ())
				{
					var $current = $selected.prev ('div');

					while ($current.children ('div').last ().size ())
					{
						$current = $current.children ('div').last ();
					}
					
					inst.select ($current);
				}
				else if ($selected.parent ('.AUTOCOMPLETE_choice').size ())
				{
					inst.select ($selected.parent ('.AUTOCOMPLETE_choice'));
				}
				else
				{
					inst.select_last ();
				}
			}

			if ($selected.children ('span').position ().top < 0)
			{
				$hint.scrollTop ($hint.scrollTop () - $selected.children ('span').outerHeight ());			
			}
		}
	};

	this.get_object = function (_path)
	{
		var obj = choices[_path[0]];

		for (var i = 1; i < _path.length; ++ i)
		{
			obj = obj.c[_path[i]];
		}

		return obj;
	}

	this.apply_selection = function ()
	{
		if ($selected)
		{
			var $current = $selected;
			var path = [];
		
			while ($current.parent ('.AUTOCOMPLETE_choice').size ())
			{
				path.push ($current.parent ().children ().index ($current.get (0)) - 1);

				$current = $current.parent ('.AUTOCOMPLETE_choice');
			}

			path.push ($current.parent ().children ().index ($current.get (0)));
			
			path.reverse ();
			selected = []; 

			while (path.length > 0)
			{
				selected.push (inst.get_object (path));
				path.pop ();
			}

			if (inst.selected ().v)
			{
				$_to.val (inst.selected ().l);
				$val.val (inst.selected ().v);
				typed = inst.selected ().l;

				if (onSelect)
				{
					onSelect ();
				}
			}
			else
			{
				selected = null;
			}
		}
	};

	this.selected = function ()
	{
		if (selected)
		{
			return selected[0];
		}
		else
		{
			return null;
		}
	};

	this.selected_path = function ()
	{
		return selected;
	};

	this.change_data = function (_data)
	{
		data = _data;
		
		$selected = null;
		selected = null;
		typed = '';
		$_to.val ('');
	}

	// custom events
	var onHintShow = null;
	this.on_hint_show = function (_callback)
	{
		onHintShow = _callback;

		return this;
	};
	
	var onSelect = null;
	this.on_select = function (_callback)
	{
		onSelect = _callback

		return this;
	}
	
	// initialization operations
	var inst = this;
	var $selected = null;
	var selected = null;
	var choices;
	var typed = '';
	var data = _data;

	var $wrapper = $('<div class="AUTOCOMPLETE"></div>').css ({
		'margin-top' : $_to.css ('margin-top'),
		'margin-bottom' : $_to.css ('margin-bottom'),
		'margin-left' : $_to.css ('margin-left'),
		'margin-right' : $_to.css ('margin-right')
	});

	var $btn = $('<div class="AUTOCOMPLETE_btn"><span></span></div>').click (function (_e)
	{	
		if (! inst.hint_is_shown ())
		{
			inst.populate_hint (inst.build_choices (''));
			inst.show_hint ();
		}
		else
		{
			inst.hide_hint ();
		}
	});

	var $val = $('<input type="hidden" name="' + $_to.attr ('name') + '" value="' + $_to.val () + '" />');

	var $hint = $('<div class="AUTOCOMPLETE_hint"></div>').bind ('click.AUTOCOMPLETE', function (_e)
	{
		inst.apply_selection ();
		inst.hide_hint ();
	});

	$_to.attr ('autocomplete', 'off').bind ('blur.AUTOCOMPLETE', function ()
	{
		if (inst.hint_is_shown ())
		{	
			inst.apply_selection ();
			inst.hide_hint ();
		}
	});

	$_to.attr ('name', '_' + $_to.attr ('name'));
	$_to.wrap ($wrapper);
	$_to.before ($('<div class="AUTOCOMPLETE_left"></div>'));
	$_to.parent ().append ($btn);	
	$_to.parent ().append ('<br class="clear" />');
	$_to.parent ().append ($val);
	$_to.parent ().append ($hint);

	$_to.keydown (function (_e)
	{	
		switch (_e.keyCode)
		{
			case 13: // RETURN KEY
				_e.preventDefault ();
				break;
			
			case 38: // UP KEY
				_e.preventDefault ();
				
				if (inst.hint_is_shown ())
				{
					inst.select_previous ();
				}
				break;
			
			case 40: // DOWN KEY
				_e.preventDefault ();
				
				if (inst.hint_is_shown ())
				{
					inst.select_next ();
				}
				break;
		}
	});

	$_to.keypress (function (_e)
	{
		switch (_e.keyCode)
		{
			case 13:
			case 38:
			case 40:
				_e.preventDefault ();
				break;
		}
	});

	$_to.keyup (function (_e)
	{
		switch (_e.keyCode)
		{
			case 13:
				_e.preventDefault ();
				
				if (inst.hint_is_shown ())
				{
					inst.apply_selection ();
					inst.hide_hint ();
				}
				break;

			case 38:
			case 40:
				_e.preventDefault ();
				break;

			default:
				if ($(this).val () != typed)
				{
					typed = $(this).val ();

					// reset previously selected result
					$selected = null;

					var choices = inst.build_choices ($(this).val ());
				
					if (inst.hint_is_shown ())
					{
						if (choices.length > 0)
						{	
							inst.populate_hint (choices);
							inst.select_first ();
						}
						else
						{
							inst.hide_hint ();
						}
					}
					else
					{
						if (choices.length > 0)
						{	
							inst.populate_hint (choices);
							inst.show_hint ();
						}
					}
				}
		}
	});

	return this;
}
/**
 * @version 1.0
 */
if (typeof (DIALOGIC) == 'undefined')
{
    DIALOGIC = {};
}

/**
 * This is a class making a rolling horizontal tag list widget from a simple <div></div> class.
 *
 * It requires:
 *
 * - HOTTOPICS.css style content being added to the document
 * - HOTTOPICS.js script content being added to the document
 *
 * - a <div></div> where the widget should be
 * -- with a css-defined width
 *
 * @constructor
 * @argument {jQuery object} $_to This is the jQuery object containing the <div></div> on which the class will apply
 * @argument {Object} _data This is the javascript object containing the parsed list of tags, something like : [{'tags':'Virtualization,3G,4G,HD Voice,Mobile Broadband,Mobile Video,IVVR,Cloud Computing,SIP Trunking'}]
 */
DIALOGIC.HOTTOPICS = function ($_to, _data)
{
	/**
	 * This is a private method for space-only trimming a string
	 *
	 * @private
	 * @member HOTTOPICS
	 * @argument {String} _in This is the string to trim
	 * @returns String, the trimmed string
	 */
	this.trim = function (_in)
	{
		while (_in.charAt (0) == ' ')
		{
			_in = _in.substr (1);
		}

		while (_in.charAt (_in.length - 1) == ' ')
		{
			_in = _in.substr (0, _in.length - 2);
		}

		return _in;
	}


	/**
	 * This is a private method displaying the tags into the widget
	 *
	 * @private
	 * @member HOTTOPICS
	 * @returns void
	 */
	this.build_tags = function ()
	{
		for (var i in _data)
		{
			var ctags = _data[i].tags.split (',');

			for (var j in ctags)
			{
				//ctags[j] = inst.trim (ctags[j]).toLowerCase ();
				ctags[j] = inst.trim (ctags[j]);
				
				if (! tags[ctags[j]])
				{
					tags[ctags[j]] = [];
				}
			}
		}

		for (j in tags)
		{
			$tags.append ($('<a onclick="_gaq.push([\'_trackEvent\', \'HotTopic\', \'Click\', \'' + j + '\']);" href="http://www.dialogic.com/search/default.htm?output=xml_no_dtd&sort=date:D:L:d1&client=default_frontend&oe=UTF-8&ie=UTF-8&proxystylesheet=default_collection&site=default_collection&q=' + j.replace (' ', '+') + '">' + j + '</a>'));
		}

		tagsWidth = $tags.width ();

		for (j in tags)
		{
			$tags.append ($('<a onclick="_gaq.push([\'_trackEvent\', \'HotTopic\', \'Click\', \'' + j + '\']);" href="http://www.dialogic.com/search/default.htm?output=xml_no_dtd&sort=date:D:L:d1&client=default_frontend&oe=UTF-8&ie=UTF-8&proxystylesheet=default_collection&site=default_collection&q=' + j.replace (' ', '+') + '">' + j + '</a>'));
		}

		$tags.css ({'width' : tagsWidth * 2 + 'px'});
	};

	/**
	 * This is a private method increasing a tag's font
     *
	 * @private
	 * @member HOTTOPICS
	 * @returns void
	 */
	this.fisheye_current = function ()
	{
		$current.animate ({
			'font-size' : '18px'
		}, 100);
	}

	/**
	 * This is a private method decreasing the $current tag's font back to normal if existing
     *
	 * @private
	 * @member HOTTOPICS
	 * @returns void
	 */
	this.unfisheye_current = function ()
	{
		if ($current)
		{
			$current.stop ();

			$current.animate ({
				'font-size' : '12px'
			}, 100);
		}
	}

	/**
	 * This is a private method starting the tags list rolling
     *
	 * @private
	 * @member HOTTOPICS
	 * @returns void
	 */
	this.start_rolling = function ()
	{
		inst.unfisheye_current ();
		
		clearInterval (rollInterval);
		
		rollInterval = setInterval (function ()
		{
			$tags.css ({'left' : parseInt ($tags.css ('left')) - step + 'px'});

			if (step > 0 && parseInt ($tags.css ('left')) < (-1 * tagsWidth))
			{
				$tags.css ({'left' : 0});
			}
			else if (step < 0 && parseInt ($tags.css ('left')) >= 0)
			{
				$tags.css ({'left' : (-1 * tagsWidth)});
			}
		}, 20);
	}

	/**
	 * This is a private method stopping the tags list rolling
     *
	 * @private
	 * @member HOTTOPICS
	 * @returns void
	 */
	this.stop_rolling = function ()
	{
		clearInterval (rollInterval);
	}

	this.hide_bubble = function ()
	{
		if ($bubble)
		{
			$bubble.remove ();
		}
	}

	this.hide_all = function ()
	{
		clearTimeout (hideTimeout);
		hideTimeout = setTimeout (function ()
		{
			inst.unfisheye_current ();
			$current = null;
			inst.hide_bubble ();
			inst.start_rolling ();
		}, 200);
	}

	this.show_bubble = function ($_link)
	{
		/*if (! keymatches[0][$_link.html ()])
		{
			return;
		}

		$content = $('<ul></ul>');

		$bubble = $('<div class="HOTTOPICS_bubble"></div>').append ($content).css ({
			'left' : $_link.offset ().left - 10 + 'px',
			'top' : $_to.offset ().top + 35 + 'px'
		}).mouseover (function ()
		{
			clearTimeout (hideTimeout);
		}).mouseout (function (_e)
		{
			inst.hide_all ();
		}).appendTo ('body').new_round_corners ({'color' : 'dce199', 'size' : '5'}).append ('<div id="triangle"></div>');

		$content.append ('<li><a href="http://www.dialogic.com/search/default.htm?output=xml_no_dtd&sort=date:D:L:d1&client=default_frontend&oe=UTF-8&ie=UTF-8&proxystylesheet=default_collection&site=default_collection&q=' + $_link.html ().replace (' ', '+') + '">more...</a></li>');

		for (var i in keymatches[0][$_link.html ()])
		{
			$content.prepend ('<li><a href="' + keymatches[0][$_link.html ()][i].link + '">' + keymatches[0][$_link.html ()][i].label + '</a></li>');
		}*/
	}

	// initialisation operations
	var inst = this;
	var tags = {};
	var $tags = $('<div class="tags"></div>').appendTo ($_to);
	var tagsWidth = null;
	var step = 1;
	var timeout = null;
	var hideTimeout = null;
	var $bubble = null;
	var xhr = null;

	// event handling rolling change when mouse cursor on the left side
	$_to.append ($('<span class="left">Hot Topics:</span>').mouseover (function (_e)
	{
		inst.hide_all ();
		step = -3;
	}).mouseout (function (_e)
	{
		step = 1;
	}));

	// event handling rolling change when mouse cursor on the right side
	$_to.append ($('<span class="right"></span>').mouseover (function (_e)
	{
		inst.hide_all ();
		step = 3;
	}).mouseout (function (_e)
	{
		step = 1;
	}));

	var rollInterval = null;
	var $current = null;

	// event handling tag's font change on mouseover
	$tags.mouseover (function (_e)
	{
		clearTimeout (hideTimeout);
		inst.stop_rolling ();
		
		if (_e.target.tagName == 'A' && (!$current || $current.get (0) != _e.target))
		{	
			inst.unfisheye_current ();
			$current = $(_e.target);
			inst.fisheye_current ();
			
			inst.hide_bubble ();
			
			clearTimeout (timeout);
			timeout = setTimeout (function ()
			{
				inst.show_bubble ($current);
			}, 200);
		}
	});

	$tags.mouseout (function (_e)
	{
		if (_e.target.tagName == 'A')
		{
			inst.hide_all ();
		}
	});	

	// IE6 FIX
	$_to.css ({'background' : 'white'});

	inst.build_tags ();
	inst.start_rolling ();

	var keymatches = [{"HD Voice":[{"link":"http://www.dialogic.com/technologies/hd-voice.htm","label":"Are You Ready for HD Voice?"}],"Cloud Computing":[{"link":"http://www.dialogic.com/technologies/cloud-communications.htm","label":"What Is Cloud Communications?"},{"link":"http://www.dialogic.com/products/docs/whitepapers/12023-cloud-computing-wp.pdf","label":"Introduction to Cloud Computing"}],"Mobile Broadband":[{"link":"http://www.dialogic.com/technologies/mobile-broadband-services.htm","label":"Mobile Broadband Services"}],"Mobile Video":[{"link":"http://www.dialogic.com/jump/builtin/default.htm","label":"Build On Dialogic - Can you find Dialogic in that?"}]}];

	return this;
}
/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
$.fn.round_corners = function (_args)
{
	var args = {'mask' : [1, 1, 1, 1]};
	
	if (_args) $.extend (args, _args);

	this.each (function ()
	{
		var $rc_tl = $('<div class="rc_tl"></div>').css ({
			'height' : args.size + 'px',
			'padding' : '0 0 0 ' + args.size + 'px'
		});
		
		var $rc_tr = $('<div class="rc_tr"></div>').css ({
			'height' : args.size + 'px',
			'padding' : '0 ' + args.size + 'px 0 0'
		});
		
		var $rc_tc = $('<div class="rc_tc"></div>').css ({
			'height' : args.size + 'px'
		});

		var $rc_bl = $('<div class="rc_bl"></div>').css ({
			'height' : args.size + 'px',
			'padding' : '0 0 0 ' + args.size + 'px'
		});
		
		var $rc_br = $('<div class="rc_br"></div>').css ({
			'height' : args.size + 'px',
			'padding' : '0 ' + args.size + 'px 0 0'
		});

		var $rc_bc = $('<div class="rc_bc"></div>').css ({
			'height' : args.size + 'px'
		});
		
		if (args.color)
		{
			$rc_tl.css ({
				'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.png\') no-repeat left top'
			});
		
			$rc_tr.css ({
				'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.png\') no-repeat right top'
			});

			$rc_tc.css ({
				'background' : '#' + args.color
			});	
		
			$rc_bl.css ({
				'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.png\') no-repeat left bottom'
			});
		
			$rc_br.css ({
				'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.png\') no-repeat right bottom'
			});
			
			$rc_bc.css ({
				'background' : '#' + args.color
			});	
	
			// IE6 spec
			if ($.browser.msie && parseInt ($.browser.version) == 6)
			{
				$rc_tl.css ({
					'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.gif\') no-repeat left top'
				});
		
				$rc_tr.css ({
					'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.gif\') no-repeat right top'
				});

				$rc_bl.css ({
					'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.gif\') no-repeat left bottom'
				});
		
				$rc_br.css ({
					'background' : 'url(\'static/images/rc_' + args.size + 'px_' + args.color + '.gif\') no-repeat right bottom'
				});
			}

			if (! args.mask[0])
			{
				$rc_tl.css ({'padding' : '0'});
			}

			if (! args.mask[1])
			{
				$rc_tr.css ({'background' : '#' + args.color});
			}

			if (! args.mask[2])
			{
				$rc_br.css ({'background' : '#' + args.color});
			}

			if (! args.mask[3])
			{
				$rc_bl.css ({'background-position' : '-' + (args.size / 2) + 'px -' + (args.size / 2) + 'px'});
			}
		}

		$rc_tl.append ($rc_tr.append ($rc_tc));
		$rc_bl.append ($rc_br.append ($rc_bc));
		
		if ($(this).get (0).tagName == 'LI')
		{
			if ($(this).children ('.rc_tl').size ())
			{
				$(this).children ('.rc_tl').remove ();
				$(this).children ('.rc_bl').remove ();

				if (args.color)
				{
					$(this).children ().first ().css ({'background' : '#' + args.color});
				}
				else
				{
					$(this).children ().first ().css ({'background' : 'transparent'});
				}
			}
			else
			{
				if (args.color)
				{
					$(this).html ('<div class="rc_content" style="background:#' + args.color + ';padding:0 ' + (args.size * 1.5) + 'px">' + $(this).html () + '</div>');	
				}
				else
				{
					$(this).html ('<div class="rc_content" style="padding:0 ' + (args.size * 1.5) + 'px">' + $(this).html () + '</div>');	
				}
			}
			
			$(this).prepend ($rc_tl);
			$(this).append ($rc_bl);

			// IE7 fix
			if ($(this).children ().first ().next ().width () > 0)
			{
				$rc_tl.css ({'width' : $(this).children ().first ().next ().width () + (args.size * 2) + 'px'});
				$rc_bl.css ({'width' : $(this).children ().first ().next ().width () + (args.size * 2) + 'px'});
			}
		}
		else if ($(this).css ('position') == 'absolute' || $(this).css ('position') == 'fixed')
		{
			$(this).children ('.rc_tl').remove ();
			$(this).children ('.rc_bl').remove ();
			$(this).prepend ($rc_tl);
			$(this).append ($rc_bl);
		}
		else
		{
			$(this).prev ('.rc_tl').remove ();
			$(this).next ('.rc_bl').remove ();
			$(this).before ($rc_tl);
			$(this).after ($rc_bl);

			$rc_tl.css ({'margin-top' : $(this).css ('margin-top')});
			$rc_bl.css ({'margin-bottom' : $(this).css ('margin-bottom')});
			$rc_tl.css ({'margin-left' : $(this).css ('margin-left')});
			$rc_tl.css ({'margin-right' : $(this).css ('margin-right')});
			
			$(this).css ({'margin-top' : '0'});
			$(this).css ({'margin-bottom' : '0'});
			$(this).css ({'background' : '#' + args.color});	
			$(this).css ({'padding' : '0 ' + args.size + 'px'});
		}
	});
	
	return this;
};

$.fn.new_round_corners = function (_args)
{
	var args = {};
	
	if (_args) $.extend (args, _args);

	this.each (function ()
	{
		var color = args.color;
		var size = args.size;
		var url = '/static/images/rc_' + size + 'px_' + color;

		// IE6 spec
		if ($.browser.msie && parseInt ($.browser.version) == 6)
		{
			url += '.gif';
		}
		else
		{
			url += '.png';
		}

		$(this).wrapInner ('<div style="background:url(' + url + ') no-repeat left top;float:left;"><div style="background:url(' + url + ') no-repeat right top;float:left;"><div style="background:url(' + url + ') no-repeat right bottom;float:left;"><div style="background:url(' + url + ') no-repeat left bottom;float:left;"><div style="background:#' + color + ';margin:0 ' + size + 'px;padding:' + size + 'px 0;"><div style="background:#' + color + ';left:-' + size + 'px;padding-left:' + size + 'px;position:relative;"><div style="background:#' + color + ';left:' + (size * 2) + 'px;margin-left:-' + (size * 2) + 'px;position:relative;"><div style="background:#' + color + ';padding-right:' + size + 'px;"></div></div></div></div></div></div></div></div>');
	});
	
	return this;
};
$.fn.hint = function ()
{
	this.each (function ()
	{
		var $hint = null;
		var inside = $(this).attr ('hint');

		$(this).css ({
			'cursor' : 'pointer'
		}).mouseover (function (_e)
		{
			if ($hint == null)
			{
				// IE6 spec
				if ($.browser.msie && parseInt ($.browser.version) == 6)
				{
					var ext = 'gif';
				}
				else
				{
					var ext = 'png';
				}

				$hint = $('<div>' + inside + '</div>').css ({
					'color' : '#707276',
					'display' : 'none',
					'font-size' : '11px',
					'left' : _e.pageX + 10 + 'px',
					'top' : _e.pageY + 15 + 'px',
					'position' : 'absolute',
					'width' : '200px'
				}).appendTo ('body').new_round_corners ({'color' : 'dce199', 'size' : '5'}).append ($('<div></div>').css ({
					'background' : 'url(\'/static/images/triangle_icon.' + ext + '\')',
					'height' : '12px',
					'left' : '20px',
					'padding' : '0',
					'position' : 'absolute',
					'top' : '-12px',
					'width' : '15px'
				})).slideDown (300);
			}
		}).mouseout (function ()
		{
			if ($hint != null)
			{
				$hint.stop ().hide ();
				$hint = null;
			}
		});
	});

	return this;
};

$('document').ready (function ()
{
	$('[hint]').hint ();
});

