/*
* © Copyrigt by Dennis Lund 
* http://www.pixilator.com
* info *at* pixilator.com
* Version 1.0 - march 2010
*/


// JQuery.json-2.2.min.js
(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
{if(string.match(_escapeable))
{return'"'+string.replace(_escapeable,function(a)
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);




// To avoid errors from using <a href='javscript:none()'></a> the following defines the none() function
function none() {}

//------------------------------------------------------------------------

Pix_IncludeJavaScript = function(jsFile)
{
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></scr' + 'ipt>'); 
}

//Pix_IncludeJavaScript('/pixilator/LE34_Social/js/autoresize.js');



// standart string replace functionality
Pix_str_replace = function(haystack, needle, replacement) {
	var temp = haystack.split(needle);
	return temp.join(replacement);
}
 
// needle may be a regular expression
Pix_str_replace_reg = function(haystack, needle, replacement) {
	var r = new RegExp(needle, 'g');
	return haystack.replace(r, replacement);
}


//http://yelotofu.com/2008/08/jquery-shuffle-plugin/

  $.fn.shuffle = function() {
    return this.each(function(){
      var items = $(this).children();
      return (items.length)
        ? $(this).html($.shuffle(items))
        : this;
    });
  }
 
  $.shuffle = function(arr) {
    for(
      var j, x, i = arr.length; i;
      j = parseInt(Math.random() * i),
      x = arr[--i], arr[i] = arr[j], arr[j] = x
    );
    return arr;
  }


// Usage:

// Shuffle unordered list
// $('ul').shuffle(); 

// Shuffle array
//arr = $.shuffle(arr);



// Return new array with duplicate values removed
Array.prototype.unique =
  function() {
    var a = [];
    var l = this.length;
    for(var i=0; i<l; i++) {
      for(var j=i+1; j<l; j++) {
        // If this[i] is found later in the array
        if (this[i] === this[j])
          j = ++i;
      }
      a.push(this[i]);
    }
    return a;
  };


Pix_explode = function(delimiter, string, limit) {
    // http://kevin.vanzonneveld.net
    // +     original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     improved by: kenneth
    // +     improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     improved by: d3x
    // +     bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: explode(' ', 'Kevin van Zonneveld');
    // *     returns 1: {0: 'Kevin', 1: 'van', 2: 'Zonneveld'}
    // *     example 2: explode('=', 'a=bc=d', 2);
    // *     returns 2: ['a', 'bc=d']
 
    var emptyArray = { 0: '' };
    
    // third argument is not required
    if ( arguments.length < 2 ||
        typeof arguments[0] == 'undefined' ||
        typeof arguments[1] == 'undefined' ) {
        return null;
    }
 
    if ( delimiter === '' ||
        delimiter === false ||
        delimiter === null ) {
        return false;
    }
 
    if ( typeof delimiter == 'function' ||
        typeof delimiter == 'object' ||
        typeof string == 'function' ||
        typeof string == 'object' ) {
        return emptyArray;
    }
 
    if ( delimiter === true ) {
        delimiter = '1';
    }
    
    if (!limit) {
        return string.toString().split(delimiter.toString());
    } else {
        // support for limit argument
        var splitted = string.toString().split(delimiter.toString());
        var partA = splitted.splice(0, limit - 1);
        var partB = splitted.join(delimiter.toString());
        partA.push(partB);
        return partA;
    }
}





// Test if a value is present in an array

Pix_in_array = function(a, obj) {
  var i = a.length;
  while (i--) {
    if (a[i] === obj) {
      return true;
    }
  }
  return false;
}



/* Neat little function to get variables passed in URL
 * call syntax:
 * window.GET();
 * alert(_GET['test1']);
 * Source: http://w3schools.invisionzone.com/index.php?showtopic=16302&st=0&p=88781&#entry88781
 */

window.GET = function(){
    var url = window.location.href;
    var array = url.indexOf('#') == -1 ?
                url.substring(url.indexOf('?') + 1).split('&'):
                url.substring(url.indexOf('?') + 1, url.indexOf('#')).split('&');
                            //URLs can be like either "sample.html?test1=hi&test2=bye" or
                                //"sample.html?test1=hi;test2=bye"
    window._GET = {};
    for(var i = 0; i < array.length; i++){
        var assign = array[i].indexOf('=');
        if(assign == -1){
            _GET[array[i]] = true;//if no value, treat as boolean
        }else{
            _GET[array[i].substring(0, assign)] = array[i].substring(assign + 1);
        }
    }
}




window.GETHASH = function(){
    var url = window.location.href;
    
    
    if (url.indexOf('#') > -1) {
    
				var array = url.substring(url.indexOf('#') + 1).split('&');
										//URLs can be like either "sample.html?test1=hi&test2=bye" or
											//"sample.html?test1=hi;test2=bye"
				window._GETHASH = {};
				for(var i = 0; i < array.length; i++){
					var assign = array[i].indexOf('=');
					if(assign == -1){
						_GETHASH[array[i]] = true;//if no value, treat as boolean
					}else{
						_GETHASH[array[i].substring(0, assign)] = array[i].substring(assign + 1);
					}
				}
				
		
				
	} else {
	window._GETHASH = {};
	return false;
	
	}
}







$.fn.clearForm = function() {

	return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	
	if (tag == 'form')
		return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
		this.value = '';
	else if (type == 'checkbox' || type == 'radio')
		this.checked = false;
	else if (tag == 'select')
		this.selectedIndex = -1;
	});

};


jQuery.fn.center = function () {

	
    this.css("position","absolute");
    
    var top = ($(window).height() - $(this).outerHeight())/2+$(window).scrollTop();
   	var left = ($(window).width() - $(this).outerWidth())/2+$(window).scrollLeft();


    this.css("top", top + "px");
    this.css("left", left + "px");
    
   	return this;

}
	
	// Now we can just write:
	// $(element).center();
	// http://stackoverflow.com/questions/210717/what-is-the-best-way-to-center-a-div-on-the-screen-using-jquery	
	







/**
 * 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;
    }
};




/*!
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.08 (02-MAR-2010)
 * Requires jQuery v1.3.2 or later
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Authors: Dave Methvin and Mike Alsup
 */

/**
 *  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
 *
 *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
 *  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
 *  width:   width of the effect; in the case of rounded corners this is the radius. 
 *           specify this value using the px suffix such as 10px (yes, it must be pixels).
 */
;(function($) { 

var style = document.createElement('div').style;
var moz = style['MozBorderRadius'] !== undefined;
var webkit = style['WebkitBorderRadius'] !== undefined;
var radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined;
var mode = document.documentMode || 0;
var noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);

var expr = $.browser.msie && (function() {
    var div = document.createElement('div');
    try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); }
    catch(e) { return false; }
    return true;
})();
    
