<!--
var breaded = { };
function makepop(content,id) {
	if ($('#'+id).length) {
		$('#'+id+' > .content').html(content);
		showPopshell();
		$('#'+id).center();
		$('#'+id).show();
	} else {
		var thisbox = '<div id="'+id+'" class="popbox" style="display:block;"><a href="javascript:void(0);" onclick="closepop(\''+id+'\');" class="symbol icon-close floatRight" title="close">Close</a><div class="content">'+content+'</div></div>';
		showPopshell();
		$('body').append(thisbox);
		$('#'+id).center();
	}
}
function closepop(id) {
	$('#popshell').hide();
	$('#'+id).hide();
}
function showPopshell() {
	if ($('#popshell').length) {
		$('#popshell').show();
	} else {
		$('body').append('<div id="popshell"></div>');
	}
}
function showthis(obj) {
	$("#"+obj).css('display','block');
	$("#"+obj).siblings().each(function() {
		this.style.display = "none";
	});
}
function ga_event(link,params) {
	_gaq.push(params);
	var hostProtocol = (("https:" == document.location.protocol) ? "https" : "http");
	var url = hostProtocol+"://27.xg4ken.com/media/getpx.php?cid=dd9205a3-0089-467e-b30b-dd5d6cd379e6" + "&type=conv&val=&orderId=&valueCurrency=USD&promoCode=" + "&ref=" + document.referrer;
	var a = new Image(1,1);
	a.src = url;
	window.location.href = link.href;
}
function showThis(obj,h4) {
	breaded[obj] = h4;
	var titles = obj.split(",");
	$('.current').each(function() {
		$(this).slideUp().removeClass('current');
	});
	
	for (title in titles) {
		$('#'+titles[title]).slideDown().addClass('current');
	}
	var deleteprop = false;
	var breadhtml = '<a href="support">Start</a>';
	for (bread in breaded) {
		if (!deleteprop) {
			breadhtml += ' <em>></em> <a href="javascript:void(0);" onclick="showThis(\''+bread+'\',\''+breaded[bread]+'\');">' + breaded[bread] + '</a>';
		} else {
			delete breaded[bread];
		}
		if (obj == bread) deleteprop = true;
	}
	$('.breadcrumb').show().html(breadhtml);
}
function clearfield(obj) {
	if (!obj.set) {
		obj.val = obj.value;
		obj.value = "";
		obj.set = true;
	} else {
		if ((obj.val)&&(obj.value == obj.val)) {
			obj.value = "";	
		}
	}
	$(obj).removeClass('watermark');
}

var waitForFinalEvent = (function () {
  var timers = {};
  return function (callback, ms, uniqueId) {
    if (!uniqueId) {
      uniqueId = "Don&rsquo;t call this twice without a uniqueId";
    }
    if (timers[uniqueId]) {
      clearTimeout (timers[uniqueId]);
    }
    timers[uniqueId] = setTimeout(callback, ms);
  };
})();

