﻿var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29159911-1']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} 

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} 
return strTemp;

} 

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} 
return strTemp;
} 



var digits = "0123456789";
var lowercaseLetters = "abcdefghijklmnopqrstuvwxyz"
var uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var whitespace = " \t\n\r";

var decimalPointDelimiter = "."

var phoneNumberDelimiters = "()- ";

var validUSPhoneChars = digits + phoneNumberDelimiters;

var validWorldPhoneChars = digits + phoneNumberDelimiters + "+";

var SSNDelimiters = "- ";

var validSSNChars = digits + SSNDelimiters;

var digitsInSocialSecurityNumber = 9;

var digitsInUSPhoneNumber = 10;

var ZIPCodeDelimiters = "-";

var ZIPCodeDelimeter = "-"

var validZIPCodeChars = digits + ZIPCodeDelimiters

var digitsInZIPCode1 = 5
var digitsInZIPCode2 = 9

var creditCardDelimiters = " "

function isOkBag (s, bag)

{   var i;
    var returnString = "";

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) return false;
    }
    return true;
}

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

function isWhiteSpace (s)
{   var i;

    if (isEmpty(s)) return true;

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    return true;
}

function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}

function stripCharsNotInBag (s, bag)

{   var i;
    var returnString = "";

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) != -1) returnString += c;
    }

    return returnString;
}

function stripWhitespace (s)

{   return stripCharsInBag (s, whitespace)
}

function charInString (c, s)
{   for (i = 0; i < s.length; i++)
    {   if (s.charAt(i) == c) return true;
    }
    return false
}

function stripInitialWhitespace (s)

{   var i = 0;

    while ((i < s.length) && charInString (s.charAt(i), whitespace))
       i++;
    
    return s.substring (i, s.length);
}

function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isLetterOrDigit (c)
{   return (isLetter(c) || isDigit(c))
}



function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);


    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    return true;
}

function isSignedInteger (s)

{   if (isEmpty(s)) 
       if (isSignedInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isSignedInteger.arguments[1] == true);

    else {
        var startPos = 0;
        var secondArg = defaultEmptyOK;

        if (isSignedInteger.arguments.length > 1)
            secondArg = isSignedInteger.arguments[1];

        if ( (s.charAt(0) == "-") || (s.charAt(0) == "+") )
           startPos = 1;    
        return (isInteger(s.substring(startPos, s.length), secondArg))
    }
}

function isPositiveInteger (s)
{   var secondArg = defaultEmptyOK;

    if (isPositiveInteger.arguments.length > 1)
        secondArg = isPositiveInteger.arguments[1];

    return (isSignedInteger(s, secondArg)
         && ( (isEmpty(s) && secondArg)  || (parseInt (s) > 0) ) );
}

function isNonnegativeInteger (s)
{   var secondArg = defaultEmptyOK;

    if (isNonnegativeInteger.arguments.length > 1)
        secondArg = isNonnegativeInteger.arguments[1];

    return (isSignedInteger(s, secondArg)
         && ( (isEmpty(s) && secondArg)  || (parseInt (s) >= 0) ) );
}


function isNegativeInteger (s)
{   var secondArg = defaultEmptyOK;

    if (isNegativeInteger.arguments.length > 1)
        secondArg = isNegativeInteger.arguments[1];

    return (isSignedInteger(s, secondArg)
         && ( (isEmpty(s) && secondArg)  || (parseInt (s) < 0) ) );
}


function isNonpositiveInteger (s)
{   var secondArg = defaultEmptyOK;

    if (isNonpositiveInteger.arguments.length > 1)
        secondArg = isNonpositiveInteger.arguments[1];

    return (isSignedInteger(s, secondArg)
         && ( (isEmpty(s) && secondArg)  || (parseInt (s) <= 0) ) );
}


function isFloat (s)

{   var i;
    var seenDecimalPoint = false;

    if (isEmpty(s)) 
       if (isFloat.arguments.length == 1) return defaultEmptyOK;
       else return (isFloat.arguments[1] == true);

    if (s == decimalPointDelimiter) return false;


    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);

        if ((c == decimalPointDelimiter) && !seenDecimalPoint) seenDecimalPoint = true;
        else if (!isDigit(c)) return false;
    }

    return true;
}


function isSignedFloat (s)

{   if (isEmpty(s)) 
       if (isSignedFloat.arguments.length == 1) return defaultEmptyOK;
       else return (isSignedFloat.arguments[1] == true);

    else {
        var startPos = 0;
        var secondArg = defaultEmptyOK;

        if (isSignedFloat.arguments.length > 1)
            secondArg = isSignedFloat.arguments[1];

        if ( (s.charAt(0) == "-") || (s.charAt(0) == "+") )
           startPos = 1;    
        return (isFloat(s.substring(startPos, s.length), secondArg))
    }
}


function isAlphabetic (s)

{   var i;

    if (isEmpty(s)) 
       if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphabetic.arguments[1] == true);

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);

        if (!isLetter(c))
        return false;
    }

    return true;
}

function isAlphanumeric (s)

{   var i;

    if (isEmpty(s)) 
       if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphanumeric.arguments[1] == true);

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);

        if (! (isLetter(c) || isDigit(c) ) )
        return false;
    }

    return true;
}

function reformat (s)

{   var arg;
    var sPos = 0;
    var resultString = "";

    for (var i = 1; i < reformat.arguments.length; i++) {
       arg = reformat.arguments[i];
       if (i % 2 == 1) resultString += arg;
       else {
           resultString += s.substring(sPos, sPos + arg);
           sPos += arg;
       }
    }
    return resultString;
}

function reformatZIPCode (ZIPString)
{   if (ZIPString.length == 5) return ZIPString;
    else return (reformat (ZIPString, "", 5, "-", 4));
}

function reformatUSPhone (USPhone)
{   return (reformat (USPhone, "(", 3, ") ", 3, "-", 4))
}

function reformatSSN (SSN)
{   return (reformat (SSN, "", 3, "-", 2, "-", 4))
}

function isLeapYear(argYear) {
	return ((argYear % 4 == 0) && (argYear % 100 != 0)) || (argYear % 400 == 0) 
}

function daysInMonth(argMonth, argYear) {
	switch (Number(argMonth)) {
		case 1:		// Jan
		case 3:		// Mar
		case 5:		// May
		case 7:		// Jul
		case 8:		// Aug
		case 10:		// Oct
		case 12:		// Dec
			return 31;
			break;
		
		case 4:		// Apr
		case 6:		// Jun
		case 9:		// Sep
		case 11:		// Nov
			return 30;
			break;
		
		case 2:		// Feb
			if (isLeapYear(argYear))
				return 29
			else
				return 28
			break;
		
		default:
			return 0;
	}
}

function getDateSeparator(argDate) {
	if ((argDate.indexOf('-') > 0) && (argDate.indexOf('/') > 0))
		return ' '

	if (argDate.indexOf('-') > 0)
		return '-'
	else
		if (argDate.indexOf('/') > 0)
			return '/'
		else
			return ' '
}

function getYear(argDate) {
	var dateSep = getDateSeparator(argDate)
	
	if (dateSep == ' ')
		return 0

	if(argDate.split(dateSep).length == 3)
		return argDate.split(dateSep)[2]
	else
		return 0
}

function getMonth(argDate) {
	var dateSep = getDateSeparator(argDate)
	
	if (dateSep == ' ')
		return 0

	if(argDate.split(dateSep).length == 3)
		return argDate.split(dateSep)[0]
	else
		return 0
}

function getDay(argDate) {
	var dateSep = getDateSeparator(argDate)
	
	if (dateSep == ' ')
		return 0

	if(argDate.split(dateSep).length == 3)
		return argDate.split(dateSep)[1]
	else
		return 0
}

function isProperDay(argDay, argMonth, argYear) {
	if ((isWhiteSpace(argDay)) || (argDay == 0))
		return false

	if ((argDay > 0) && (argDay < daysInMonth(argMonth, argYear) + 1))
		return true
	else 
		return false
}

function isProperMonth(argMonth) {
	if ((isWhiteSpace(argMonth)) || (argMonth == 0))
		return false
	
	if ((argMonth > 0) && (argMonth < 13))
		return true
	else
		return false
}

function isProperYear(argYear) {
	if ((isWhiteSpace(argYear)) || (argYear.toString().length > 4) || (argYear.toString().length == 3))
		return false
	
	switch (argYear.toString().length) {
		case 1:
			if (argYear >=0 && argYear < 10)
				return true
			else
				return false
			
		case 2:
			if (argYear >=0 && argYear < 100)
				return true
			else
				return false
			
		case 4:
			if (((argYear >=1900) || (argYear >=2000)) && ((argYear < 3000) || (argYear < 2000)))
				return true
			else
				return false
		
		default:
			return false
	}
}

function isProperDate(argDate) {
	var tmpDay = getDay(argDate)
	var tmpMon = getMonth(argDate)
	var tmpYear = getYear(argDate)

	return isProperDay(tmpDay, tmpMon, tmpYear) && isProperMonth(tmpMon) && isProperYear(tmpYear)
}

function charOccurences(argString, argChar) {
	var intCt = 0

	for(var intI=0; intI < argString.length; intI++)
		if (argString.charAt(intI) == argChar)
			intCt++
	
	return intCt
}

function isProperEmail(argEmail) {
	if (charOccurences(argEmail, '@') + charOccurences(argEmail, '.') < 2)
		return false

	var atPos = argEmail.indexOf('@')
	var dotPos = argEmail.indexOf('.')

	if((atPos == 0) || (atPos == (argEmail.length - 1)))
		return false

	if((dotPos == 0) || (dotPos == (argEmail.length - 1)))
		return false
	
	var checkTLD=1;
 
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
 
	var emailPat=/^(.+)@(.+)$/;
 
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
 
 
	var validChars="\[^\\s" + specialChars + "\]";
 
 
	var quotedUser="(\"[^\"]*\")";
 
 
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
 
 
	var atom=validChars + '+';
 
	var word="(" + atom + "|" + quotedUser + ")";
 
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
 
 
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
 
 
 
	var matchArray=argEmail.match(emailPat);
 
	if (matchArray==null)
		{
		return false;
		}
	var user=matchArray[1];
	var domain=matchArray[2];
 
	for (i=0; i<user.length; i++)
		{
		if (user.charCodeAt(i)>127)
			{
			return false;
			}
		}
	for (i=0; i<domain.length; i++)
		{
		if (domain.charCodeAt(i)>127)
			{
			return false;
			}
		}
 
	if (user.match(userPat)==null)
		{
		return false;
	}
 
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null)
		{
		for (var i=1;i<=4;i++)
			{
			if (IPArray[i]>255)
				{
				return false;
				}
			}
		return true;
		}
 
 
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++)
		{
		if (domArr[i].search(atomPat)==-1)
			{
			return false;
			}
		}
 
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)
		{
		return false;
		}
 
	if (len<2)
		{
		return false;
		}
 
	return true;
}

function isProperNumber(argNumber) {
	var numberValue = Number(argNumber)
	
	if (isNaN(numberValue)) 
		return false
	else
		return !isWhiteSpace(argNumber)
}

function isProperAlphabetic(argString) {
	var alphabets = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ"

	for(var intI=0; intI<argString.length; intI++)
		if (alphabets.indexOf(argString.charAt(intI)) == -1)
			return false
	
	return true
}

function objectValue(argFrm, argElem) {
	var intI
	var objElem = null

	for (intI=0; intI<argFrm.length; intI++)
		if (argFrm[intI].name == argElem) 
			objElem = argFrm[intI]

	switch (objElem.type) {
		case 'text':
		case 'hidden':
		case 'password':
			return objElem.value
			break;
		
		case 'select-one':
			if (objElem.length == 0)
				return ''
			else 
				return objElem.options[objElem.selectedIndex].value
			break;
		
		case 'radio':
			for (intI=0; intI<argFrm.length; intI++)
				if (argFrm[intI].name == argElem) 
					if (argFrm[intI].checked)
						return argFrm[intI].value

			return ''
			break;
	}
}

function objectFocus(argFrm, argElem) {
	var intI
	var objElem = null
	for (intI=0; intI<argFrm.length; intI++)
		if (argFrm[intI].name == argElem) 
			objElem = argFrm[intI]
	objElem.focus();
}

function isProperZip(argZip) {
	if ((argZip.length == 5) || (argZip.length == 9))
		return isProperNumber(argZip)
	
	if (argZip.length == 10)
		return (isProperNumber(argZip.substr(0, 5)) && isProperNumber(argZip.substr(6, 4)) & (argZip.charAt(5) == '-'))
}