function sz(el, p) { 
    return parseInt($.css(el,p))||0; 
};
function hex2(s) {
    var s = parseInt(s).toString(16);
    return ( s.length < 2 ) ? '0'+s : s;
};
function gpc(node) {
    for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) {
        var v = $.css(node,'backgroundColor');
        if (v == 'rgba(0, 0, 0, 0)')
            continue; // webkit
        if (v.indexOf('rgb') >= 0) { 
            var rgb = v.match(/\d+/g); 
            return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
        }
        if ( v && v != 'transparent' )
            return v;
    }
    return '#ffffff';
};

function getWidth(fx, i, width) {
    switch(fx) {
    case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));
    case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));
    case 'sharp':  return Math.round(width*(1-Math.cos(Math.acos(i/width))));
    case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
    case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));
    case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));
    case 'curl':   return Math.round(width*(Math.atan(i)));
    case 'tear':   return Math.round(width*(Math.cos(i)));
    case 'wicked': return Math.round(width*(Math.tan(i)));
    case 'long':   return Math.round(width*(Math.sqrt(i)));
    case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
	case 'dogfold':
    case 'dog':    return (i&1) ? (i+1) : width;
    case 'dog2':   return (i&2) ? (i+1) : width;
    case 'dog3':   return (i&3) ? (i+1) : width;
    case 'fray':   return (i%2)*width;
    case 'notch':  return width; 
	case 'bevelfold':
    case 'bevel':  return i+1;
    }
};

$.fn.corner = function(options) {
    // in 1.3+ we can fix mistakes with the ready state
	if (this.length == 0) {
        if (!$.isReady && this.selector) {
            var s = this.selector, c = this.context;
            $(function() {
                $(s,c).corner(options);
            });
        }
        return this;
	}

    return this.each(function(index){
		var $this = $(this);
		// meta values override options
		var o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase();
		var keep = /keep/.test(o);                       // keep borders?
		var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);  // corner color
		var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);  // strip color
		var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width
		var re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/;
		var fx = ((o.match(re)||['round'])[0]);
		var fold = /dogfold|bevelfold/.test(o);
		var edges = { T:0, B:1 };
		var opts = {
			TL:  /top|tl|left/.test(o),       TR:  /top|tr|right/.test(o),
			BL:  /bottom|bl|left/.test(o),    BR:  /bottom|br|right/.test(o)
		};
		if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
			opts = { TL:1, TR:1, BL:1, BR:1 };
			
		// support native rounding
		if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
			if (opts.TL)
				$this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
			if (opts.TR)
				$this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
			if (opts.BL)
				$this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
			if (opts.BR)
				$this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
			return;
		}
			
		var strip = document.createElement('div');
		$(strip).css({
			overflow: 'hidden',
			height: '1px',
			minHeight: '1px',
			fontSize: '1px',
			backgroundColor: sc || 'transparent',
			borderStyle: 'solid'
		});
	
        var pad = {
            T: parseInt($.css(this,'paddingTop'))||0,     R: parseInt($.css(this,'paddingRight'))||0,
            B: parseInt($.css(this,'paddingBottom'))||0,  L: parseInt($.css(this,'paddingLeft'))||0
        };

        if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
        if (!keep) this.style.border = 'none';
        strip.style.borderColor = cc || gpc(this.parentNode);
        var cssHeight = $(this).outerHeight();

        for (var j in edges) {
            var bot = edges[j];
            // only add stips if needed
            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
                var d = document.createElement('div');
                $(d).addClass('jquery-corner');
                var ds = d.style;

                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                if (bot && cssHeight != 'auto') {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.bottom = ds.left = ds.padding = ds.margin = '0';
                    if (expr)
                        ds.setExpression('width', 'this.parentNode.offsetWidth');
                    else
                        ds.width = '100%';
                }
                else if (!bot && $.browser.msie) {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
                    
                    // fix ie6 problem when blocked element has a border width
                    if (expr) {
                        var bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
                        ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"');
                    }
                    else
                        ds.width = '100%';
                }
                else {
                	ds.position = 'relative';
                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 
                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                
                }

                for (var i=0; i < width; i++) {
                    var w = Math.max(0,getWidth(fx,i, width));
                    var e = strip.cloneNode(false);
                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                }
				
				if (fold && $.support.boxModel) {
					if (bot && noBottomFold) continue;
					for (var c in opts) {
						if (!opts[c]) continue;
						if (bot && (c == 'TL' || c == 'TR')) continue;
						if (!bot && (c == 'BL' || c == 'BR')) continue;
						
						var common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
						var $horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });
						switch(c) {
						case 'TL': $horz.css({ bottom: 0, left: 0 }); break;
						case 'TR': $horz.css({ bottom: 0, right: 0 }); break;
						case 'BL': $horz.css({ top: 0, left: 0 }); break;
						case 'BR': $horz.css({ top: 0, right: 0 }); break;
						}
						d.appendChild($horz[0]);
						
						var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
						switch(c) {
						case 'TL': $vert.css({ left: width }); break;
						case 'TR': $vert.css({ right: width }); break;
						case 'BL': $vert.css({ left: width }); break;
						case 'BR': $vert.css({ right: width }); break;
						}
						d.appendChild($vert[0]);
					}
				}
            }
        }
    });
};