function toggleDivs (obj) {
	$('#'+obj).hide();
	sibClass = $('#'+obj).attr('class');
	$('#'+obj).siblings().each(function() {
		if (this.id != "" && this.id != "NULL" && this.className == sibClass) {
			this.style.display = "none";
		}
	});	
	$('#'+obj).slideToggle(300,'swing');
	$('a[title="'+obj+'"]').parent().find('a').removeClass("tabon");
	$('a[title="'+obj+'"]').addClass("tabon");
}
$(document).ready(function() {

	//SETUP FLEXIBLE TOGGLING
	if ($('.pagenav').length) {
		$('.pagenav').find('a').click(function() {
			if ($(this).attr('title')) {
				var obj = $(this).attr('title');
				toggleDivs(obj);
			}
		});
	}
	var hash = window.location.hash;
	if ($(hash).length) {
		toggleDivs(hash.substring(1));
	}
	
	//EASY SLIDER (for SCREENSHOTS, ETC)
	if ($('#slider').length) {
		if ($.browser.msie) $('head').append('<script type="text/javascript" src="/scripts/easySlider.js"></script>');
		$('head').append('<script type="text/javascript" src="/scripts/easySlider.js"></script>');
		$('#slider').easySlider({
			auto: true,
			continuous: true 
		});
	}
	// TOOLTIPS : ADD class="info" TO CONTAINER, AND title="<h6>Header</h6>|<p>This is the tooltip.</p>" to SPAN inside CONTAINER
	if ($('.info').find('span[title]').length) {
		$('.info').find('span[title]').tooltip({ offset: [0,5] });
	}

	// XHTML COMPLIANT TARGET="_BLANK"
	$('a').each(function() {
		if ($(this).attr('href') &&	$(this).attr('rel') == 'external') $(this).attr('target','_blank');
	});
	//POP HANDLER
	if ($('.popup').length) {
		var urlbase = window.location.href.substring(0,window.location.href.indexOf('.com/')+8);
		$('.popup').each(function() {
			if ($(this).attr('title')) {
				$(this).click(function() {
					var title = $(this).attr('title');
					var arr = title.split('/');
					if (arr[0] == 'url') {
						var iframe = '<iframe allowtransparency="true" src="'+title.substring(4)+'" frameborder="0" style="width:100%; height:400px; border:none;"></iframe>';
						makepop(iframe,'urlpop');
					} else {
						var thisurl = urlbase + title;
						$.post(thisurl, function(data){
							if (data.length > 0) {
								var id = arr[0] + '-' + arr[1] + '-pop';
								//alert(id);
								if ($('#'+id).length) {
									$('#'+id+' > .content').html(data);
									showPopshell();
									$('#'+id).center();
									$('#'+id).show();
								} else {
									makepop(data,id);
								}
							}
						});
					}
					return false;
				});
			}
		});
	}
	// WATERMARKED FIELDS
	if ($('.special').length) {
		$('.special').each(function() {
			this.set = false;
			this.val = false;
			$(this).click(function() { clearfield(this); });
			$(this).focus(function() { clearfield(this); });
			$(this).keyup(function() {
				$(this).removeClass('watermark');	
				this.set = true;
			});
			$(this).blur(function() {
				if (this.value == "") {
					if (this.val != false) {
						$(this).addClass('watermark');
						this.value = this.val;
					}
				} else {
					if (this.val) {
						if (this.value == this.val) {
							$(this).addClass('watermark');
						}
					}
				}
			});
		});
	}
	if ($('.linkBox').length) {
		$('.linkBox').each(function() {
			if ($(this).find('a').length) {
				$(this).click(function() {
					window.location = $(this).find('a').attr('href');
					
				});
			}
		});
	}
	//FIELD VALIDATION
	if ($('#submit').length) {
		$('#submit').click(function() {
			var fields = 0;
			$('.required').each(function() {
				if (($(this).val() == "")||($(this).val() == "required")) {
					$(this).parents('fieldset').addClass('warning');
					$(this).parents('fieldset').parents('div').find('p.msg').html('Please fill in the highlighted fields below.');
					fields++;
				} else {
					$(this).parents('fieldset').removeClass('warning');	
				}
			});
			if (fields > 0) {
				return false;
			} else {
				return true;	
			}
		});
	}
	if ($('.slideshow').length) {
		if ($.browser.msie) $('head').append('<script type="text/javascript" src="/scripts/jquery.bxSlider.min.js"></script>');
		$('head').append('<script type="text/javascript" src="/scripts/jquery.bxSlider.min.js"></script>');
		var slideshow = $('.slideshow').bxSlider({
			auto: true,
			speed: 1000,
			pause: 10000,
			autoControls: true,
			autoHover: true,
			pager: true,
			controls: false,
			autoControls: false,
			mode: 'horizontal'
		
		});
		$(window).resize(function () {
			waitForFinalEvent(function(){
				slideshow.reloadShow();
			}, 500, "some unique string");
		});
	}
	if ($('.urlSelect').length) {
		$('.urlSelect').each(function() {
			$(this).change(function() {
				var url = $(this).val();
				window.location = url;
			});
		});
	}
	//BLINDS : Slide Up and Down
	if ($('.toggleBlind').length) {
		$('.toggleBlind').click(function() {
			//$(this).css('background-color','#CC3300');
			$(this).parent().parent().find('.blind').slideToggle(400,'swing');
		});
	}
	//SETS CURRENCY SYMBOL BASED ON ASSOCIATION OF IP TO COUNTRY CODE
	if ($('.currency').length) {
		$.post('/en/getcurrency', function(data){
			if (data.length > 0) {
				if (data == 'US') {
					$('.currency').each(function() { $(this).prepend('$'); });
				} else {
					var europe = new Array('BE','BG','CZ','DK','DE','EE','IE','EL','ES','FR','IT','CY','LV','LT','LU','HU','MT','NL','AT','PL','PT','RO','SI','SK','FI','SE','UK');
					for (i = 0; i < europe.length; i++) {
						if (data == europe[i]) $('.currency').each(function() { $(this).append('&euro;'); var html = $(this).html(); var newhtml = html.replace('.',','); $(this).html(newhtml); });
					}
				}
			}
		});
	}
	if ($('.toggle').length) {
		$('.toggle').each(function() {
			$(this).click(function() {
				var parentTag = $(this).parent().get(0).tagName.toLowerCase();
				var toggled = parentTag == 'p' || parentTag == 'h2' ? $(this).parent().nextAll('.guts') : $(this).nextAll('.guts')
				obj = parentTag == 'h2' ? $(this).parents('div.module').find('a.toggle') : $(this);
				var condition = obj.hasClass('btn-collapse') ? true : false
				if (condition) 
					obj.removeClass('btn-collapse').attr('title','Expand');
				else
					obj.addClass('btn-collapse').attr('title','Collapse');
				
				toggled.slideToggle(300,'swing');
				
			});
		});
	}	
});

// LIVE CHAT BUTTONS

var __lc_buttons = __lc_buttons || [];
__lc_buttons.push({
	elementId: 'LiveChat_1318279852',
	language: 'en',
	skill: '1',
	type: 'text',
	labels: {
		online: 'Chat%20With%20Us<b>Can we help you?</b>',
		offline: 'Chat%20Offline<b>Leave a Message</b>'
	}
});

//-->