function isProperUSPhone (argPhone)
{
	var argPhone2 = stripCharsNotInBag(argPhone,"0123456789")
    return (isOkBag(argPhone,"01234567890 -().") && isInteger(argPhone2) && argPhone2.length==digitsInUSPhoneNumber)
}

function isProperUSSSN(argSSN) {
	var argSSN2 = stripCharsNotInBag(argSSN,"0123456789")
    return (isOkBag(argSSN,"01234567890-") && isInteger(argSSN2) && argSSN2.length==11)
}

function actionFields(argActions) {
	this.email			= (argActions.indexOf('[email]') > -1)
	this.required		= (argActions.indexOf('[req]') > -1)
	this.checkDate		= (argActions.indexOf('[date]') > -1)
	this.checkZip		= (argActions.indexOf('[zip]') > -1)
	this.checkNumber	= (argActions.indexOf('[number]') > -1)
	this.checkAlphabetic= (argActions.indexOf('[alpha]') > -1)
	this.checkUSPhone	= (argActions.indexOf('[usphone]') > -1)
	this.checkUSSSN		= (argActions.indexOf('[usssn]') > -1)

	if (argActions.indexOf('[len=') > -1) {
		this.checkLength = true

		var lenToCheck = ''
		var bolCont = true

		for (var intI=(argActions.indexOf('[len=') +  5);((intI < argActions.length) && bolCont); intI++)
			if (argActions.charAt(intI) != ']')
				lenToCheck += argActions.charAt(intI)
			else
				bolCont = false
		this.lengthToCheck = lenToCheck
	}
	else
		this.checkLength = false

	if (argActions.indexOf('[blankalert=') > -1) {
		this.blankAlert = true

		var alertString = ''
		var bolCont = true

		for (var intI=(argActions.indexOf('[blankalert=') +  12);((intI < argActions.length) && bolCont); intI++)
			if (argActions.charAt(intI) != ']')
				alertString += argActions.charAt(intI)
			else
				bolCont = false
		this.blankAlertMessage = alertString
	}
	else
		this.blankAlert = false
	
	if (argActions.indexOf('[invalidalert=') > -1) {
		this.invalidAlert = true

		var alertString = ''
		var bolCont = true

		for (var intI=(argActions.indexOf('[invalidalert=') +  14);((intI < argActions.length) && bolCont); intI++)
			if (argActions.charAt(intI) != ']')
				alertString += argActions.charAt(intI)
			else
				bolCont = false
		this.invalidAlertMessage = alertString
	}
	else
		this.invalidAlert = false

	if (argActions.indexOf('[equals=') > -1) {
		this.shouldEqual = true

		var equalsString = ''
		var bolCont = true

		for (var intI=(argActions.indexOf('[equals=') +  8);((intI < argActions.length) && bolCont); intI++)
			if (argActions.charAt(intI) != ']')
				equalsString += argActions.charAt(intI)
			else
				bolCont = false
		this.shouldEqualString = equalsString
	}
	else
		this.shouldEqual = false

}