$.fn.uncorner = function() { 
	if (radius || moz || webkit)
		this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
	$('div.jquery-corner', this).remove();
	return this;
};

// expose options
$.fn.corner.defaults = {
	useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
	metaAttr:  'data-corner' // name of meta attribute to use for options
};
    
})(jQuery);


function FileExists(strURL)
{
    oHttp.open("HEAD", strURL, false);
	oHttp.send();
	return (oHttp.status==404) ? false : true;
}



// Get variables passed by URL
window.GET();





function addslashes(str) {
str=str.replace(/\\/g,'\\\\');
str=str.replace(/\'/g,'\\\'');
str=str.replace(/\"/g,'\\"');
str=str.replace(/\0/g,'\\0');
return str;
}
function stripslashes(str) {
str=str.replace(/\\'/g,'\'');
str=str.replace(/\\"/g,'"');
str=str.replace(/\\0/g,'\0');
str=str.replace(/\\\\/g,'\\');
return str;
}





	
$(document).ready(function(){  
	
function html_entity_decode(str)
{
    try
	{
		var  tarea=document.createElement('textarea');
		tarea.innerHTML = str; return tarea.value;
		tarea.parentNode.removeChild(tarea);
	}
	catch(e)
	{
		//for IE add <div id="htmlconverter" style="display:none;"></div> to the page
		document.getElementById("htmlconverter").innerHTML = '<textarea id="innerConverter">' + str + '</textarea>';
		var content = document.getElementById("innerConverter").value;
		document.getElementById("htmlconverter").innerHTML = "";
		return content;
	}
}
	
	//------------------------------------------------------------
	// This function swaps the default value of the inputfield with an empty string - making
	// the input field ready for new input
	//------------------------------------------------------------
	function Pixilator_SwapVal(FieldID) {
	
		var Pix_swap_val = [];  
		$("#" + FieldID).each(function(i){  
			Pix_swap_val[i] = $(this).val();  
			$(this).focusin(function(){  
				if ($(this).val() == Pix_swap_val[i]) {  
					$(this).val("");  
				}  
			}).focusout(function(){  
				if ($.trim($(this).val()) == "") {  
					$(this).val(Pix_swap_val[i]);  
				}  
			});  
		});
		
	}
	
	
	
	function isset(Var) {
	
		if (Var === undefined) {
			return false;
		} else {
			return true;
		}
		
	}
	
	
	// ************************* PIXISHOP ******************************* //
	
	// Swap defaultvalues of textfields with an empty string onfocus
	Pixilator_SwapVal("ShopQuery"); 
	Pixilator_SwapVal("Customer_Firstname");
	Pixilator_SwapVal("Customer_Lastname"); 
	Pixilator_SwapVal("Customer_Address1"); 
	Pixilator_SwapVal("Customer_Address2"); 
	Pixilator_SwapVal("Customer_ZipCode");
	Pixilator_SwapVal("Customer_City");
	Pixilator_SwapVal("Customer_Phone"); 
	Pixilator_SwapVal("Customer_Mobile"); 
	Pixilator_SwapVal("Customer_Email"); 
	Pixilator_SwapVal("Invoice_Company"); 
	Pixilator_SwapVal("Invoice_Name"); 
	Pixilator_SwapVal("Invoice_Address1"); 
	Pixilator_SwapVal("Invoice_Address2"); 
	Pixilator_SwapVal("Invoice_ZipCode"); 
	Pixilator_SwapVal("Invoice_City");
	Pixilator_SwapVal("Invoice_Email"); 
	
	
	
	// ---------------      Misc. corner() actions      ----------------- //
	$('.PixiShop_Document_LinkButton').corner();
	$('.MyPage_EconomyStatus_Wrapper').corner();
	
	
	// --------------- Code related to payment process  ----------------- //
	
	$('#PixiShop_PayButton').click(function() {
		
		
		$.cookie("PixiShop_PayThisAmount", $('#PayThisAmount').val(), { path: '/', domain: '.joanoerting.dk', secure: false });
		$.cookie("PixiShop_InvoiceID", $('#PixiShop_InvoiceID').val(), { path: '/', domain: '.joanoerting.dk', secure: false });
		
		if ($('#RegID').length > 0 && $('#RegID').val() > 0) {
			
			// Setting cookie "PixiShop_RegID"  tells ConfirmationPage, that this concerns a registration event
			// and  the confirmation/payment-receipt should reflect that a successfull registration has occurred
			
			$.cookie("PixiShop_RegID", $('#RegID').val(), { path: '/', domain: '.joanoerting.dk', secure: false });
			
			//alert('VALUE: ' + $.cookie('PixiShop_RegID') + '(' + $('#RegID').val() + ')');
		} else {
		
			//alert('RegID NOT SET');
		}
		
		
	});
	
	
	// --------  Code related to member economystatus page  ------------- //
	
	$('.MyPage_EconomyStatus_History').click(function() {
		
		var Element = $(this);
		var ClassValue = Element.attr('class').split(" ");
		var InvoiceID = ClassValue[1];
		
		if ($('#' + InvoiceID).css('display') == "none") {
			
			$('#' + InvoiceID).css('display','block');
			
		} else {
			
			$('#' + InvoiceID).css('display','none');
		
		}
		
		
	});
	
	$('.MyPage_EconomyStatus_History').mouseover(function() {
		
		var Element = $(this);
		var ClassValue = Element.attr('class').split(" ");
		var InvoiceID = ClassValue[1];
		//alert(InvoiceID);
		
		if (Element.attr('class').indexOf('MyPage_EconomyStatus_History_Hover') > -1) {
		
			Element.removeClass('MyPage_EconomyStatus_History_Hover InvoiceID').addClass('MyPage_EconomyStatus_History InvoiceID');
		
		} else {
		
			Element.removeClass('MyPage_EconomyStatus_Histor InvoiceID').addClass('MyPage_EconomyStatus_History_Hover InvoiceID');
			
		}
		
		
	});
	
	$('.MyPage_EconomyStatus_History').mouseout(function() {
		
		var Element = $(this);
		var ClassValue = Element.attr('class').split(" ");
		var InvoiceID = ClassValue[1];
		//alert(InvoiceID);
		
		if (Element.attr('class').indexOf('MyPage_EconomyStatus_History_Hover') > -1) {
		
			Element.removeClass('MyPage_EconomyStatus_History_Hover InvoiceID').addClass('MyPage_EconomyStatus_History InvoiceID');
		
		} else {
		
			Element.removeClass('MyPage_EconomyStatus_Histor InvoiceID').addClass('MyPage_EconomyStatus_History_Hover InvoiceID');
			
		}
		
		
	});
	
	
	
	
	
	// Search Field OK-Button //
	$('#SubmitShopQuery').mouseover(function() {
		
		var Element = $(this);
		
		var ActiveClass = "PixiShop_Button_1";
		var ReplaceClass = ActiveClass + "_Hover";
		
		Element.removeClass(ActiveClass).addClass(ReplaceClass);
		
	});
	
	$('#SubmitShopQuery').mouseout(function() {
		
		var Element = $(this);
		
		var ActiveClass = "PixiShop_Button_1_Hover";
		var ReplaceClass = "PixiShop_Button_1";
		
		Element.removeClass(ActiveClass).addClass(ReplaceClass);
		
	});
	
	
	$('#SubmitShopQuery').click(function() {
		
		if ($('#ShopQuery').val() != "") {
				
				if (isset(_GET['CategoryID'])) {
				
					var AddCategoryID = '&CategoryID=' + _GET['CategoryID'];
				
				} else {
				
					var AddCategoryID = '';
				
				}
				
				document.location.href='index.php?SiteID=1&PageID=217&Display=Search&ShopQuery=' + $('#ShopQuery').val() + AddCategoryID;
				
			} else {
			
				alert(html_entity_decode("Du kan foretage en s&oslash;gning hvis du skriver et s&oslash;geord i feltet"));
			
			
			}
		
	});
	
	
	
	
	$('#ShopQuery').live('keyup', function (e) {
	   	
	   	if ( e.keyCode == 13 ){ //Enter
			
			if ($('#ShopQuery').val() != "") {
				
				
				var AddCategoryID = "";
				
				if (isset(_GET['CategoryID'])) {
				
					AddCategoryID = "&CategoryID=" + _GET['CategoryID'];
					
				} 
				
				document.location.href='index.php?SiteID=1&PageID=217&Display=Search&ShopQuery=' + $('#ShopQuery').val() + AddCategoryID;
				
			} else {
			
				alert(html_entity_decode("Du kan foretage en s&oslash;gning hvis du skriver et s&oslash;geord i feltet"));
			
			
			}
		  	
		}
		
	});


	
	// PixiShop_Button_3: Show and Buy buttons //
	$('.PixiShop_Button_3').mouseover(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		var NewClassName = ClassArray[0] + '_Hover';
		var Action = ClassArray[1];
		var ProductID = ClassArray[2];
		var SessionID = ClassArray[3];
		
		Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + Action + ' ' + ProductID + ' ' + SessionID);
		
	});
	
	
	
	$('.PixiShop_Button_3').mouseout(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		var NewClassName = Pix_str_replace(ClassArray[0],'_Hover','');
		var Action = ClassArray[1];
		var ProductID = ClassArray[2];
		var SessionID = ClassArray[3];
		
		Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + Action + ' ' + ProductID + ' ' + SessionID);
		
		
	});
	
	
	$('.PixiShop_Button_3').click(function(e) {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		
		var Action = ClassArray[1];
		var ProductID = ClassArray[2];
		var SessionID = ClassArray[3];
		
		if (Action == "Show") {
		
			document.location.href = "index.php?SiteID=1&PageID=217&Display=Product&ProductID=" + ProductID;
		} else {
		
			
			// Put in Basket
			
					var PostData = new Object();
							
					PostData.SessionID = SessionID;
					PostData.ProductID = ProductID;
					var PostJSON = $.toJSON(PostData);
					
					$.post('PixilatorModules/DynamicElements/pixilator/PixiShop/jquery_actions/Action_PutInBasket.php',
						{PassedData: PostJSON},
						function(data) {
							
							var ReturnValue = $.evalJSON(data);
							
							PX_UpdateMiniBasket(SessionID);
							
							$('#AlertBox').text(html_entity_decode("Din vare er i indk&oslash;bskurven"));
							
							$('#AlertBox').css('top', e.pageY - $('#AlertBox').outerHeight());
							$('#AlertBox').css('left', e.pageX - $('#AlertBox').outerWidth());
							$('#AlertBox').corner();
							$('#AlertBox').fadeTo( 1000, 1);
							
							$('#AlertBox').fadeTo( 1000, 0);
							
							
					});
		
		}
	});
	
	//----------------------------------------------------
	// If in Shop Module - Update MiniBasket on pageload
	//----------------------------------------------------
	PX_UpdateMiniBasket($('#PX_SessionID').val());
	//----------------------------------------------------
	
	function PX_UpdateMiniBasket(SessionID) {
	
	var PostData = new Object();
							
					PostData.SessionID = SessionID;
					var PostJSON = $.toJSON(PostData);
					
					$.post('PixilatorModules/DynamicElements/pixilator/PixiShop/jquery_actions/Action_UpdateMiniBasket.php',
						{PassedData: PostJSON},
						function(data) {
							
							var ReturnObject = $.evalJSON(data);
							
							var VerticalBasketContent = "";
							
							if (ReturnObject['TotalCount'] < 1) {
							
								VerticalBasketContent += "<p>Kurven er tom</p>";
							
							} else {
							
								VerticalBasketContent += "<p>Seneste k&oslash;b";
								VerticalBasketContent += "<span title='Slet seneste vare i kurven' class='PixiShop_VerticalBasketStatus_BasketLineDeleteButton " + SessionID + "'>&nbsp;</span></p>";
								VerticalBasketContent += "<p><span class='PixiShop_VerticalBasketStatus_ProductTitle'>" + ReturnObject['LatestProduct']['Title'] + "</span></p>";
								VerticalBasketContent += "<p>Pris incl. moms<br /><span class='PixiShop_VerticalBasketStatus_Amount'>" + ReturnObject['Currency'] + " " + ReturnObject['LatestProduct']['PriceIncVat'] + "</span></p>";
								VerticalBasketContent += "<p>Varer i kurven <br /><span class='PixiShop_VerticalBasketStatus_Amount'>" + ReturnObject['TotalCount'] + "</span></p>";
								VerticalBasketContent += "<p>Kurv ialt	(excl. levering)<br /><span class='PixiShop_VerticalBasketStatus_Amount'>" + ReturnObject['Currency'] + " " + ReturnObject['TotalAmount'] + "</span></p>";
								VerticalBasketContent += "<div id='VerticalBasketCheckoutButton' class='PixiShop_Button_2'>Vis kurv</div>";
								
							
							}
							
							$('#PixiShop_VerticalBasketStatus_Center_Content').html(VerticalBasketContent);
							
							// PixiShop_VerticalBasketStatus_BasketLineDeleteButton: Delete latest item in Shopping Basket //
							$('.PixiShop_VerticalBasketStatus_BasketLineDeleteButton').mouseover(function() {
								
								var Element = $(this);
								
								var ClassArray = Element.attr('class').split(' ');
								var NewClassName = ClassArray[0] + "_Hover";
								var SessionID = ClassArray[1];
								
								Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + SessionID);
								
							});
							
							
							
							$('.PixiShop_VerticalBasketStatus_BasketLineDeleteButton').mouseout(function() {
								
								var Element = $(this);
								
								var ClassArray = Element.attr('class').split(' ');
								var NewClassName = Pix_str_replace(ClassArray[0],'_Hover','');
								var SessionID = ClassArray[1];
								
								
								Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + SessionID);
								
								
							});
							
							
							$('.PixiShop_VerticalBasketStatus_BasketLineDeleteButton').click(function() {
								
								var Element = $(this);
								
								var ClassArray = Element.attr('class').split(' ');
								
								var SessionID = ClassArray[1];
								
								
										var PostData = new Object();
									
										PostData.SessionID = SessionID;
										
										var PostJSON = $.toJSON(PostData);
										
										$.post('PixilatorModules/DynamicElements/pixilator/PixiShop/jquery_actions/Action_DeleteLatestBasketLine.php',
											{PassedData: PostJSON},
											function(data) {
												
												var ReturnValue = $.evalJSON(data);
												
												PX_UpdateMiniBasket(SessionID);
												
												
										});
								
							});
							
							
							
							
							// Vertical BasketStatus Button //
							$('#VerticalBasketCheckoutButton').mouseover(function() {
								
								var Element = $(this);
								
								var ActiveClass = "PixiShop_Button_2";
								var ReplaceClass = ActiveClass + "_Hover";
								
								Element.removeClass(ActiveClass).addClass(ReplaceClass);
								
							});
							
							$('#VerticalBasketCheckoutButton').mouseout(function() {
								
								var Element = $(this);
								
								var ActiveClass = "PixiShop_Button_2_Hover";
								var ReplaceClass = "PixiShop_Button_2";
								
								Element.removeClass(ActiveClass).addClass(ReplaceClass);
								
							});
							
							$('#VerticalBasketCheckoutButton').click(function() {
								
								var Element = $(this);
								
								document.location.href='index.php?SiteID=1&PageID=217&Display=Basket';
								
							});
							
							
							
					});
		
	
	} //function PX_UpdateMiniBasket() {
	
	
	
	function PX_UpdateBasketLine_Number(SessionID, BasketLineID, NewNumber) {
	
					var PostData = new Object();
							
					PostData.SessionID = SessionID;
					PostData.BasketLineID = BasketLineID;
					PostData.NewNumber = NewNumber;
					
					var PostJSON = $.toJSON(PostData);
					
					$.post('PixilatorModules/DynamicElements/pixilator/PixiShop/jquery_actions/Action_UpdateBasketLine_Number.php',
						{PassedData: PostJSON},
						function(data) {
							
							var ReturnValue = $.evalJSON(data);
							
							PX_UpdateMasterBasket(SessionID);
							PX_UpdateMiniBasket(SessionID);
							
					});
	
	
	} //function PX_UpdateBasketLine_Number(SessionID, BasketLineID, NewNumber) {
	
	
	
	function PX_DeleteBasketLine(SessionID, BasketLineID) {
	
					var PostData = new Object();
							
					PostData.SessionID = SessionID;
					PostData.BasketLineID = BasketLineID;
					
					
					var PostJSON = $.toJSON(PostData);
					
					$.post('PixilatorModules/DynamicElements/pixilator/PixiShop/jquery_actions/Action_DeleteBasketLine.php',
						{PassedData: PostJSON},
						function(data) {
							
							var ReturnValue = $.evalJSON(data);
							
							PX_UpdateMasterBasket(SessionID);
							PX_UpdateMiniBasket(SessionID);
							
					});
	
	
	} //function PX_UpdateBasketLine_Number(SessionID, BasketLineID, NewNumber) {
	
	
	//----------------------------------------------------
	// If in Shop Module (Display=Basket) - Update MasterBasket on pageload
	//----------------------------------------------------
	if (_GET['Display'] == "Basket") {
	
	PX_UpdateMasterBasket($('#PX_SessionID').val());
	}
	//----------------------------------------------------
	
	function PX_UpdateMasterBasket(SessionID) {
	
	var PostData = new Object();
							
		PostData.SessionID = SessionID;
		var PostJSON = $.toJSON(PostData);
		
		$.post('PixilatorModules/DynamicElements/pixilator/PixiShop/jquery_actions/Action_UpdateMasterBasket.php',
			{PassedData: PostJSON},
			function(data) {
				
				var ReturnObject = $.evalJSON(data);
				
				var PixiShop_MasterBasketStatus_Center_Content = "";
				
				// BasketHeader
				PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line_BottomBorder'>";
					
					PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1'>"; // Image
					PixiShop_MasterBasketStatus_Center_Content += "Billede";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column2'>"; // ProductID
					PixiShop_MasterBasketStatus_Center_Content += "Varenr";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column3'>"; // Text
					PixiShop_MasterBasketStatus_Center_Content += "Tekst";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div style='text-align: center;' class='PixiShop_MasterBasketStatus_Column4'>"; // Price
					PixiShop_MasterBasketStatus_Center_Content += "Pris";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div style='text-align: center;' class='PixiShop_MasterBasketStatus_Column5'>"; // Discount
					
					PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketDiscountHeader'];
					
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column6'>"; // Number
					PixiShop_MasterBasketStatus_Center_Content += "Antal";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div style='text-align: center;' class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
					PixiShop_MasterBasketStatus_Center_Content += "Bel&oslash;b";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
					PixiShop_MasterBasketStatus_Center_Content += "Slet";
					PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
					
					
				PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line_BottomBorder
				
				
				for (var x = 0; x < ReturnObject['BasketLines'].length; x++) {
				
				
						// ProductLine
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line'>";
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1'>"; // Image
							PixiShop_MasterBasketStatus_Center_Content += "<img style='margin:10px 0px 0px 0px;' src=\"" + ReturnObject['BasketLines'][x]['ProductImageURL'] + "\" alt=\"\" width=\"53\" border=\"0\" align=\"middle\">";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column2'>"; // ProductID
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketLines'][x]['ProductID'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div style='padding:5px 0px 10px 0px; line-height: 18px;' class='PixiShop_MasterBasketStatus_Column3'>"; // Text
							PixiShop_MasterBasketStatus_Center_Content += "<strong>" + html_entity_decode(ReturnObject['BasketLines'][x]['ProductTitle']) + "</strong><br />" + html_entity_decode(ReturnObject['BasketLines'][x]['ProductTeaser']);
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column4'>"; // Price
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketLines'][x]['ProductPrice'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column5'>"; // Discount
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketLines'][x]['BasketLineDiscount'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column6'>"; // Number
							PixiShop_MasterBasketStatus_Center_Content += "<input style='margin:5px 0px 0px 10px;' class='PixiShop_TextField_2 " + ReturnObject['BasketLines'][x]['BasketLineID'] + "' name=\"Number_" + ReturnObject['BasketLines'][x]['BasketLineID'] + "\" id=\"Number_" + ReturnObject['BasketLines'][x]['BasketLineID'] + "\" type=\"text\" size=\"10\" value=\"" + ReturnObject['BasketLines'][x]['BasketLineNumber'] + "\">";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketLines'][x]['BasketLineAmount'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
							PixiShop_MasterBasketStatus_Center_Content += "<div id='PixiShop_MasterBasketStatus_BasketLineDeleteButton_" + ReturnObject['BasketLines'][x]['BasketLineID'] + "' class='PixiShop_MasterBasketStatus_BasketLineDeleteButton " + ReturnObject['BasketLines'][x]['BasketLineID'] + "'>&nbsp;</div>";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line
						
				} //for (var x = 0; x < ReturnObject['BasketLines'].length; x++) {
						
						// Create some space between BasketLines and SubTotal
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line'>";
						PixiShop_MasterBasketStatus_Center_Content += "<br />";
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line
						
						
						// SubTotal 1
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line_TopBorder'>";
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1-6'>"; // Text
							PixiShop_MasterBasketStatus_Center_Content += "Indk&oslash;bskurv ialt";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketSubTotal'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
							PixiShop_MasterBasketStatus_Center_Content += "&nbsp;";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line_TopBorder
						
						
						// Delivery Costs
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line'>";
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1-6'>"; // Text
							PixiShop_MasterBasketStatus_Center_Content += "Leveringsomkostninger";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketCostOfDelivery'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
							PixiShop_MasterBasketStatus_Center_Content += "&nbsp;";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line
						
						
						
						// SubTotal 2
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line_TopBorder'>";
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1-6'>"; // Text
							PixiShop_MasterBasketStatus_Center_Content += "Subtotal";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketSubTotal2'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
							PixiShop_MasterBasketStatus_Center_Content += "&nbsp;";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line_TopBorder
						
						
						
						// VAT
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line'>";
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1-6'>"; // Text
							PixiShop_MasterBasketStatus_Center_Content += "+ " + ReturnObject['BasketVatPercent'] + "% moms";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
							PixiShop_MasterBasketStatus_Center_Content += ReturnObject['BasketVatAmount'];
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
							PixiShop_MasterBasketStatus_Center_Content += "&nbsp;";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line
						
						
						
						// Basket Total
						PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Line_TopBorder'>";
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column1-6'>"; // Text
							PixiShop_MasterBasketStatus_Center_Content += "<span class='MasterBasketTotal'>Total</span>";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column7'>"; // Amount
							PixiShop_MasterBasketStatus_Center_Content += "<span class='MasterBasketTotal'>" + ReturnObject['BasketGrandTotal'] + "</span>";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
							PixiShop_MasterBasketStatus_Center_Content += "<div class='PixiShop_MasterBasketStatus_Column8'>"; // DeleteButton
							PixiShop_MasterBasketStatus_Center_Content += "&nbsp;";
							PixiShop_MasterBasketStatus_Center_Content += "</div>"; 
							
						PixiShop_MasterBasketStatus_Center_Content += "</div>"; //PixiShop_MasterBasketStatus_Line_TopBorder
						
						
					$('#PixiShop_MasterBasketStatus_Center_Content').html(PixiShop_MasterBasketStatus_Center_Content);
				
					
					if ($('#MasterBasketCenter').length > 0) {
	
					// Make both sides of master basket as long as the center content
					// I know - you might want to use display:table etc. instead, but 
					// IE7 does not support that ... so in the meantime....
					
					
					var MasterBasketheight = $('#MasterBasketCenter').height();
					
					$('#MasterBasketLeftSide').height(MasterBasketheight);
					$('#MasterBasketRightSide').height(MasterBasketheight);
					
					}
					
					
					var TransferID = 0;
					for (var x = 0; x < ReturnObject['BasketLines'].length; x++) {
					
							TransferID = ReturnObject['BasketLines'][x]['BasketLineID'];
							
							$("#Number_" + TransferID).live("keyup", function (e) {
	   							
	   							
	   							if ( e.keyCode != 8 && e.keyCode != 9 ){ // (Backspace and Tab)
	   							
									var Element = $(this);
									
									var ClassArray = Element.attr('class').split(' ');
									
									var BasketLineID = ClassArray[1];
									
									PX_UpdateBasketLine_Number(SessionID, BasketLineID, $("#Number_" + BasketLineID).val());
									$("#Number_" + BasketLineID).focus();

								}
							});
							
							
							// PixiShop_MasterBasketStatus_BasketLineDeleteButton: Delete Line in Master Shopping Basket //
							$('#PixiShop_MasterBasketStatus_BasketLineDeleteButton_' + TransferID).mouseover(function() {
								
								var Element = $(this);
								
								var ClassArray = Element.attr('class').split(' ');
								
								var NewClassName = ClassArray[0] + "_Hover";
								
								var BasketLineID = ClassArray[1];
								
								Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + BasketLineID);
								
							});
							
							
							
							$('#PixiShop_MasterBasketStatus_BasketLineDeleteButton_' + TransferID).mouseout(function() {
								
								var Element = $(this);
								
								var ClassArray = Element.attr('class').split(' ');
								
								var NewClassName = Pix_str_replace(ClassArray[0],'_Hover','');
								var BasketLineID = ClassArray[1];
								
								
								Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + BasketLineID);
								
								
							});
							
							
							$('#PixiShop_MasterBasketStatus_BasketLineDeleteButton_' + TransferID).click(function() {
								
								var Element = $(this);
								var ClassArray = Element.attr('class').split(' ');
								var BasketLineID = ClassArray[1];
								PX_DeleteBasketLine(SessionID, BasketLineID);
								
								
								
							});
							
							
					} //for (var x = 0; x < ReturnObject['BasketLines'].length; x++) {
					
					
					
				
				
			});
						
						
	}
	
	
	
	
	
	
	
	
	
	// #MasterBasket_Back: return to Shop from MasterBasket //
	$('#MasterBasket_Back').mouseover(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		var NewClassName = ClassArray[0] + "_Hover";
		var BasketID = ClassArray[1];
		
		Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + BasketID);
		
	});
	
	
	
	$('#MasterBasket_Back').mouseout(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		var NewClassName = Pix_str_replace(ClassArray[0],'_Hover','');
		var BasketID = ClassArray[1];
		
		
		Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + BasketID);
		
		
	});
	
	
	$('#MasterBasket_Back').click(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		
		var BasketID = ClassArray[1];
		
		
		history.go(-1)
		
	});
	
	
	
	
	// #MasterBasket_Buy: Checkout to Payment page //
	$('#MasterBasket_Buy').mouseover(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		var NewClassName = ClassArray[0] + "_Hover";
		var BasketID = ClassArray[1];
		
		Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + BasketID);
		
	});
	
	
	
	$('#MasterBasket_Buy').mouseout(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		var NewClassName = Pix_str_replace(ClassArray[0],'_Hover','');
		var BasketID = ClassArray[1];
		
		
		Element.removeClass(Element.attr('class')).addClass(NewClassName + ' ' + BasketID);
		
		
	});
	
	
	$('#MasterBasket_Buy').click(function() {
		
		var Element = $(this);
		
		var ClassArray = Element.attr('class').split(' ');
		
		var BasketID = ClassArray[1];
		
		
		PX_CheckOutMasterBasket_Form();
		
		
		
	});
	
	function ValidateEmail(email) {
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	  
	   if(reg.test(email) == false) {
		  
		  return false;
	   }
	}
	
	function PX_CheckOutMasterBasket_Form() {
	
	var ErrorMessage = "";
	
	if ($('#Customer_Firstname').val() == "" || $('#Customer_Firstname').val() == "Fornavn") {
	
		ErrorMessage += "Du mangler at indtaste fornavn \n";
	
	}
	
	if ($('#Customer_Lastname').val() == "" || $('#Customer_Lastname').val() == "Efternavn") {
	
		ErrorMessage += "Du mangler at indtaste efternavn \n";
	
	}
	
	if ($('#Customer_Address1').val() == "" || $('#Customer_Address1').val() == "Adresse") {
	
		ErrorMessage += "Du mangler at indtaste addresse \n";
	
	}
	
	if ($('#Customer_ZipCode').val() == "" || $('#Customer_ZipCode').val() == "Postnr") {
	
		ErrorMessage += "Du mangler at indtaste dit postnr \n";
	
	}
	
	if ($('#Customer_City').val() == "" || $('#Customer_City').val() == "By") {
	
		ErrorMessage += "Du mangler at indtaste bynavn \n";
	
	}
	
	if (($('#Customer_Mobile').val() == ""  || $('#Customer_Mobile').val() == "Mobiltelefon")&& ($('#Customer_Phone').val() == "" || $('#Customer_Phone').val() == "Telefon")) {
	
		ErrorMessage += "Du skal oplyse telefonnummer eller mobilnummer \n";
	
	}
	
	if ($('#Customer_Email').val() == "" || $('#Customer_Email').val() == "Emailadresse") {
	
		ErrorMessage += "Du mangler at indtaste din emailadresse \n";
	
	} else if (ValidateEmail($('#Customer_Email').val()) == false) {
	
		ErrorMessage += "Du har ikke indtastet en gyldig emailadresse\n";
	
	}
	
	
	if ($('#UseDeliveryAddress:checked').val() !== undefined) {
	
	
	
		if ($('#Invoice_Name').val() == "" || $('#Invoice_Name').val() == "Fornavn og efternavn") {
	
			ErrorMessage += "Du mangler at indtaste navn under faktureringsadressen \n";
		
		}
		
		if ($('#Invoice_Address1').val() == "" || $('#Invoice_Address1').val() == "Adresse") {
	
			ErrorMessage += "Du mangler at indtaste adresse under faktureringsadressen \n";
		
		}
		
		if ($('#Invoice_ZipCode').val() == "" || $('#Invoice_ZipCode').val() == "Postnr") {
	
			ErrorMessage += "Du mangler at indtaste Postnummer under faktureringsadressen \n";
		
		}
		
		if ($('#Invoice_City').val() == "" || $('#Invoice_City').val() == "By") {
	
			ErrorMessage += "Du mangler at indtaste bynavn under faktureringsadressen \n";
		
		}
		
		
	}
	
	
	if ($('#UseInvoiceAddress:checked').val() !== undefined) {
		
			if ($('#Invoice_Email').val() == "" || $('#Invoice_Email').val() == "Emailadresse") {
		
				ErrorMessage += "Du mangler at indtaste emailadresse under faktureringsadressen \n";
			
			} else if (ValidateEmail($('#Invoice_Email').val()) == false) {
	
				ErrorMessage += "Du har ikke indtastet en gyldig emailadresse under leveringsadresse\n";
		
			}
			
	}
	
	
	
		if (ErrorMessage == "") {
		
			document.forms['PixilatorForm'].submit();
		
		} else {
		
			var ErrorMessage2 = "Fejl: \n";
			ErrorMessage2 = ErrorMessage2 + ErrorMessage;
			alert(ErrorMessage2);
		
		}
	
	} //function PX_CheckOutMasterBasket_Form() {
	
	
	
	
	
	
	
	
	
	
	
	if ($('#MasterBasketCenter').length > 0) {
	
	// We are on the Master Basket Page
	// Make both sides of master basket as long as the center content
	// I know - you might want to use display:table etc. instead, but 
	// IE7 does not support that ... so in the meantime....
	
	
	var MasterBasketheight = $('#MasterBasketCenter').height();
	
	$('#MasterBasketLeftSide').height(MasterBasketheight);
	$('#MasterBasketRightSide').height(MasterBasketheight);
	
	
	
	var BasketPersonalInfoHeight = $('#BasketPersonalInfoCenter').height();
	
	$('#BasketPersonalInfoLeftSide').height(BasketPersonalInfoHeight);
	$('#BasketPersonalInfoRightSide').height(BasketPersonalInfoHeight);
	
	}
	
	// *************************   END   ******************************* //
	
	
	
	
	
	// ********************* ACTIVITY MODULE  ************************** //
	
	
	// -------------   Code related to ActivityCenter   ---------------- //
	
	if (_GET['ActivityEventID'] != "") {
	
		$.cookie("ActivityID", _GET['ActivityEventID'], { path: '/' });
	
	}
	
	if (_GET['mode'] != "") {
	
		$.cookie("mode", _GET['mode'], { path: '/' });
	
	}
	
	
	
	// ---------------      Misc. corner() actions      ----------------- //
	
	
	$('.indholdsboks035_bodycell').corner();
	//$('.indholdsboks035_bodycell').fadeTo('fast', 0.75);
	$('.PixActivity_Home_ContentWrapper').corner();
	$('.PixActivity_Home_ForumWrapper').corner();
	
	
	
	//$('.indholdsboks035_bodycell').fadeTo("slow", 0.53);
	
	
	// -----------  Code related to Attendance Checklist  ------------- //
	
	function ToggleCheckMark(Element) {
		
		if (Element.attr('class').indexOf('PX_Activity_LargeCheckIcon') > -1) {
		
			Element.removeClass('PX_Activity_LargeCheckIcon').addClass('PX_Activity_LargeCheckNotIcon');
		
		} else {
		
			Element.removeClass('PX_Activity_LargeCheckNotIcon').addClass('PX_Activity_LargeCheckIcon');
			
		}
		
					var PostData = new Object();
							
					PostData.ClassVar = Element.attr('class');
					
					var PostJSON = $.toJSON(PostData);
					
					$.post('pixilator/Modules/ExtensionModules/Activity/files/Reports/ActivityEvent/UpdateAttendance.php',
						{PassedData: PostJSON},
						function(data) {
							
							var ReturnValue = $.evalJSON(data);
							
							//alert(ReturnValue['ErrorMessage']);
					
					});
		
	
	}
	
	
	$('.PX_Activity_LargeCheckIcon').click(function() {
		
		ToggleCheckMark($(this));
		
	});
	
	
	
	$('.PX_Activity_LargeCheckNotIcon').click(function() {
		
		ToggleCheckMark($(this));
		
	});
	
	
	
	// *************************   END   ******************************* //
	
	

});