function validateForm(argForm)
	{
	var frmElements = argForm.elements
	var elemName
	var elemObj

	submitonce(argForm);

	for (var intI=0; intI < frmElements.length; intI++) {// *
		elemObj = frmElements[intI]
		elemName = elemObj.name

		if ((elemObj.type == 'hidden') && (elemName.length > 5))
			if (elemName.substr(elemName.length - 5).toLowerCase() == '_vldt') {// **
				var objAction = new actionFields(objectValue(frmElements, elemName))
				var actElem = elemName.substr(0, elemName.length - 5)
				
				if (objAction.required) {
					if (isWhiteSpace(objectValue(frmElements, actElem))) {// ***
						alert (objAction.blankAlert?objAction.blankAlertMessage:actElem + ' cannot be left blank')
						objectFocus(frmElements, actElem);
						submitenabled(argForm);
						return false
					} // ***
				}
				
				if ((objectValue(frmElements, actElem) > '') && (!isWhiteSpace(objectValue(frmElements, actElem)))){// ***
					if (objAction.checkDate)
						if (!isProperDate(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have an invalid date')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.checkNumber)
						if (!isProperNumber(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have an invalid number')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.checkZip)
						if (!isProperZip(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have an invalid zipcode')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.checkAlphabetic)
						if (!isProperAlphabetic(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have invalid characters')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.checkUSPhone)
						if (!isProperUSPhone(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have invalid characters')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.checkUSSSN)
						if (!isProperUSSSN(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have invalid characters')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.email)
						if (!isProperEmail(objectValue(frmElements, actElem))) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' cannot have invalid characters')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****

					if (objAction.checkLength)
						if (objectValue(frmElements, actElem).length < objAction.lengthToCheck) {// ****
							alert (objAction.invalidAlert?objAction.invalidAlertMessage:actElem + ' must be at least ' + objAction.lengthToCheck + ' characters long')
							objectFocus(frmElements, actElem);
							submitenabled(argForm);
							return false
						} // ****
				} // ***
			} // **
	} // *
		
	return true
}


function submitenabled(theform)
	{
	if (document.all||document.getElementById)
		{
		for (i=0;i<theform.length;i++)
			{
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit" || tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=false;
			}
		}
	}


function submitonce(theform)
	{
	if (document.all||document.getElementById)
		{
		for (i=0;i<theform.length;i++)
			{
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit" || tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
			}
		}
	}



/*
 * jQuery UI 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
 * jQuery UI Accordion 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	ui.core.js
 */
(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.1",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;



if(!document.createElement('canvas').getContext){(function(){var m=Math;var y=m.round;var z=m.sin;var A=m.cos;var Z=10;var B=Z/2;function getContext(){if(this.context_){return this.context_}return this.context_=new CanvasRenderingContext2D_(this)}var C=Array.prototype.slice;function bind(f,b,c){var a=C.call(arguments,2);return function(){return f.apply(b,a.concat(C.call(arguments)))}}var D={init:function(a){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var b=a||document;b.createElement('canvas');b.attachEvent('onreadystatechange',bind(this.init_,this,b))}},init_:function(a){if(!a.namespaces['g_vml_']){a.namespaces.add('g_vml_','urn:schemas-microsoft-com:vml')}if(!a.styleSheets['ex_canvas_']){var b=a.createStyleSheet();b.owningElement.id='ex_canvas_';b.cssText='canvas{display:inline-block;overflow:hidden;'+'text-align:left;width:300px;height:150px}'+'g_vml_\\:*{behavior:url(#default#VML)}'}},i:function(a){if(!a.getContext){a.getContext=getContext;a.attachEvent('onpropertychange',onPropertyChange);a.attachEvent('onresize',onResize);var b=a.attributes;if(b.width&&b.width.specified){a.style.width=b.width.nodeValue+'px'}else{a.width=a.clientWidth}if(b.height&&b.height.specified){a.style.height=b.height.nodeValue+'px'}else{a.height=a.clientHeight}}return a}};function onPropertyChange(e){var a=e.srcElement;switch(e.propertyName){case'width':a.style.width=a.attributes.width.nodeValue+'px';a.getContext().clearRect();break;case'height':a.style.height=a.attributes.height.nodeValue+'px';a.getContext().clearRect();break}}function onResize(e){var a=e.srcElement;if(a.firstChild){a.firstChild.style.width=a.clientWidth+'px';a.firstChild.style.height=a.clientHeight+'px'}}D.init();var E=[];for(var i=0;i<16;i++){for(var j=0;j<16;j++){E[i*16+j]=i.toString(16)+j.toString(16)}}function createMatrixIdentity(){return[[1,0,0],[0,1,0],[0,0,1]]}function processStyle(a){var b,alpha=1;a=String(a);if(a.substring(0,3)=='rgb'){var c=a.indexOf('(',3);var d=a.indexOf(')',c+1);var e=a.substring(c+1,d).split(',');b='#';for(var i=0;i<3;i++){b+=E[Number(e[i])]}if(e.length==4&&a.substr(3,1)=='a'){alpha=e[3]}}else{b=a}return[b,alpha]}function processLineCap(a){switch(a){case'butt':return'flat';case'round':return'round';case'square':default:return'square'}}function CanvasRenderingContext2D_(a){this.m_=createMatrixIdentity();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle='#000';this.fillStyle='#000';this.lineWidth=1;this.lineJoin='miter';this.lineCap='butt';this.miterLimit=Z*1;this.globalAlpha=1;this.canvas=a;var b=a.ownerDocument.createElement('div');b.style.width=a.clientWidth+'px';b.style.height=a.clientHeight+'px';b.style.overflow='hidden';b.style.position='absolute';a.appendChild(b);this.element_=b;this.arcScaleX_=1;this.arcScaleY_=1}var F=CanvasRenderingContext2D_.prototype;F.clearRect=function(){this.element_.innerHTML='';this.currentPath_=[]};F.beginPath=function(){this.currentPath_=[]};F.moveTo=function(a,b){var p=this.getCoords_(a,b);this.currentPath_.push({type:'moveTo',x:p.x,y:p.y});this.currentX_=p.x;this.currentY_=p.y};F.lineTo=function(a,b){var p=this.getCoords_(a,b);this.currentPath_.push({type:'lineTo',x:p.x,y:p.y});this.currentX_=p.x;this.currentY_=p.y};F.bezierCurveTo=function(a,b,c,d,e,f){var p=this.getCoords_(e,f);var g=this.getCoords_(a,b);var h=this.getCoords_(c,d);this.currentPath_.push({type:'bezierCurveTo',cp1x:g.x,cp1y:g.y,cp2x:h.x,cp2y:h.y,x:p.x,y:p.y});this.currentX_=p.x;this.currentY_=p.y};F.fillRect=function(a,b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.fill();this.currentPath_=[]};F.createLinearGradient=function(a,b,c,d){return new CanvasGradient_('gradient')};F.createRadialGradient=function(a,b,c,d,e,f){var g=new CanvasGradient_('gradientradial');g.radius1_=c;g.radius2_=f;g.focus_.x=a;g.focus_.y=b;return g};F.stroke=function(d){var e=[];var f=false;var a=processStyle(d?this.fillStyle:this.strokeStyle);var g=a[0];var h=a[1]*this.globalAlpha;var W=10;var H=10;e.push('<g_vml_:shape',' fillcolor="',g,'"',' filled="',Boolean(d),'"',' style="position:absolute;width:',W,';height:',H,';"',' coordorigin="0 0" coordsize="',Z*W,' ',Z*H,'"',' stroked="',!d,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',g,'"',' path="');var j=false;var k={x:null,y:null};var l={x:null,y:null};for(var i=0;i<this.currentPath_.length;i++){var p=this.currentPath_[i];var c;switch(p.type){case'moveTo':e.push(' m ');c=p;e.push(y(p.x),',',y(p.y));break;case'lineTo':e.push(' l ');e.push(y(p.x),',',y(p.y));break;case'close':e.push(' x ');p=null;break;case'bezierCurveTo':e.push(' c ');e.push(y(p.cp1x),',',y(p.cp1y),',',y(p.cp2x),',',y(p.cp2y),',',y(p.x),',',y(p.y));break;case'at':case'wa':e.push(' ',p.type,' ');e.push(y(p.x-this.arcScaleX_*p.radius),',',y(p.y-this.arcScaleY_*p.radius),' ',y(p.x+this.arcScaleX_*p.radius),',',y(p.y+this.arcScaleY_*p.radius),' ',y(p.xStart),',',y(p.yStart),' ',y(p.xEnd),',',y(p.yEnd));break}if(p){if(k.x==null||p.x<k.x){k.x=p.x}if(l.x==null||p.x>l.x){l.x=p.x}if(k.y==null||p.y<k.y){k.y=p.y}if(l.y==null||p.y>l.y){l.y=p.y}}}e.push(' ">');if(typeof this.fillStyle=='object'){var m={x:'50%',y:'50%'};var n=l.x-k.x;var o=l.y-k.y;var q=n>o?n:o;m.x=y(this.fillStyle.focus_.x/n*100+50)+'%';m.y=y(this.fillStyle.focus_.y/o*100+50)+'%';var r=[];if(this.fillStyle.type_=='gradientradial'){var s=this.fillStyle.radius1_/q*100;var t=this.fillStyle.radius2_/q*100-s}else{var s=0;var t=100}var u={offset:null,color:null};var v={offset:null,color:null};this.fillStyle.colors_.sort(function(a,b){return a.offset-b.offset});for(var i=0;i<this.fillStyle.colors_.length;i++){var w=this.fillStyle.colors_[i];r.push(w.offset*t+s,'% ',w.color,',');if(w.offset>u.offset||u.offset==null){u.offset=w.offset;u.color=w.color}if(w.offset<v.offset||v.offset==null){v.offset=w.offset;v.color=w.color}}r.pop();e.push('<g_vml_:fill',' color="',v.color,'"',' color2="',u.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',m.x,', ',m.y,'"',' colors="',r.join(''),'"',' opacity="',h,'" />')}else if(d){e.push('<g_vml_:fill color="',g,'" opacity="',h,'" />')}else{var x=Math.max(this.arcScaleX_,this.arcScaleY_)*this.lineWidth;e.push('<g_vml_:stroke',' opacity="',h,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',processLineCap(this.lineCap),'"',' weight="',x,'px"',' color="',g,'" />')}e.push('</g_vml_:shape>');this.element_.insertAdjacentHTML('beforeEnd',e.join(''))};F.fill=function(){this.stroke(true)};F.closePath=function(){this.currentPath_.push({type:'close'})};F.getCoords_=function(a,b){return{x:Z*(a*this.m_[0][0]+b*this.m_[1][0]+this.m_[2][0])-B,y:Z*(a*this.m_[0][1]+b*this.m_[1][1]+this.m_[2][1])-B}};function CanvasPattern_(){}G_vmlCMjrc=D})()}if(jQuery.browser.msie){document.execCommand("BackgroundImageCache",false,true)}(function($){var N=$.browser.msie;var O=N&&!window.XMLHttpRequest;var P=$.browser.opera;var Q=typeof document.createElement('canvas').getContext=="function";var R=function(i){return parseInt(i,10)||0};var S=function(a,b,c){var x=a,y;if(x.currentStyle){y=x.currentStyle[b]}else if(window.getComputedStyle){if(typeof arguments[2]=="string")b=c;y=document.defaultView.getComputedStyle(x,null).getPropertyValue(b)}return y};var T=function(a,p){return S(a,'border'+p+'Color','border-'+p.toLowerCase()+'-color')};var U=function(a,p){if(a.currentStyle&&!P){w=a.currentStyle['border'+p+'Width'];if(w=='thin')w=2;if(w=='medium'&&!(a.currentStyle['border'+p+'Style']=='none'))w=4;if(w=='thick')w=6}else{p=p.toLowerCase();w=document.defaultView.getComputedStyle(a,null).getPropertyValue('border-'+p+'-width')}return R(w)};var V=function(a,i){return a.tagName.toLowerCase()==i};var W=function(e,a,b,c,d){if(e=='tl')return a;if(e=='tr')return b;if(e=='bl')return c;if(e=='br')return d};var X=function(a,b,c,d,e,f,g){var h,curve_to;if(d.indexOf('rgba')!=-1){var i=/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/;var j=i.exec(d);if(j){var k=[R(j[1]),R(j[2]),R(j[3])];d='rgb('+k[0]+', '+k[1]+', '+k[2]+')'}}var l=a.getContext('2d');if(b==1||g=='notch'){if(e>0&&b>1){l.fillStyle=f;l.fillRect(0,0,b,b);l.fillStyle=d;h=W(c,[0-e,0-e],[e,0-e],[0-e,e],[e,e]);l.fillRect(h[0],h[1],b,b)}else{l.fillStyle=d;l.fillRect(0,0,b,b)}return a}else if(g=='bevel'){h=W(c,[0,0,0,b,b,0,0,0],[0,0,b,b,b,0,0,0],[0,0,b,b,0,b,0,0],[b,b,b,0,0,b,b,b]);l.fillStyle=d;l.beginPath();l.moveTo(h[0],h[1]);l.lineTo(h[2],h[3]);l.lineTo(h[4],h[5]);l.lineTo(h[6],h[7]);l.fill();if(e>0&&e<b){l.strokeStyle=f;l.lineWidth=e;l.beginPath();h=W(c,[0,b,b,0],[0,0,b,b],[b,b,0,0],[0,b,b,0]);l.moveTo(h[0],h[1]);l.lineTo(h[2],h[3]);l.stroke()}return a}h=W(c,[0,0,b,0,b,0,0,b,0,0],[b,0,b,b,b,0,0,0,0,0],[0,b,b,b,0,b,0,0,0,b],[b,b,b,0,b,0,0,b,b,b]);l.fillStyle=d;l.beginPath();l.moveTo(h[0],h[1]);l.lineTo(h[2],h[3]);if(c=='br')l.bezierCurveTo(h[4],h[5],b,b,h[6],h[7]);else l.bezierCurveTo(h[4],h[5],0,0,h[6],h[7]);l.lineTo(h[8],h[9]);l.fill();if(e>0&&e<b){var m=e/2;var n=b-m;h=W(c,[n,m,n,m,m,n],[n,n,n,m,m,m],[n,n,m,n,m,m,m,n],[n,m,n,m,m,n,n,n]);curve_to=W(c,[0,0],[0,0],[0,0],[b,b]);l.strokeStyle=f;l.lineWidth=e;l.beginPath();l.moveTo(h[0],h[1]);l.bezierCurveTo(h[2],h[3],curve_to[0],curve_to[1],h[4],h[5]);l.stroke()}return a};var Y=function(p,a){var b=document.createElement('canvas');b.setAttribute("height",a);b.setAttribute("width",a);b.style.display="block";b.style.position="absolute";b.className="jrCorner";Z(p,b);if(!Q&&N){if(typeof G_vmlCanvasManager=="object"){b=G_vmlCanvasManager.initElement(b)}else if(typeof G_vmlCMjrc=="object"){b=G_vmlCMjrc.i(b)}else{throw Error('Could not find excanvas');}}return b};var Z=function(p,a){if(p.is("table")){p.children("tbody").children("tr:first").children("td:first").append(a);p.css('display','block')}else if(p.is("td")){if(p.children(".JrcTdContainer").length===0){p.html('<div class="JrcTdContainer" style="padding:0px;position:relative;margin:-1px;zoom:1;">'+p.html()+'</div>');p.css('zoom','1');if(O){p.children(".JrcTdContainer").get(0).style.setExpression("height","this.parentNode.offsetHeight")}}p.children(".JrcTdContainer").append(a)}else{p.append(a)}};if(N){var ba=document.createStyleSheet();ba.media='print';ba.cssText='.jrcIECanvasDiv { display:none !important; }'}var bb=function(D){if(this.length==0||!(Q||N)){return this}if(D=="destroy"){return this.each(function(){var p,elm=$(this);if(elm.is(".jrcRounded")){if(typeof elm.data("ie6tmr.jrc")=='number')window.clearInterval(elm.data("ie6tmr.jrc"));if(elm.is("table"))p=elm.children("tbody").children("tr:first").children("td:first");else if(elm.is("td"))p=elm.children(".JrcTdContainer");else p=elm;p.children(".jrCorner").remove();elm.unbind('mouseleave.jrc').unbind('mouseenter.jrc').removeClass('jrcRounded').removeData('ie6tmr.jrc');if(elm.is("td"))elm.html(elm.children(".JrcTdContainer").html())}})}var o=(D||"").toLowerCase();var E=R((o.match(/(\d+)px/)||[])[1])||"auto";var F=((o.match(/(#[0-9a-f]+)/)||[])[1])||"auto";var G=/round|bevel|notch/;var H=((o.match(G)||['round'])[0]);var I=/hover/.test(o);var J=/oversized/.test(o);var K=o.match("hiddenparent");if(N){var G=/ie6nofix|ie6fixinit|ie6fixexpr|ie6fixonload|ie6fixwidthint|ie6fixheightint|ie6fixbothint/;var L=((o.match(G)||['ie6fixinit'])[0])}var M={tl:/top|left|tl/.test(o),tr:/top|right|tr/.test(o),bl:/bottom|left|bl/.test(o),br:/bottom|right|br/.test(o)};if(!M.tl&&!M.tr&&!M.bl&&!M.br)M={tl:1,tr:1,bl:1,br:1};this.each(function(){var d=$(this),rbg=null,bg,s,b,pr;var a=this;var e=S(this,'display');var f=S(this,'position');var g=S(this,'lineHeight','line-height');if(F=="auto"){s=d.siblings(".jrcRounded:eq(0)");if(s.length>0){b=s.data("rbg.jrc");if(typeof b=="string"){rbg=b}}}if(K||rbg===null){var h=this.parentNode,hidden_parents=new Array(),a=0;while((typeof h=='object')&&!V(h,'html')){if(K&&S(h,'display')=='none'){hidden_parents.push({originalvisibility:S(h,'visibility'),elm:h});h.style.display='block';h.style.visibility='hidden'}var j=S(h,'backgroundColor','background-color');if(rbg===null&&j!="transparent"&&j!="rgba(0, 0, 0, 0)"){rbg=j}h=h.parentNode}if(rbg===null)rbg="#ffffff"}if(F=="auto"){bg=rbg;d.data("rbg.jrc",rbg)}else{bg=F}if(e=='none'){var k=S(this,'visibility');this.style.display='block';this.style.visibility='hidden';var l=true}else{var m=false}var n=d.height();var p=d.width();if(I){var q=o.replace(/hover|ie6nofix|ie6fixinit|ie6fixexpr|ie6fixonload|ie6fixwidthint|ie6fixheightint|ie6fixbothint/g,"");if(L!='ie6nofix')q="ie6fixinit "+q;d.bind("mouseenter.jrc",function(){d.addClass('jrcHover');d.corner(q)});d.bind("mouseleave.jrc",function(){d.removeClass('jrcHover');d.corner(q)})}if(O&&L!='ie6nofix'){this.style.zoom=1;if(L!='ie6fixexpr'){if(d.width()%2!=0)d.width(d.width()+1);if(d.height()%2!=0)d.height(d.height()+1)}$(window).load(function(){if(L=='ie6fixonload'){if(d.css('height')=='auto')d.height(d.css('height'));if(d.width()%2!=0)d.width(d.width()+1);if(d.height()%2!=0)d.height(d.height()+1)}else if(L=='ie6fixwidthint'||L=='ie6fixheightint'||L=='ie6fixbothint'){var c,ie6FixFunction;if(L=='ie6fixheightint'){ie6FixFunction=function(){d.height('auto');var a=d.height();if(a%2!=0)a=a+1;d.css({height:a})}}else if(L=='ie6fixwidthint'){ie6FixFunction=function(){d.width('auto');var a=d.width();if(a%2!=0)a=a+1;d.css({width:a});d.data('lastWidth.jrc',d.get(0).offsetWidth)}}else if(L=='ie6fixbothint'){ie6FixFunction=function(){d.width('auto');d.height('auto');var a=d.width();var b=d.height();if(b%2!=0)b=b+1;if(a%2!=0)a=a+1;d.css({width:a,height:b})}}c=window.setInterval(ie6FixFunction,100);d.data("ie6tmr.jrc",c)}})}var r=n<p?this.offsetHeight:this.offsetWidth;if(E=="auto"){E=r/2;if(E>10)E=r/4}if(E>r/2&&!J){E=r/2}E=Math.floor(E);var t=U(this,'Top');var u=U(this,'Right');var v=U(this,'Bottom');var w=U(this,'Left');if(f=='static'&&!V(this,'td')){this.style.position='relative'}else if(f=='fixed'&&N&&!(document.compatMode=='CSS1Compat'&&!O)){this.style.position='absolute'}if(t+u+v+w>0){this.style.overflow='visible'}if(l)d.css({display:'none',visibility:k});if(typeof hidden_parents!="undefined"){for(var i=0;i<hidden_parents.length;i++){hidden_parents[i].elm.style.display='none';hidden_parents[i].elm.style.visibility=hidden_parents[i].originalvisibility}}var x=0-t,p_right=0-u,p_bottom=0-v,p_left=0-w;var y=(d.find("canvas").length>0);if(y){if(V(this,'table'))pr=d.children("tbody").children("tr:first").children("td:first");else if(V(this,'td'))pr=d.children(".JrcTdContainer");else pr=d}if(M.tl){bordersWidth=t<w?t:w;if(y)pr.children("canvas.jrcTL").remove();var z=X(Y(d,E),E,'tl',bg,bordersWidth,T(this,'Top'),H);$(z).css({left:p_left,top:x}).addClass('jrcTL')}if(M.tr){bordersWidth=t<u?t:u;if(y)pr.children("canvas.jrcTR").remove();var A=X(Y(d,E),E,'tr',bg,bordersWidth,T(this,'Top'),H);$(A).css({right:p_right,top:x}).addClass('jrcTR')}if(M.bl){bordersWidth=v<w?v:w;if(y)pr.children("canvas.jrcBL").remove();var B=X(Y(d,E),E,'bl',bg,bordersWidth,T(this,'Bottom'),H);$(B).css({left:p_left,bottom:p_bottom}).addClass('jrcBL')}if(M.br){bordersWidth=v<u?v:u;if(y)pr.children("canvas.jrcBR").remove();var C=X(Y(d,E),E,'br',bg,bordersWidth,T(this,'Bottom'),H);$(C).css({right:p_right,bottom:p_bottom}).addClass('jrcBR')}if(N)d.children('canvas.jrCorner').children('div').addClass('jrcIECanvasDiv');if(O&&L=='ie6fixexpr'){if(M.bl){B.style.setExpression("bottom","this.parentNode.offsetHeight % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])) : 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])+1)")}if(M.br){C.style.setExpression("right","this.parentNode.offsetWidth  % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderRightWidth']))  : 0-(parseInt(this.parentNode.currentStyle['borderRightWidth'])+1)");C.style.setExpression("bottom","this.parentNode.offsetHeight % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])) : 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])+1)")}if(M.tr){A.style.setExpression("right","this.parentNode.offsetWidth   % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderRightWidth']))  : 0-(parseInt(this.parentNode.currentStyle['borderRightWidth'])+1)")}}d.addClass('jrcRounded')});if(typeof arguments[1]=="function")arguments[1](this);return this};$.fn.corner=bb})(jQuery);




/* Copyright 2008 MagicToolBox.com. To use this code on your own site, visit http://magictoolbox.com */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('a m=\'K\';a W=48.4b.1V();9(W.2t("1B")!=-1){m=\'1B\'}B 9(W.2t("K")!=-1){m=\'K\'}B 9(W.2t("1F")!=-1){m=\'1F\'}B 9(W.2t("4e")!=-1){m=\'2o\'}a 1I=1n 4d();n 1p$(I){q b.4g(I)};n F(2q,2K){9(2q.3S){a y=2q.3S[2K];y=g(y)?y:\'J\'}B 9(1f.3W){a 30=b.43.3W(2q,1T);a y=30?30[2K]:1T}B{y=2q.8[2K];y=g(y)?y:\'J\'}q y};n 2s(e){9(e.3Y){a r=e.3Y();a 2d=0;a 2f=0;9(b.17&&(b.17.1s||b.17.1w)){2f=b.17.1w;2d=b.17.1s}B 9(b.1d&&(b.1d.1s||b.1d.1w)){2f=b.1d.1w;2d=b.1d.1s}q{\'z\':r.z+2d,\'H\':r.H+2f,\'2C\':r.2C+2d,\'1Z\':r.1Z+2f}}}n 34(e){a x=0;a y=0;9(m==\'K\'){y=e.2E;x=e.2G;9(b.17&&(b.17.1s||b.17.1w)){y=e.2E+b.17.1w;x=e.2G+b.17.1s}B 9(b.1d&&(b.1d.1s||b.1d.1w)){y=e.2E+b.1d.1w;x=e.2G+b.1d.1s}}B{y=e.2E;x=e.2G;y+=1f.4A;x+=1f.4y}q{\'x\':x,\'y\':y}}n 2T(){q L};a 3c=n(){a 1k=22;9(!1k[1])1k=[7,1k[0]];1r(a 2U 4j 1k[1])1k[0][2U]=1k[1][2U];q 1k[0]};n 1g(1Y,1e,28){9(m==\'2o\'||m==\'1B\'||m==\'1F\'){3h{1Y.4i(1e,28,L)}3e(e){}}B 9(m==\'K\'){1Y.4q("2S"+1e,28)}};n 39(1Y,1e,28){9(m==\'2o\'||m==\'1B\'||m==\'1F\'){1Y.4w(1e,28,L)}B 9(m==\'K\'){1Y.4o("2S"+1e,28)}};n 3p(){a 24=[];1r(a i=0;i<22.1m;i++)1r(a j=0;j<22[i].1m;j++)24.2V(22[i][j]);q 24};n 3q(2P,3s){24=[];1r(a i=3s;i<2P.1m;i++)24.2V(2P[i]);q 24};n 1j(2Q,3t){a 1k=3q(22,2);q n(){2Q[3t].4m(2Q,3p(1k,22))}};n 1P(e){9(m==\'2o\'||m==\'1F\'||m==\'1B\'){e.3v=N;e.4r();e.4s()}B 9(m==\'K\'){1f.1e.3v=N}};n Q(3n,3o,3w,3L,k){7.4z=\'2.3\';7.2B=L;7.G=1p$(3n);7.l=1p$(3o);7.c=1p$(3w);7.o=1p$(3L);7.D=0;7.k=k;9(!7.k["1u"]){7.k["1u"]=""}7.1h=0;7.1b=0;7.O=0;7.T=0;7.U=20;7.4h=20;7.1o=0;7.1v=0;7.1t=\'\';7.P=1T;9(7.k["1N"]!=\'\'){7.P=b.13(\'2h\');7.P.8.t=\'1H\';7.P.8.1q=\'1G\';7.P.26=\'40\';7.P.8.2M=\'2J\';7.P.8.3X=\'4t\';7.P.2X=7.k["1O"]+\'<4u/><11 4v="0" 3f="\'+7.k["1O"]+\'" 1c="\'+7.k["1N"]+\'"/>\';7.G.18(7.P)}7.4B=\'\';7.2v=L;1I.2V(7);7.3i=1j(7,"2y");7.3a=1j(7,"1U")};Q.16.3T=n(){39(1f.b,"1U",7.3i);39(7.G,"1U",7.3a);9(7.k["t"]=="21"){1p$(7.G.I+"-3H").2a(7.c)}B{7.G.2a(7.c)}7.G.2a(7.D)};Q.16.2y=n(e){a r=34(e);a x=r[\'x\'];a y=r[\'y\'];a Y=0;a X=0;a R=7.l;29(R&&R.1Q!="3J"&&R.1Q!="3K"){Y+=R.3F;X+=R.3E;R=R.3A}9(m==\'K\'){a r=2s(7.l);X=r[\'z\'];Y=r[\'H\']}X+=g(F(7.l,\'2b\'));Y+=g(F(7.l,\'2Z\'));9(m!=\'K\'||!(b.1i&&\'2l\'==b.1i.1V())){X+=g(F(7.l,\'2c\'));Y+=g(F(7.l,\'2r\'))}9(x>g(X+7.O)){7.2g();q L}9(x<g(X)){7.2g();q L}9(y>g(Y+7.T)){7.2g();q L}9(y<g(Y)){7.2g();q L}9(m==\'K\'){7.G.8.25=1}q N};Q.16.3j=n(e){1P(e);7.G.8.2Y=\'3I\'};Q.16.3k=n(e){1P(e);7.G.8.2Y=\'44\'};Q.16.1U=n(e){1P(e);1r(i=0;i<1I.1m;i++){9(1I[i]!=7){1I[i].2y(e)}}9(7.k&&7.k["1C"]==N){9(7.G.8.2Y!=\'3I\'){q}}9(7.2B){q}9(!7.2y(e)){q}7.2B=N;a 2w=7.l;a X=0;a Y=0;9(m==\'2o\'||m==\'1B\'||m==\'1F\'){a R=2w;29(R&&R.1Q!="3J"&&R.1Q!="3K"){Y+=R.3F;X+=R.3E;R=R.3A}}B{a r=2s(7.l);X=r[\'z\'];Y=r[\'H\']}X+=g(F(7.l,\'2b\'));Y+=g(F(7.l,\'2Z\'));9(m!=\'K\'||!(b.1i&&\'2l\'==b.1i.1V())){X+=g(F(7.l,\'2c\'));Y+=g(F(7.l,\'2r\'))}a r=34(e);a x=r[\'x\'];a y=r[\'y\'];7.1o=x-X;7.1v=y-Y;9((7.1o+7.U/2)>=7.O){7.1o=7.O-7.U/2}9((7.1v+7.12/2)>=7.T){7.1v=7.T-7.12/2}9((7.1o-7.U/2)<=0){7.1o=7.U/2}9((7.1v-7.12/2)<=0){7.1v=7.12/2}36(1j(7,"3b"),10)};Q.16.3b=n(){a 2p=7.1o-7.U/2;a 2n=7.1v-7.12/2;a 2k=2p*(7.1h/7.O);a 2A=2n*(7.1b/7.T);9(b.1d.49==\'4a\'){2k=(7.1o+7.U/2-7.O)*(7.1h/7.O)}2p+=g(F(7.l,\'2b\'));2n+=g(F(7.l,\'2Z\'));9(m!=\'K\'||!(b.1i&&\'2l\'==b.1i.1V())){2p+=g(F(7.l,\'2c\'));2n+=g(F(7.l,\'2r\'))}7.D.8.z=2p+\'v\';7.D.8.H=2n+\'v\';7.D.8.1q="2N";9((7.1h-2k)<g(7.c.8.C)){2k=7.1h-g(7.c.8.C)}a 2j=0;9(7.k&&7.k["1u"]!=""){a 2j=19}9(7.1b>(g(7.c.8.u)-2j)){9((7.1b-2A)<(g(7.c.8.u)-2j)){2A=7.1b-g(7.c.8.u)+2j}}7.o.8.z=(-2k)+\'v\';7.o.8.H=(-2A)+\'v\';7.c.8.H=7.1t;7.c.8.2M=\'2J\';7.c.8.1q=\'2N\';7.o.8.2M=\'2J\';7.o.8.1q=\'2N\';7.2B=L};n 3M(32){a 31="";1r(i=0;i<32.1m;i++){31+=4C.5c(14^32.5m(i))}q 31};Q.16.2g=n(){9(7.k&&7.k["23"]==N)q;9(7.D){7.D.8.1q="1G"}7.c.8.H=\'-1S\';9(m==\'K\'){7.G.8.25=0}};Q.16.2R=n(){7.U=g(7.c.8.C)/(7.1h/7.O);9(7.k&&7.k["1u"]!=""){7.12=(g(7.c.8.u)-19)/(7.1b/7.T)}B{7.12=g(7.c.8.u)/(7.1b/7.T)}9(7.U>7.O){7.U=7.O}9(7.12>7.T){7.12=7.T}7.U=2L.3d(7.U);7.12=2L.3d(7.12);9(!(b.1i&&\'2l\'==b.1i.1V())){a 37=g(F(7.D,\'2b\'));7.D.8.C=(7.U-2*37)+\'v\';7.D.8.u=(7.12-2*37)+\'v\'}B{7.D.8.C=7.U+\'v\';7.D.8.u=7.12+\'v\'}};Q.16.3z=n(){7.D=b.13("2h");7.D.26=\'5h\';7.D.8.25=10;7.D.8.1q=\'1G\';7.D.8.t=\'1H\';7.D.8["Z"]=35(7.k[\'Z\']/27.0);7.D.8["-5e-Z"]=35(7.k[\'Z\']/27.0);7.D.8["-5d-Z"]=35(7.k[\'Z\']/27.0);7.D.8["3x"]="5a(5b="+7.k[\'Z\']+")";7.G.18(7.D);7.2R();7.G.5j="2S";7.G.8.5p="3C";7.G.5k=2T;7.G.5l=2T};Q.16.38=n(3m){a 3u=7.o.1c;9(7.1b<g(7.c.8.u)){7.c.8.u=7.1b+\'v\';9(7.k&&7.k["1u"]!=""){7.c.8.u=(19+7.1b)+\'v\'}}9(7.1h<g(7.c.8.C)){7.c.8.C=7.1h+\'v\'}9(3m)q;29(7.c.1z){7.c.2a(7.c.1z)}9(m==\'K\'){a f=b.13("5i");f.8.z=\'J\';f.8.H=\'J\';f.8.t=\'1H\';f.1c="57:\'\'";f.8.3x=\'4M:4L.4N.4O(8=0,Z=0)\';f.8.C=7.c.8.C;f.8.u=7.c.8.u;f.4Q=0;7.c.18(f)}9(7.k&&7.k["1u"]!=""){a f=b.13("2h");f.26=\'2u\';f.I=\'2u\'+7.c.I;f.8.t=\'2e\';f.8.25=10;f.8.z=\'J\';f.8.H=\'J\';f.8.33=\'58\';f.2X=7.k["1u"];7.c.18(f)}a 2O=b.13("2h");2O.8.3r="1G";7.c.18(2O);7.o=b.13("1y");7.o.1c=3u;7.o.8.t=\'2e\';7.o.8.3U=\'J\';7.o.8.33=\'J\';7.o.8.z=\'J\';7.o.8.H=\'J\';2O.18(7.o);9(\'4P\'!==4K(1x)){a 41=3M(1x[0]);a f=b.13("4J");f.8.4E=1x[1];f.8.4D=1x[2]+\'v\';f.8.4F=1x[3];f.8.4G=\'4I\';f.8.t=\'1H\';f.8.C=1x[5];f.8.3X=1x[4];f.2X=41;f.8.z=\'J\';f.8.H=g(7.c.8.u)-1x[6]+\'v\';7.c.18(f)}};Q.16.1W=n(){9(7.P!=1T&&(!7.o.2W||0==7.o.C||0==7.o.u)&&7.l.C!=0&&7.l.u!=0){7.P.8.z=(g(7.l.C)/2-g(7.P.4R)/2)+\'v\';7.P.8.H=(g(7.l.u)/2-g(7.P.4S)/2)+\'v\';7.P.8.1q=\'2N\'}9(m==\'1F\'){9(!7.2v){1g(7.o,"3N",1j(7,"1W"));7.2v=N;q}}B{9(!7.o.2W||!7.l.2W){36(1j(7,"1W"),27);q}}7.o.8.3U=\'J\';7.o.8.33=\'J\';7.1h=7.o.C;7.1b=7.o.u;7.O=7.l.C;7.T=7.l.u;9(7.1h==0||7.1b==0||7.O==0||7.T==0){36(1j(7,"1W"),27);q}9(m==\'1B\'||(m==\'K\'&&!(b.1i&&\'2l\'==b.1i.1V()))){7.O-=g(F(7.l,\'2c\'));7.O-=g(F(7.l,\'3O\'));7.T-=g(F(7.l,\'2r\'));7.T-=g(F(7.l,\'4V\'))}9(7.P!=1T)7.P.8.1q=\'1G\';7.G.8.C=7.l.C+\'v\';7.c.8.H=\'-1S\';7.1t=\'J\';a r=2s(7.l);9(!r){7.c.8.z=7.O+g(F(7.l,\'2b\'))+g(F(7.l,\'4X\'))+g(F(7.l,\'2c\'))+g(F(7.l,\'3O\'))+15+\'v\'}B{7.c.8.z=(r[\'2C\']-r[\'z\']+15)+\'v\'}3G(7.k[\'t\']){1l\'z\':7.c.8.z=\'-\'+(15+g(7.c.8.C))+\'v\';1a;1l\'1Z\':9(r){7.1t=r[\'1Z\']-r[\'H\']+15+\'v\'}B{7.1t=7.l.u+15+\'v\'}7.c.8.z=\'J\';1a;1l\'H\':7.1t=\'-\'+(15+g(7.c.8.u))+\'v\';7.c.8.z=\'J\';1a;1l\'21\':7.c.8.z=\'J\';7.1t=\'J\';1a;1l\'2I\':7.c.8.z=\'J\';7.1t=\'J\';9(7.k[\'1J\']==-1){7.c.8.C=7.O+\'v\'}9(7.k[\'1D\']==-1){7.c.8.u=7.T+\'v\'}1a}9(7.D){7.2R();7.38(N);q}7.38();7.3z();1g(1f.b,"1U",7.3i);1g(7.G,"1U",7.3a);9(7.k&&7.k["1C"]==N){1g(7.G,"3j",1j(7,"3j"));1g(7.G,"3k",1j(7,"3k"))}9(7.k&&(7.k["1C"]==N||7.k["23"]==N)){7.1o=7.O/2;7.1v=7.T/2;7.3b()}};Q.16.3g=n(1E,e){9(1E.1X==7.o.1c)q;a 2i=b.13("1y");2i.I=7.o.I;2i.1c=1E.1X;a p=7.o.4Y;p.4W(2i,7.o);7.o=2i;7.o.8.t=\'2e\';7.l.1c=1E.3Q;9(1E.2H!=\'\'&&1p$(\'2u\'+7.c.I)){1p$(\'2u\'+7.c.I).1z.4T=1E.2H}9(7.k[\'1D\']==-1){7.c.8.u=\'2x\'}B{7.c.8.u=g(7.k[\'1D\'])+\'v\'}9(7.k[\'1J\']==-1){7.c.8.C=\'2x\'}B{7.c.8.C=g(7.k[\'1J\'])+\'v\'}7.2v=L;7.1W();7.G.1X=1E.1X;3h{4U.4Z()}3e(e){}};n 3R(I,M){a h=1f.b.3l("A");1r(a i=0;i<h.1m;i++){9(h[i].1A==I){1g(h[i],"2z",n(1e){9(m!=\'K\'){7.3D()}B{1f.51()}1P(1e);q L});1g(h[i],M.k[\'2m\'],1j(M,"3g",h[i]));h[i].8.3B=\'0\';h[i].2F=3c;h[i].2F({M:M,56:n(){7.M.3g(1T,7)}});a 11=b.13("1y");11.1c=h[i].1X;11.8.t=\'1H\';11.8.z=\'-1S\';11.8.H=\'-1S\';b.17.18(11);11=b.13("1y");11.1c=h[i].3Q;11.8.t=\'1H\';11.8.z=\'-1S\';11.8.H=\'-1S\';b.17.18(11)}}};n 55(){29(1I.1m>0){a M=1I.54();M.3T();52 M}};n 3Z(){a 1O=\'53 4H\';a 1N=\'\';a 1R=1f.b.3l("1y");1r(a i=0;i<1R.1m;i++){9(/40/.3y(1R[i].26)){9(1R[i].3f!=\'\')1O=1R[i].3f;1N=1R[i].1c;1a}}a h=1f.b.3l("A");1r(a i=0;i<h.1m;i++){9(/Q/.3y(h[i].26)){29(h[i].1z){9(h[i].1z.1Q!=\'1y\'){h[i].2a(h[i].1z)}B{1a}}9(h[i].1z.1Q!=\'1y\')5f"5n Q 5q!";a 1M=2L.3d(2L.5o()*59);h[i].8.t="2e";h[i].8.2M=\'2J\';h[i].8.3B=\'0\';h[i].8.5g=\'3C\';1g(h[i],"2z",n(1e){9(m!=\'K\'){7.3D()}1P(1e);q L});9(h[i].I==\'\'){h[i].I="5r"+1M}9(m==\'K\'){h[i].8.25=0}a 2w=h[i].1z;2w.I="3P"+1M;a S=b.13("2h");S.I="4n"+1M;V=1n 1K(/Z(\\s+)?:(\\s+)?(\\d+)/i);E=V.1L(h[i].1A);a Z=50;9(E){Z=g(E[3])}V=1n 1K(/47\\-4c(\\s+)?:(\\s+)?(2z|46)/i);E=V.1L(h[i].1A);a 2m=\'2z\';9(E){2m=E[3]}V=1n 1K(/M\\-C(\\s+)?:(\\s+)?(\\w+)/i);a 1J=-1;E=V.1L(h[i].1A);S.8.C=\'2x\';9(E){S.8.C=E[3];1J=E[3]}V=1n 1K(/M\\-u(\\s+)?:(\\s+)?(\\w+)/i);a 1D=-1;E=V.1L(h[i].1A);S.8.u=\'2x\';9(E){S.8.u=E[3];1D=E[3]}V=1n 1K(/M\\-t(\\s+)?:(\\s+)?(\\w+)/i);E=V.1L(h[i].1A);a t=\'2C\';9(E){3G(E[3]){1l\'z\':t=\'z\';1a;1l\'1Z\':t=\'1Z\';1a;1l\'H\':t=\'H\';1a;1l\'21\':t=\'21\';1a;1l\'2I\':t=\'2I\';1a}}V=1n 1K(/42\\-4f(\\s+)?:(\\s+)?(N|L)/i);E=V.1L(h[i].1A);a 1C=L;9(E){9(E[3]==\'N\')1C=N}V=1n 1K(/4l\\-4k\\-M(\\s+)?:(\\s+)?(N|L)/i);E=V.1L(h[i].1A);a 23=L;9(E){9(E[3]==\'N\')23=N}S.8.3r=\'1G\';S.26="4p";S.8.25=27;S.8.1q=\'1G\';9(t!=\'21\'){S.8.t=\'1H\'}B{S.8.t=\'2e\'}a 2D=b.13("1y");2D.I="3V"+1M;2D.1c=h[i].1X;S.18(2D);9(t!=\'21\'){h[i].18(S)}B{1p$(h[i].I+\'-3H\').18(S)}a k={23:23,1C:1C,1u:h[i].2H,Z:Z,2m:2m,t:t,1O:1O,1N:1N,1J:1J,1D:1D};9(t==\'2I\'){h[i].2H=\'\'}a M=1n Q(h[i].I,\'3P\'+1M,S.I,\'3V\'+1M,k);h[i].2F=3c;h[i].2F({M:M});M.1W();3R(h[i].I,M)}}};9(m==\'K\')3h{b.4x("45",L,N)}3e(e){};1g(1f,"3N",3Z);',62,338,'|||||||this|style|if|var|document|bigImageCont||||parseInt|aels|||settings|smallImage|MagicZoom_ua|function|bigImage||return|||position|height|px||||left||else|width|pup|matches|MagicZoom_getStyle|smallImageCont|top|id|0px|msie|false|zoom|true|smallImageSizeX|loadingCont|MagicZoom|tag|bigCont|smallImageSizeY|popupSizeX|re||smallX|smallY|opacity||img|popupSizeY|createElement|||prototype|body|appendChild||break|bigImageSizeY|src|documentElement|event|window|MagicZoom_addEventListener|bigImageSizeX|compatMode|MagicZoom_createMethodReference|args|case|length|new|positionX|MagicZoom_|visibility|for|scrollLeft|bigImageContStyleTop|header|positionY|scrollTop|gd56f7fsgd|IMG|firstChild|rel|opera|drag_mode|zoomHeight|ael|safari|hidden|absolute|MagicZoom_zooms|zoomWidth|RegExp|exec|rand|loadingImg|loadingText|MagicZoom_stopEventPropagation|tagName|iels|10000px|null|mousemove|toLowerCase|initZoom|href|obj|bottom||custom|arguments|bigImage_always_visible|result|zIndex|className|100|listener|while|removeChild|borderLeftWidth|paddingLeft|wx|relative|wy|hiderect|DIV|newBigImage|headerH|perX|backcompat|thumb_change|ptop|gecko|pleft|el|paddingTop|MagicZoom_getBounds|indexOf|MagicZoomHeader|safariOnLoadStarted|smallImg|300px|checkcoords|click|perY|recalculating|right|bigImg|clientY|mzextend|clientX|title|inner|block|styleProp|Math|display|visible|ar1|sequence|object|recalculatePopupDimensions|on|MagicView_ia|property|push|complete|innerHTML|cursor|borderTopWidth|css|vc68|vc67|padding|MagicZoom_getEventBounds|parseFloat|setTimeout|bw|initBigContainer|MagicZoom_removeEventListener|mousemove_ref|showrect|MagicZoom_extendElement|round|catch|alt|replaceZoom|try|checkcoords_ref|mousedown|mouseup|getElementsByTagName|reinit|smallImageContId|smallImageId|MagicZoom_concat|MagicZoom_withoutFirst|overflow|skip|methodName|bigimgsrc|cancelBubble|bigImageContId|filter|test|initPopup|offsetParent|outline|none|blur|offsetLeft|offsetTop|switch|big|move|BODY|HTML|bigImageId|xgdf7fsgd56|load|paddingRight|sim|rev|MagicZoom_findSelectors|currentStyle|stopZoom|borderWidth|bim|getComputedStyle|textAlign|getBoundingClientRect|MagicZoom_findZooms|MagicZoomLoading|str|drag|defaultView|default|BackgroundImageCache|mouseover|thumb|navigator|dir|rtl|userAgent|change|Array|mozilla|mode|getElementById|popupSizey|addEventListener|in|show|always|apply|bc|detachEvent|MagicZoomBigImageCont|attachEvent|preventDefault|stopPropagation|center|br|border|removeEventListener|execCommand|pageXOffset|version|pageYOffset|baseuri|String|fontSize|color|fontWeight|fontFamily|Zoom|Tahoma|div|typeof|DXImageTransform|progid|Microsoft|Alpha|undefined|frameBorder|offsetWidth|offsetHeight|data|MagicThumb|paddingBottom|replaceChild|borderRightWidth|parentNode|refresh||focus|delete|Loading|pop|MagicZoom_stopZooms|selectThisZoom|javascript|3px|1000000|alpha|Opacity|fromCharCode|html|moz|throw|textDecoration|MagicZoomPup|IFRAME|unselectable|onselectstart|oncontextmenu|charCodeAt|Invalid|random|MozUserSelect|invocation|sc'.split('|'),0,{}))






/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
 
;(function($) {
	
		// the tooltip element
	var helper = {},
		// the current tooltipped element
		current,
		// the title of the current element, used for restoring
		title,
		// timeout id for delayed tooltips
		tID,
		// IE 5.5 or 6
		IE = $.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
		// flag for mouse tracking
		track = false;
	
	$.tooltip = {
		blocked: false,
		defaults: {
			delay: 200,
			fade: false,
			showURL: true,
			extraClass: "",
			top: 15,
			left: 15,
			id: "tooltip"
		},
		block: function() {
			$.tooltip.blocked = !$.tooltip.blocked;
		}
	};
	
	$.fn.extend({
		tooltip: function(settings) {
			settings = $.extend({}, $.tooltip.defaults, settings);
			createHelper(settings);
			return this.each(function() {
					$.data(this, "tooltip", settings);
					this.tOpacity = helper.parent.css("opacity");
					// copy tooltip into its own expando and remove the title
					this.tooltipText = this.title;
					$(this).removeAttr("title");
					// also remove alt attribute to prevent default tooltip in IE
					this.alt = "";
				})
				.mouseover(save)
				.mouseout(hide)
				.click(hide);
		},
		fixPNG: IE ? function() {
			return this.each(function () {
				var image = $(this).css('backgroundImage');
				if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
					image = RegExp.$1;
					$(this).css({
						'backgroundImage': 'none',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
					}).each(function () {
						var position = $(this).css('position');
						if (position != 'absolute' && position != 'relative')
							$(this).css('position', 'relative');
					});
				}
			});
		} : function() { return this; },
		unfixPNG: IE ? function() {
			return this.each(function () {
				$(this).css({'filter': '', backgroundImage: ''});
			});
		} : function() { return this; },
		hideWhenEmpty: function() {
			return this.each(function() {
				$(this)[ $(this).html() ? "show" : "hide" ]();
			});
		},
		url: function() {
			return this.attr('href') || this.attr('src');
		}
	});
	
	function createHelper(settings) {
		// there can be only one tooltip helper
		if( helper.parent )
			return;
		// create the helper, h3 for title, div for url
		helper.parent = $('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
			// add to document
			.appendTo(document.body)
			// hide it at first
			.hide();
			
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			helper.parent.bgiframe();
		
		// save references to title and url elements
		helper.title = $('h3', helper.parent);
		helper.body = $('div.body', helper.parent);
		helper.url = $('div.url', helper.parent);
	}
	
	function settings(element) {
		return $.data(element, "tooltip");
	}
	
	// main event handler to start showing tooltips
	function handle(event) {
		// show helper, either with timeout or on instant
		if( settings(this).delay )
			tID = setTimeout(show, settings(this).delay);
		else
			show();
		
		// if selected, update the helper position when the mouse moves
		track = !!settings(this).track;
		$(document.body).bind('mousemove', update);
			
		// update at least once
		update(event);
	}
	
	// save elements title before the tooltip is displayed
	function save() {
		// if this is the current source, or it has no title (occurs with click event), stop
		if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
			return;

		// save current
		current = this;
		title = this.tooltipText;
		
		if ( settings(this).bodyHandler ) {
			helper.title.hide();
			var bodyContent = settings(this).bodyHandler.call(this);
			if (bodyContent.nodeType || bodyContent.jquery) {
				helper.body.empty().append(bodyContent)
			} else {
				helper.body.html( bodyContent );
			}
			helper.body.show();
		} else if ( settings(this).showBody ) {
			var parts = title.split(settings(this).showBody);
			helper.title.html(parts.shift()).show();
			helper.body.empty();
			for(var i = 0, part; (part = parts[i]); i++) {
				if(i > 0)
					helper.body.append("<br/>");
				helper.body.append(part);
			}
			helper.body.hideWhenEmpty();
		} else {
			helper.title.html(title).show();
			helper.body.hide();
		}
		
		// if element has href or src, add and show it, otherwise hide it
		if( settings(this).showURL && $(this).url() )
			helper.url.html( $(this).url().replace('http://', '') ).show();
		else 
			helper.url.hide();
		
		// add an optional class for this tip
		helper.parent.addClass(settings(this).extraClass);

		// fix PNG background for IE
		if (settings(this).fixPNG )
			helper.parent.fixPNG();
			
		handle.apply(this, arguments);
	}
	
	// delete timeout and show helper
	function show() {
		tID = null;
		if ((!IE || !$.fn.bgiframe) && settings(current).fade) {
			if (helper.parent.is(":animated"))
				helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
			else
				helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
		} else {
			helper.parent.show();
		}
		update();
	}
	
	/**
	 * callback for mousemove
	 * updates the helper position
	 * removes itself when no current element
	 */
	function update(event)	{
		if($.tooltip.blocked)
			return;
		
		if (event && event.target.tagName == "OPTION") {
			return;
		}
		
		// stop updating when tracking is disabled and the tooltip is visible
		if ( !track && helper.parent.is(":visible")) {
			$(document.body).unbind('mousemove', update)
		}
		
		// if no current element is available, remove this listener
		if( current == null ) {
			$(document.body).unbind('mousemove', update);
			return;	
		}
		
		// remove position helper classes
		helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
		
		var left = helper.parent[0].offsetLeft;
		var top = helper.parent[0].offsetTop;
		if (event) {
			// position the helper 15 pixel to bottom right, starting from mouse position
			left = event.pageX + settings(current).left;
			top = event.pageY + settings(current).top;
			var right='auto';
			if (settings(current).positionLeft) {
				right = $(window).width() - left;
				left = 'auto';
			}
			helper.parent.css({
				left: left,
				right: right,
				top: top
			});
		}
		
		var v = viewport(),
			h = helper.parent[0];
		// check horizontal position
		if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
			left -= h.offsetWidth + 20 + settings(current).left;
			helper.parent.css({left: left + 'px'}).addClass("viewport-right");
		}
		// check vertical position
		if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
			top -= h.offsetHeight + 20 + settings(current).top;
			helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
		}
	}
	
	function viewport() {
		return {
			x: $(window).scrollLeft(),
			y: $(window).scrollTop(),
			cx: $(window).width(),
			cy: $(window).height()
		};
	}
	
	// hide helper and restore added classes and the title
	function hide(event) {
		if($.tooltip.blocked)
			return;
		// clear timeout if possible
		if(tID)
			clearTimeout(tID);
		// no more current element
		current = null;
		
		var tsettings = settings(this);
		function complete() {
			helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
		}
		if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
			if (helper.parent.is(':animated'))
				helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
			else
				helper.parent.stop().fadeOut(tsettings.fade, complete);
		} else
			complete();
		
		if( settings(this).fixPNG )
			helper.parent.unfixPNG();
	}
	
})(jQuery);





$(function() {

$("#foottip a").tooltip({
	bodyHandler: function() {
		return $($(this).attr("href")).html();
	},
	showURL: false
});

$('#right a').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	extraClass: "right"
});


});



$(document).ready(function(){
$('#tabs .tabbedDiv').hide(); // Hide all divs
$('#tabs #Tab_Buy').show(); // Show the first div
$('#tabs ul li:first').addClass('active'); //Set the first link's class to active
$('#tabs ul li a').click(function(){ //When any link is clicked
$('#tabs ul li').removeClass('active'); // Remove active class from all links
$(this).parent().addClass('active'); //Set clicked link class to active
var currentTab = $(this).attr('href'); // Set variable currentTab
$("#tabs .tabbedDiv:visible").fadeOut("slow",function(){ //fade out visible div
$(currentTab).fadeIn("slow") //fade in target div
});return false;
});
});

  
  




/**
 * 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;
    }
};




$(document).ready(function() {     


$('.specialoffersbut30').click(function() {   
    $.cookie("cookieoffer", "30");   
});

$('.specialoffersbut40').click(function() {   
    $.cookie("cookieoffer", "40");   
});

$('.specialoffersbut50').click(function() {   
    $.cookie("cookieoffer", "50");   
});

$('.specialoffersbut60').click(function() {   
    $.cookie("cookieoffer", "60");   
});

$('.specialoffersbutstar').click(function() {   
    $.cookie("cookieoffer", "STARBUY");   
});




});



/* ===========================================================================
 *
 * JQuery URL Parser
 * Version 1.0
 * Parses URLs and provides easy access to information within them.
 *
 * Author: Mark Perkins
 * Author email: mark@allmarkedup.com
 *
 * For full documentation and more go to http://projects.allmarkedup.com/jquery_url_parser/
 *
 * ---------------------------------------------------------------------------
 *
 * CREDITS:
 *
 * Parser based on the Regex-based URI parser by Steven Levithan.
 * For more information (including a detailed explaination of the differences
 * between the 'loose' and 'strict' pasing modes) visit http://blog.stevenlevithan.com/archives/parseuri
 *
 * ---------------------------------------------------------------------------
 *
 * LICENCE:
 *
 * Released under a MIT Licence. See licence.txt that should have been supplied with this file,
 * or visit http://projects.allmarkedup.com/jquery_url_parser/licence.txt
 *
 * ---------------------------------------------------------------------------
 * 
 * EXAMPLES OF USE:
 *
 * Get the domain name (host) from the current page URL
 * jQuery.url.attr("host")
 *
 * Get the query string value for 'item' for the current page
 * jQuery.url.param("item") // null if it doesn't exist
 *
 * Get the second segment of the URI of the current page
 * jQuery.url.segment(2) // null if it doesn't exist
 *
 * Get the protocol of a manually passed in URL
 * jQuery.url.setUrl("http://allmarkedup.com/").attr("protocol") // returns 'http'
 *
 */

jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();



$(document).ready(function() {
  
    var from = 0;

    var isTheme = false;
    var currentpageoriginal = $(location).attr('href');
    if (currentpageoriginal != null) {
        var currentpagecrop = currentpageoriginal.substr(0, 2);
        if (currentpageoriginal.toLowerCase().indexOf("theme") != -1) {
            isTheme = true;

        }
    }
    if (currentpageoriginal == null) {
        isTheme = false;
        var currentpagecrop = "d-";
    }

    if (!isTheme && $.cookie("IsTheme") == "true") {
        isTheme = true;
    }

    if (currentpageoriginal.toLowerCase().indexOf("info/browseproducts") != -1) {
        isTheme = false;
    }

    if (currentpageoriginal.toLowerCase().indexOf("info/browsetheme") != -1) {
        isTheme = true;
    }

    //alert(currentpagecrop);
    if (isTheme === false) {
        //    $.cookie("themesmenucurrent", null);
        $('.categoriesouter').slideDown(1);
        $('.themesouter').slideUp(1);
    }

    if ($.cookie("themesmenucurrent") != null && isTheme === true) {

        from = parseInt($.cookie("themesmenucurrent"));

        $('.themesouter').slideDown(1);
        $('.categoriesouter').slideUp(1);
        $('.themesexpandbutton').css({ display: "none" });
        $('.categoryexpandbutton').css({ display: "inline" });

        //alert($.cookie("themesmenucurrent"));
        //var from = 30;
    }

    else {
        from = 0;
        $.cookie("themesmenucurrent", 0, { path: "/" });
    }
    var step = 10;



    var thisOne = $("#themescategorymenu");
    var themeslistitems = $("li.themestame");
    var themeslength = themeslistitems.length;
    //alert(themeslength);
    $.cookie("themeslistitems", themeslength, { path: "/" });

    $.cookie("IsTheme", isTheme, { path: "/" });
    if (from == 0) {
        $('#backthemes').css({ display: "none" });
    }
    if (from >= (themeslength - (step))) {
        $('#morethemes').css({ display: "none" });
    }

    function getCookie(c_name) {
        if (document.cookie.length > 0) {
            c_start = document.cookie.indexOf(c_name + "=");
            if (c_start != -1) {
                c_start = c_start + c_name.length + 1;
                c_end = document.cookie.indexOf(";", c_start);
                if (c_end == -1) c_end = document.cookie.length;
                return unescape(document.cookie.substring(c_start, c_end));
            }
        }
        return "";
    }


    function showNext(list) {
        list
    .find('li.themestame').hide().end()
    .find('li.themestame:lt(' + (from + step) + '):not(li.themestame:lt(' + from + '))')
    .show();
    }

    function showPrevious(list) {
        list
    .find('li.themestame').hide().end()
    .find('li:lt(' + from + step + '):not(li:lt(' + (from) + '))')
    .show();
    }

    // show initial set
    showNext($('ul'));

    // clicking on the 'more' link:
    $('#morethemes').click(function(e) {

        var themesmenucurrentcookievalue = 0;

        if ($.cookie("themesmenucurrent") != null) {
            themesmenucurrentcookievalue = parseInt($.cookie("themesmenucurrent"));
        }
        themesmenucurrentcookievalue = themesmenucurrentcookievalue + step;
        $.cookie("themesmenucurrent", themesmenucurrentcookievalue, { path: "/" });

        from = themesmenucurrentcookievalue;


        if (from >= (themeslength - (step))) {
            $('#morethemes').css({ display: "none" });
        }
        e.preventDefault();
        showNext($('ul'));
        $('#backthemes').css({ display: "inline" });



    });


    // clicking on the 'more' link:
    $('#backthemes').click(function(e) {

        var themesmenucurrentcookievalue = 0;

        if ($.cookie("themesmenucurrent") != null) {
            themesmenucurrentcookievalue = parseInt($.cookie("themesmenucurrent"));
        }
        themesmenucurrentcookievalue = themesmenucurrentcookievalue - step;
        $.cookie("themesmenucurrent", themesmenucurrentcookievalue, { path: "/" });

        from = themesmenucurrentcookievalue;

        e.preventDefault();

        if (from == 0) {

            showPrevious($('ul'));
        }
        else {
            showNext($('ul'));
        }

        $('#morethemes').css({ display: "inline" });
        if (from < step) {
            $('#backthemes').css({ display: "none" });
        }

    });

});




function getPAList(zipControlName, prefx)
{
     var postcodetofind = "";
    var inputItems = document.getElementsByTagName("input");
    for(var n=0; n<inputItems.length; n++)
    {
        if(inputItems[n].PAItem == zipControlName)
        {
            postcodetofind = inputItems[n].value;
            break;
        }
    }

    if(postcodetofind==null || postcodetofind == "")
    {
        alert("Plase, put postcode first!");
        return;
    }
        $.getJSON('postcodeanywhere.aspx', {postcode:postcodetofind}, function(data) {
        if(data.status == 'OK')
        {
            var addressesPlh = document.getElementById(prefx+"addressesplh");
            if(addressesPlh!= null)
            {
                addressesPlh.innerHTML = "Addresses:";
            }
            
            var listPlh = document.getElementById(prefx+"listplh");
            if(listPlh!=null)
            {
                var existingDdls = listPlh.getElementsByTagName("select");
                var selectDdl;
                if(existingDdls.length == 1)
                {
                    selectDdl = existingDdls[0];
                    selectDdl.options.length = 0;
                }   
                else
                {
                    selectDdl = document.createElement("select");
                    selectDdl.size = 6;
                    listPlh.appendChild(selectDdl);
                    selectDdl.onchange = function()
                    {
                        var chosenoption=this.options[this.selectedIndex] //this refers to "selectmenu"
                        if (chosenoption.value!="nothing")
                        {
                            var chosenValue = chosenoption.value;
                            getPAAddress(chosenValue, prefx);
                        }
                    }
                }
                
                for(var i=0; i<data.addresses.length; i++)
                {
                    selectDdl.add(new Option(data.addresses[i].description, data.addresses[i].addID), null);
                }
            }
        }
        else
        {
            alert(data.errormessage);
        }
    
});
}


function paShowHideButton(prefx)
{
var countryddl = document.getElementById("AddressCountry");

  var selectedItem = countryddl[countryddl.selectedIndex];
  if(selectedItem.text == "United Kingdom")
  {
        var button = document.getElementById("paInput");
        button.style.visibility="visible";
  }
  else
  {
        var button = document.getElementById("paInput");
        button.style.visibility="hidden";
  }
}


function getPAAddress(addID, prefx)
{
    $.getJSON('postcodeanywhere.aspx', {addressId:addID}, function(data) {
        if(data.status == "OK")
        {
             var inputItems = document.getElementsByTagName("input")
             for(var i=0; i<inputItems.length; i++)
             {
                 if (inputItems[i].PAItem==prefx+"AddressLine1")
                 {
                    inputItems[i].value = data.AddressLine1;
                 }
                 else if (inputItems[i].PAItem==prefx+"AddressLine2")
                 {
                    inputItems[i].value = data.AddressLine2;
                 }
                 else if (inputItems[i].PAItem==prefx+"AddressCity")
                 {
                    inputItems[i].value = data.AddressCity;
                 }
                 else if (inputItems[i].PAItem==prefx+"AddressCompany")
                 {
                    inputItems[i].value = data.AddressCompany;
                 }
             }
             
             
             var selectItems = document.getElementsByTagName("select");
             for(var i=0; i<selectItems.length; i++)
             {
                if(selectItems[i].PAItem ==prefx+ "AddressResidence")
                {
                    if(data.AddressResidential == "1")
                    {
                        selectItems[i].selectedIndex=1;
                    }
                    else if(data.AddressResidential == "0")
                    {
                         selectItems[i].selectedIndex=2;
                    }
                    else
                    {
                        selectItems[i].selectedIndex=0;
                    }
                }
                else if(selectItems[i].PAItem ==prefx+ "AddressCountry")
                {
                    for(var j=0; j<selectItems[i].options.length; j++)
                    {
                        if(selectItems[i].options[j].value == "United Kingdom")
                        {
                            selectItems[i].options[j].selected = true;
                            selectItems[i].selectedIndex = j;
                        }
                    }
                }
                else if(selectItems[i].PAItem == prefx+"AddressCounty")
                {
                    selectItems[i].options.length = 0;
                    for(var k=0; k<data.AddressCountyList.length; k++)
                    {
                        selectItems[i].add(new Option(data.AddressCountyList[k].name,data.AddressCountyList[k].value), null); 
                    }
                    for(var k=0; k<selectItems[i].options.length; k++)
                    {
                        if(selectItems[i].options[k].text == data.AddressCounty)
                        {
                            selectItems[i].options[k].selected = true;
                            selectItems[i].selectedIndex = k;
                        }
                    }
                }
             }
             
        }
        else
        {
             alert(data.errormessage);
        }
    });
}



var isThemeViewing = true;

$(document).ready(function() {

    if ($.cookie("IsTheme") != "true") {
        $("#themesCatsBox").hide();
        $(".categoriesExpand").hide();
        isThemeViewing = false;
    }
    $("a.Expand").click(function() {
        if (isThemeViewing) {
            $('.categoriesouter').slideDown(300);
            $('.themesouter').slideUp("slow");
            $('.categoryexpandbutton').css({ display: "none" });
            $('.themesexpandbutton').css({ display: "inline" });
        }
        else {
            $('.themesouter').slideDown(300);
            $('.categoriesouter').slideUp("slow");
            $('.themesexpandbutton').css({ display: "none" });
            $('.categoryexpandbutton').css({ display: "inline" });
        }

        isThemeViewing = !isThemeViewing;
    });

    $("a.ExpandHeadTheme").click(function() {
        $('.themesouter').slideDown(300);
        $('.categoriesouter').slideUp("slow");
        $('.themesexpandbutton').css({ display: "none" });
        $('.categoryexpandbutton').css({ display: "inline" });
    });

    $("a.ExpandHeadCategory").click(function() {
        $('.categoriesouter').slideDown(300);
        $('.themesouter').slideUp("slow");
        $('.categoryexpandbutton').css({ display: "none" });
        $('.themesexpandbutton').css({ display: "inline" });
    });




});




 var headline_count;
 var headline_interval;
 var old_headline = 0;
 var current_headline = 0;
 
 $(document).ready(function(){
   headline_count = $("div.newsTeaser").size();
   $("div.newsTeaser:eq("+current_headline+")").css('top','5px');
 
   headline_interval = setInterval(headline_rotate,8000); //time in milliseconds
   $('#scrollup').hover(function() {
     clearInterval(headline_interval);
   }, function() {
     headline_interval = setInterval(headline_rotate,8000); //time in milliseconds
     headline_rotate();
   });
 });
 
 function headline_rotate() {
   current_headline = (old_headline + 1) % headline_count; 
   $("div.newsTeaser:eq(" + old_headline + ")").animate({top: -205},"slow", function() {
     $(this).css('top','210px');
   });
   $("div.newsTeaser:eq(" + current_headline + ")").show().animate({top: 5},"slow");  
   old_headline = current_headline;
 }





//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}




// JScript File
function AdjustQuantity(qtyElem) {
  
    /* validate input */
    var qty = parseInt(qtyElem.value, 10);
    if (isNaN(qty) || qty < 0 || !checkForNumber(qtyElem.value))
    {
        qty = 0;
        qtyElem.value = 0;
    }
 
 
    var adjustedVariantIndex = qtyElem.name.substring('Quantity_'.length);
    var discTable = eval("discounts_" + adjustedVariantIndex);
    
    
    
    // check if ordered qty (just of changed element) is multiple of min qty (lowest item from discount table array) (do not take basket qty into account)
    if (qty > 0 && discTable != null)
    {
        // remember min qty
        var minQty = discTable[0][0];
        
        if (qty < minQty)
        {
            RecalculatePrices(qtyElem);
        
            alert('Minimum required quantity to order is ' + minQty.toString() + '. Input has been adjusted.');
            qtyElem.value = minQty;

            // update total ordered units
            document.getElementById("totalUnitsHidden").value = minQty;
            document.getElementById("totalUnits").innerHTML = minQty.toString() + " units";
        }
        else if (qty % minQty != 0)
        {
            RecalculatePrices(qtyElem);
            
            alert('Ordered quantity is required to be a multiple of the minimum quantity ' + minQty.toString() + '. Input has been adjusted.');
            qtyElem.value = (parseInt(qty / minQty) + 1) * minQty;

            // update total ordered units
            document.getElementById("totalUnitsHidden").value = qtyElem.value;
            document.getElementById("totalUnits").innerHTML = qtyElem.value.toString() + " units";
        }
    }
    
    
}



function RecalculatePrices(qtyElem)
{
    /* validate input */
    var qty = parseInt(qtyElem.value, 10);
    if (isNaN(qty) || qty < 0 || !checkForNumber(qtyElem.value))
    {
        qty = 0;
        qtyElem.value = 0;
    }
 
 
    var adjustedVariantIndex = qtyElem.name.substring('Quantity_'.length);
    var discTable = eval("discounts_" + adjustedVariantIndex);
    
    
    

    var variantsCount = parseInt(document.getElementById("variantsCount").value, 10);
    
    // check quantity
//    if (inventories[variantIndex] < qty)
//    {
//        alert("Required quantity is not available for this product.");
//        return;
//    }
    
    // get total ordered quantity to look up correct unit price
    var qtyToOrder = 0;
    for (i = 0; i < skus.length; i++)
    {
        var valqty = document.getElementById("Quantity_" + i.toString()).value;
        if (valqty != '' && checkForNumber(valqty))
        {
            qtyToOrder += parseInt(valqty, 10);
        }
        else
        {
            qty = 0;
            qtyElem.value = 0;
        }
    }
    

   
    
    // find correct volume discount (price) by total ordered quantity for each variant
    var totalPrice = 0.0;
    var allDiscountQuantitiesArray = new Array();
    for (k = 0; k < variantsCount; k++)
    {
        var discountTable = eval("discounts_" + k.toString());
        var discIndex = 0;
        var varQty = 0;
        var varQtyElemVal = document.getElementById("Quantity_" + k.toString()).value;
        if (varQtyElemVal != '' && checkForNumber(varQtyElemVal))
        {
            varQty = parseInt(varQtyElemVal, 10);
        }

        
        for (;;)
        {
            
            if (discountTable.length - 1 < discIndex + 1)
            {
                break;
            }
            
            if (qtyToOrder + basketQty >= discountTable[discIndex + 1][0])
            {
                discIndex++;
            } 
            else
            {
                break;
            }
        }
        
        

        
        
        var unitPrice = discountTable[discIndex][1];
        document.getElementById("UnitPrice_" + k.toString()).innerHTML = unitPrice.toFixed(2);
        //totalPrice += unitPrice * varQty;
        
        // store all discount quantities
        for (kk = 0; kk < discountTable.length; kk++)
        {
            allDiscountQuantitiesArray.push(discountTable[kk][0]);
        }
    }
    

    
    
    // update total ordered units
    document.getElementById("totalUnitsHidden").value = qtyToOrder;
    document.getElementById("totalUnits").innerHTML = qtyToOrder.toString() + " units";
    
    
    
    
    // update quantity for next pricing break
    allDiscountQuantitiesArray.sort(sortNumber);
    var totalQty = basketQty + qtyToOrder;
    var nearestPriceBreak = 0;
    while (allDiscountQuantitiesArray.length > 0)
    {
        var priceBreakQty = allDiscountQuantitiesArray.shift();
        if (priceBreakQty > totalQty)
        {
            nearestPriceBreak = priceBreakQty;
            break;
        }
    }
    
    var qtyForNextPriceBreak = nearestPriceBreak - totalQty;
    if (qtyForNextPriceBreak < 0)
    {
        qtyForNextPriceBreak = 0;
    }
    document.getElementById("nextPriceBreakItemsCount").innerHTML = qtyForNextPriceBreak.toString();
    
    
    
//    var totalOrderedQtyElem = document.getElementById("totalOrderedQty");
    //var totalPriceElem = document.getElementById("totalPrice");
    
//    totalOrderedQtyElem.value = qtyToOrder;
    //totalPriceElem.value = totalPrice.toFixed(2);
    
    
}


function sortNumber(a, b) {
    return a - b;
}


function checkForNumber(NumText)
{
	lenNum = NumText.length;
	for(j=0; j<lenNum; j++)
	{
		if(NumText.charAt(j)<'0' || NumText.charAt(j)>'9')
		{
			return false;
			break;
		}
	}

	return true;
}


$(function(){
	var tabindexzero = 0;
	$('#menu a').each(function() {		
			var $input = $(this);
			$input.attr("tabindex", tabindexzero);
	});
});


$(function(){
	var tabindexzero = 0;
	$('li.tame a').each(function() {		
			var $input = $(this);
			$input.attr("tabindex", tabindexzero);
		
	});
});


$(function(){
	var tabindexten = 10;
	$('#centre_col a').each(function() {		
			var $input = $(this);
			$input.attr("tabindex", tabindexten);		
	});
});


$(function(){
	var tabindexfifteen = 15;
	$('#right_col a, #left_col img, #left_col input, #left_col button, .advSearchLink').each(function() {		
			var $input = $(this);
			$input.attr("tabindex", tabindexfifteen);		
	});
});





$(document).ready(function(){



    $("ul.topnav li ul.subnav").mouseover(function() {
		
		$(this).parent().parent().addClass("subhover"); 
		});
		
		$("ul.topnav li ul.subnav").mouseout(function() {
		
		$(this).parent().parent().removeClass("subhover"); 
		});
		

		

	$("ul.topnav li div").mouseover(function() {
		
		$(this).parent().find("ul.subnav").show(); 
		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").hide(); 
		});

		
		}).hover(function() {
			$(this).addClass("subhover");
		}, function(){
			$(this).removeClass("subhover"); 
	});

});




$(document).ready(function() {
//Set the master select:
var scrollTo_id = '#tabs_horizontal ';
//Get the height of the first item
$(scrollTo_id+'#content').css({'height':$(scrollTo_id+'#panel-1').height()});
//Calculate the total width - sum of all sub-panels width
//Width is generated according to the width of #content * total of sub-panels
//.tab_view margin-right
var tab_view_m_r = parseInt($(scrollTo_id+'.tab_view').css('margin-right'));
if(tab_view_m_r == 0) tab_view_m_r = 23;
//#content padding-left and padding-top
var content_p_l = parseInt($(scrollTo_id+'#content').css('padding-left'));
if(content_p_l == 0) content_p_l = 20;
var content_p_t = parseInt($(scrollTo_id+'#content').css('padding-top'));
if(content_p_t == 0) content_p_t = 20;
$(scrollTo_id+'.view_container').width(($(scrollTo_id+'#content').width() + tab_view_m_r)* $(scrollTo_id+'.view_container div.tab_view').length);
//Set the sub-panel width according to the #content width (width of #content and sub-panel must be same)
$(scrollTo_id+'.view_container div.tab_view').width($(scrollTo_id+'#content').width());
var scrollTo_Options = {margin: true, offset: {'left': -content_p_l, top: -content_p_l}};
var scrollTo_tab_Options = {margin: true, onAfter:function(){
updatePrevNext();
}};
var tabs_container_w = $(scrollTo_id+'#tabs_container').width();
//Caluclate the ul.tabs width:
var ul_tabs_w = 0;
$(scrollTo_id+'ul.tabs li').each(function () {
ul_tabs_w += $(this).width();
});
//Set ul.tabs width
$(scrollTo_id+'ul.tabs').width(ul_tabs_w);
var max_tabs_scroll_poz = ul_tabs_w - tabs_container_w;
//var scroll_poz = $(scrollTo_id+'#tabs_container').scrollLeft();
function updatePrevNext(){
var scroll_poz = $(scrollTo_id+'#tabs_container').scrollLeft();
//var scroll_poz = 0;
if(max_tabs_scroll_poz < 0) {
$(scrollTo_id+'a.next').hide();
$(scrollTo_id+'a.prev').hide();
return true;
}
//alert('scroll_poz:'+scroll_poz+',max_tabs_scroll_poz:'+max_tabs_scroll_poz);
if(scroll_poz >= max_tabs_scroll_poz) $(scrollTo_id+'a.next').addClass('disabled');
else $(scrollTo_id+'a.next').removeClass('disabled');
if(scroll_poz > 1) $(scrollTo_id+'a.prev').removeClass('disabled');
else {
$(scrollTo_id+'a.prev').addClass('disabled');
}
}
updatePrevNext();
//Get all the links with rel as panel
$(scrollTo_id+'.tabs a.tab').click(function () {
//Get the height of the sub-panel
//var panelheight = $($(this).attr('href')).height();
//Set class for the active item
$(scrollTo_id+'.tabs a.tab').removeClass('active');
$(this).addClass('active');
//Resize the height
//$('#content').animate({'height':panelheight},{queue:false, duration:10});
//Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
$(scrollTo_id+'#content').scrollTo($(this).attr('href'), 800, scrollTo_Options);
//offset: {left: parseInt($('#content').css('padding-left')), top: parseInt($('#content').css('padding-top'))}
//Discard the link default behavior
return false;
});
$(scrollTo_id+'#content').scrollTo($(scrollTo_id+'.tabs a.tab.active:first').attr('href'), 800, scrollTo_Options);
$(scrollTo_id+'.tabs a.tab.active').not('a.tab.active:first').removeClass('active');
$(scrollTo_id+'a.next,'+scrollTo_id+'a.prev').click(function () {
//$(scrollTo_id+'#tabs_container').scrollTo($(scrollTo_id+'.tabs a.tab.active'), 80, scrollTo_Options);
if($(this).hasClass('disabled')) return false;
var li_target = '';
if($(this).hasClass('next')){
li_target = $(scrollTo_id+'.tabs li.firstVisibleTab').next();
}else{
li_target = $(scrollTo_id+'.tabs li.firstVisibleTab').prev();
}
if(li_target.length == 1){
$(scrollTo_id+'.tabs li.firstVisibleTab').removeClass('firstVisibleTab');
$(li_target).addClass('firstVisibleTab');
$(scrollTo_id+'#tabs_container').scrollTo(li_target, 80, scrollTo_tab_Options);
}
updatePrevNext();
return false;
});
});




/**
* jQuery.ScrollTo
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 5/25/2009
*
* @projectDescription Easy element scrolling using jQuery.
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
* Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7/8, Opera 9.5/6, Safari 3, Chrome 1 on WinXP.
*
* @author Ariel Flesler
* @version 1.4.2
*
* @id jQuery.scrollTo
* @id jQuery.fn.scrollTo
* @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements.
* The different options for target are:
* - A number position (will be applied to all axes).
* - A string position ('44', '100px', '+=90', etc ) will be applied to all axes
* - A jQuery/DOM element ( logically, child of the element to scroll )
* - A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc )
* - A hash { top:x, left:y }, x and y can be any kind of number/string like above.
* - A percentage of the container's dimension/s, for example: 50% to go to the middle.
* - The string 'max' for go-to-end.
* @param {Number} duration The OVERALL length of the animation, this argument can be the settings object instead.
* @param {Object,Function} settings Optional set of settings or the onAfter callback.
* @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'.
* @option {Number} duration The OVERALL length of the animation.
* @option {String} easing The easing method for the animation.
* @option {Boolean} margin If true, the margin of the target element will be deducted from the final position.
* @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }.
* @option {Object, Number} over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes.
* @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends.
* @option {Function} onAfter Function to be called after the scrolling ends.
* @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends.
* @return {jQuery} Returns the same jQuery object, for chaining.
*
* @desc Scroll to a fixed position
* @example $('div').scrollTo( 340 );
*
* @desc Scroll relatively to the actual position
* @example $('div').scrollTo( '+=340px', { axis:'y' } );
*
* @dec Scroll using a selector (relative to the scrolled element)
* @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } );
*
* @ Scroll to a DOM element (same for jQuery object)
* @example var second_child = document.getElementById('container').firstChild.nextSibling;
* $('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){
* alert('scrolled!!');
* }});
*
* @desc Scroll on both axes, to different values
* @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } );
*/
;(function( $ ){
var $scrollTo = $.scrollTo = function( target, duration, settings ){
$(window).scrollTo( target, duration, settings );
};
$scrollTo.defaults = {
axis:'xy',
duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1
};
// Returns the element that needs to be animated to scroll the window.
// Kept for backwards compatibility (specially for localScroll & serialScroll)
$scrollTo.window = function( scope ){
return $(window)._scrollable();
};
// Hack, hack, hack :)
// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
$.fn._scrollable = function(){
return this.map(function(){
var elem = this,
isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;
if( !isWin )
return elem;
var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
return $.browser.safari || doc.compatMode == 'BackCompat' ?
doc.body :
doc.documentElement;
});
};
$.fn.scrollTo = function( target, duration, settings ){
if( typeof duration == 'object' ){
settings = duration;
duration = 0;
}
if( typeof settings == 'function' )
settings = { onAfter:settings };
if( target == 'max' )
target = 9e9;
settings = $.extend( {}, $scrollTo.defaults, settings );
// Speed is still recognized for backwards compatibility
duration = duration || settings.speed || settings.duration;
// Make sure the settings are given right
settings.queue = settings.queue && settings.axis.length > 1;
if( settings.queue )
// Let's keep the overall duration
duration /= 2;
settings.offset = both( settings.offset );
settings.over = both( settings.over );
return this._scrollable().each(function(){
var elem = this,
$elem = $(elem),
targ = target, toff, attr = {},
win = $elem.is('html,body');
switch( typeof targ ){
// A number will pass the regex
case 'number':
case 'string':
if( /^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ) ){
targ = both( targ );
// We are done
break;
}
// Relative selector, no break!
targ = $(targ,this);
case 'object':
// DOMElement / jQuery
if( targ.is || targ.style )
// Get the real position of the target
toff = (targ = $(targ)).offset();
}
$.each( settings.axis.split(''), function( i, axis ){
var Pos = axis == 'x' ? 'Left' : 'Top',
pos = Pos.toLowerCase(),
key = 'scroll' + Pos,
old = elem[key],
max = $scrollTo.max(elem, axis);
if( toff ){// jQuery / DOMElement
attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );
// If it's a dom element, reduce the margin
if( settings.margin ){
attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
}
attr[key] += settings.offset[pos] || 0;
if( settings.over[pos] )
// Scroll to a fraction of its width/height
attr[key] += targ[axis=='x'?'width':'height']() * settings.over[pos];
}else{
var val = targ[pos];
// Handle percentage values
attr[key] = val.slice && val.slice(-1) == '%' ?
parseFloat(val) / 100 * max
: val;
}
// Number or 'number'
if( /^\d+$/.test(attr[key]) )
// Check the limits
attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max );
// Queueing axes
if( !i && settings.queue ){
// Don't waste time animating, if there's no need.
if( old != attr[key] )
// Intermediate animation
animate( settings.onAfterFirst );
// Don't animate this axis again in the next iteration.
delete attr[key];
}
});
animate( settings.onAfter );
function animate( callback ){
$elem.animate( attr, duration, settings.easing, callback && function(){
callback.call(this, target, settings);
});
};
}).end();
};
// Max scrolling position, works on quirks mode
// It only fails (not too badly) on IE, quirks mode.
$scrollTo.max = function( elem, axis ){
var Dim = axis == 'x' ? 'Width' : 'Height',
scroll = 'scroll'+Dim;
if( !$(elem).is('html,body') )
return elem[scroll] - $(elem)[Dim.toLowerCase()]();
var size = 'client' + Dim,
html = elem.ownerDocument.documentElement,
body = elem.ownerDocument.body;
return Math.max( html[scroll], body[scroll] )
- Math.min( html[size] , body[size] );
};
function both( val ){
return typeof val == 'object' ? val : { top:val, left:val };
};
})( jQuery );






