function applyAll() {

/*Tables tret */	   
    jQuery('#page table').addClass('stripeTable');
	jQuery('#page table.productTable').removeClass("stripeTable");
	jQuery('#page table.productTable2').removeClass("stripeTable");
	jQuery('#page table.productTablePhoto').removeClass("stripeTable");
	jQuery('#page table.contentpaneopen').removeClass("stripeTable");		
	jQuery('#page table.cleanTable').removeClass("stripeTable");
	jQuery('#page table.expandTb').removeClass("stripeTable");
	jQuery('#page table.keyFeatures').removeClass("stripeTable");
	jQuery('#page table.campaignTable').removeClass("stripeTable");
	jQuery('#page table.topContentTable').removeClass("stripeTable");
	jQuery('#page table.comparisonTable ').removeClass("stripeTable");
	jQuery('#page table.peopleBrighton').removeClass("stripeTable");
	jQuery('#page table.peopleBrighton table.tooltip').removeClass("stripeTable");
	
	jQuery('#page table.qantasSummary').removeClass("stripeTable");
jQuery('#page table.qantasBtmBorder').removeClass("stripeTable");
jQuery('#page table.qantasProduct').removeClass("stripeTable");
jQuery('#page table.qantasProduct2').removeClass("stripeTable");
jQuery('#page table.myProductTable').removeClass("stripeTable");
jQuery('#page table.myProductTable table').removeClass("stripeTable");


	
	
	
  	jQuery('#page table.productTable tr').removeClass();
	jQuery('#page table.productTable td').removeClass();

	
	useWidth = jQuery('#mainLeftInternal').width();
	
	
	jQuery('#page table.productTable').attr('width', useWidth);
	jQuery('#page table.productTable tr:first-child td').attr('width', '30%');
	jQuery('#page table.productTable tr:first-child td:first-child').attr('width', '50%');
	jQuery('#page table.productTable tr:first-child td:last-child').attr('width', '20%');
	

	jQuery('#page table.branchTable').attr('width', useWidth);
	jQuery('#page table.branchTable tr:first-child td:first-child').attr('width', "40%");
	jQuery('#page table.branchTable tr:first-child td:last-child').attr('width', "60%");
	
	
	jQuery('#page table.productTable2').attr('width', useWidth);
	jQuery('#page table.productTable2 tr:first-child td:first-child').attr('width', "80%");
	jQuery('#page table.productTable2 tr:first-child td:last-child').attr('width', "20%");
	
	jQuery('#page table.productTablePhoto').attr('width', useWidth);
	jQuery('#page table.productTablePhoto tr:first-child td').attr('width', '45%');
	jQuery('#page table.productTablePhoto tr:first-child td:first-child').attr('width', '15%');
	jQuery('#page table.productTablePhoto tr:first-child td:last-child').attr('width', '40%');
	
	
	jQuery('table.topContentTable').attr('width', useWidth);

	jQuery('table.topContentTable tr:first-child td').attr('width', '60%');
	jQuery('table.topContentTable tr:first-child td:last-child').attr('width', '20%');
	jQuery('table.topContentTable tr:first-child td:first-child').attr('width', '20%');
	
	jQuery('table.topContentTable tr:first-child td').addClass('topContentMiddle');
	jQuery('table.topContentTable tr:first-child td:first-child').addClass('topContentFirst');
	jQuery('table.topContentTable tr:first-child td:last-child').addClass('topContentLast');
	jQuery('table.topContentTable tr:first-child td:first-child').removeClass('topContentMiddle');
	jQuery('table.topContentTable tr:first-child td:last-child').removeClass('topContentMiddle');
	
	
	
	jQuery('#page table.comparisonTable tr:even').addClass('even');
	jQuery('#page table.comparisonTable tr:odd').addClass('odd');
	jQuery('#page table.comparisonTable td').addClass('customerDetails');
	jQuery('#page table.comparisonTable tr:first-child').removeClass();
	jQuery('#page table.comparisonTable tr:first-child td').removeClass();
	jQuery('#page table.comparisonTable tr:first-child td').addClass('customerDetailsThead header');

	/*jQuery('#page table.stripeTable tr:th').addClass('customerDetailsThead header');*/
	jQuery('#page table.comparisonTable tr:last-child td').css('border-bottom', '1px solid #cccccc');
	
	
	jQuery('#page table.stripeTable tr:even').addClass('even');
	jQuery('#page table.stripeTable tr:odd').addClass('odd');
	jQuery('#page table.stripeTable td').addClass('customerDetails');
	jQuery('#page table.stripeTable tr:first-child').removeClass();
	jQuery('#page table.stripeTable tr:first-child td').removeClass();
	jQuery('#page table.stripeTable tr:first-child td').addClass('customerDetailsThead header');

	/*jQuery('#page table.stripeTable tr:th').addClass('customerDetailsThead header');*/
	jQuery('#page table.stripeTable tr:last-child td').css('border-bottom', '1px solid #cccccc');
	
	
		
	jQuery('#page table.campaignTable tr:even').addClass('even');
	jQuery('#page table.campaignTable tr:odd').addClass('odd');
	jQuery('#page table.campaignTable td').addClass('customerDetails');
	jQuery('#page table.campaignTable tr:first-child').removeClass();
	jQuery('#page table.campaignTable tr:first-child td').removeClass();
	jQuery('#page table.campaignTable tr:first-child td').addClass('customerDetailsThead header');
	jQuery('#page table.campaignTable tr:last-child td').css('border-bottom', '1px solid #cccccc');
	
	
	jQuery('#mainRight table.intRates tr:even').addClass('even');
	jQuery('#mainRight table.intRates tr:odd').addClass('odd');
	jQuery('#mainRight table.intRates td').addClass('ratesDetails');
	jQuery('#mainRight table.intRates tr td:last-child').addClass('actualRate');
	jQuery('#mainRight table.intRates tr:first-child').removeClass();
	jQuery('#mainRight table.intRates tr:first-child td').removeClass();
	jQuery('#mainRight table.intRates tr:first-child td').addClass('ratesDetailsThead header');
	jQuery('#mainRight table.intRates tr:last-child td').css('border-bottom', '1px solid #cccccc');


	
	
	jQuery('#page table.keyFeatures tr').removeClass();
	jQuery('#page table.keyFeatures td').removeClass();
	
	jQuery('#page table.productTable2 tr').removeClass();
	jQuery('#page table.productTable2 td').removeClass();

	jQuery('#page table.contentpaneopen tr').removeClass();
	jQuery('#page table.contentpaneopen td').removeClass();
}



/* convert table to list */
function convertToList(element, givenClass, hideOptions) {
    var list = jQuery("<ul class='" + givenClass + "'  />");
    var itemid=1;
    jQuery(element).find("tr").each(function() {
        var p = jQuery(this).children().map(function() {
            return  jQuery(this).html();
        });

        list.append("<li class='itemID" + itemid + "'>" + jQuery.makeArray(p).join("") + "</li>");
    
		itemid = itemid + 1;
	});

    jQuery(element).replaceWith(list);
	
	if (hideOptions == "hide") {

			jQuery('#page ul.'+givenClass+' li:first-child').remove();
			/*jQuery('#page ul.'+givenClass+' li:nth-child(2)').hide();*/
			jQuery('#page ul.'+givenClass+' li:last-child').remove();
			
			jQuery('#page ul.'+givenClass+' li:nth-child(1) a').text("Key Features");
		
	}
	
	
	
}

/* convert table to list */


/* Move to bottom */

function movetobottom() {	
						
						var textToMove = jQuery('p.sendToBottom').html(); 
	
						//alert (textToMove);
						
						jQuery('.sendToBottom').css('display', 'none'); 
						
						if (textToMove != null ) {
						
						document.write("<span class='disclaimerText'>" + textToMove + "</span>");
				
						}
}
	
	
	





/* jQuery Rotator */

;(function(jQuery) {
	jQuery.fn.wtRotator = function(params) {
				var TOP_LEFT = "TL";
		var TOP_RIGHT = "TR";
		var TOP_CENTER = "TC";
		var BOTTOM_LEFT = "BL";
		var BOTTOM_RIGHT = "BR";		
		var BOTTOM_CENTER = "BC";
		var INSIDE = "inside";
		var OUTSIDE = "outside";
		
		var EFFECTS = new Array(42);		
		EFFECTS["fade"] 			= 0;		
		EFFECTS["block.top"] 		= 1;
		EFFECTS["block.right"] 		= 2;
		EFFECTS["block.bottom"]		= 3;
		EFFECTS["block.left"] 		= 4;		
		EFFECTS["block.drop"]  		= 5;		
		EFFECTS["diag.fade"] 		= 6;
		EFFECTS["diag.exp"] 		= 7;		
		EFFECTS["rev.diag.fade"] 	= 8;
		EFFECTS["rev.diag.exp"] 	= 9;		
		EFFECTS["block.fade"] 	 	= 10;
		EFFECTS["block.exp"] 		= 11;
		EFFECTS["block.top.zz"] 	= 12;
		EFFECTS["block.bottom.zz"] 	= 13;
		EFFECTS["block.left.zz"] 	= 14;
		EFFECTS["block.right.zz"]  	= 15;		
		EFFECTS["spiral.in"]		= 16;	
		EFFECTS["spiral.out"]		= 17;
		EFFECTS["vert.tl"] 			= 18;
		EFFECTS["vert.tr"] 			= 19;
		EFFECTS["vert.bl"] 			= 20;
		EFFECTS["vert.br"] 			= 21;		
		EFFECTS["fade.left"] 		= 22;	
		EFFECTS["fade.right"]		= 23;		
		EFFECTS["alt.left"]     	= 24;
		EFFECTS["alt.right"]    	= 25;
		EFFECTS["blinds.left"]  	= 26;
		EFFECTS["blinds.right"] 	= 27;		
		EFFECTS["vert.random.fade"]	= 28;	
		EFFECTS["horz.tl"] 			= 29;
		EFFECTS["horz.tr"] 			= 30;		
		EFFECTS["horz.bl"] 			= 31;
		EFFECTS["horz.br"] 			= 32;		
		EFFECTS["fade.top"] 		= 33;
		EFFECTS["fade.bottom"]		= 34;
		EFFECTS["alt.top"]      	= 35;
		EFFECTS["alt.bottom"]   	= 36;
		EFFECTS["blinds.top"]   	= 37;
		EFFECTS["blinds.bottom"]	= 38;	
		EFFECTS["horz.random.fade"]	= 39;			
		EFFECTS["none"] 			= 40;
		EFFECTS["random"] 			= 41;
		
		var TEXT_EFFECTS = new Array(4);	
		TEXT_EFFECTS["fade"]  = 0;
		TEXT_EFFECTS["down"]  = 1;
		TEXT_EFFECTS["right"] = 2;
		TEXT_EFFECTS["none"]  = 3;
		
		var DEFAULT_DELAY = 5000;
		var DURATION = 800;
		var ANIMATE_SPEED = 600;
		var TOOLTIP_DELAY = 600;
		var UPDATE_TEXT = "updatetext";
		
		//Vertical Stripes
		function VertStripes(rotator, areaWidth, areaHeight, stripeSize, bgColor, duration, delay) {
			var jQuerystripes;
			var jQueryarr;
			var total;
			var intervalId = null;
			
			//init stripes
			var init = function() {
				total = Math.ceil(areaWidth/stripeSize);
				var divs = "";
				for (var i = 0; i < total; i++) {
					divs += "<div class='vpiece' id='" + i + "'></div>";
				}					
				rotator.addToScreen(divs);
				
				jQuerystripes = jQuery("div.vpiece", rotator.jQueryel);
				jQueryarr = new Array(total);
				jQuerystripes.each(
					function(n) {						
						jQuery(this).css({left:(n * stripeSize), height: areaHeight});
						jQueryarr[n] = jQuery(this);
					}
				);	
			}

			//clear animation
			this.clear = function() {
				clearInterval(intervalId);
				jQuerystripes.stop(true).css({"z-index":2, opacity:0});
			}

			//display content
			this.displayContent = function(jQueryimg, effect) {
				setPieces(jQueryimg, effect);
				if (effect == EFFECTS["vert.random.fade"]) {
					animateRandom(jQueryimg);
				}
				else {
					animate(jQueryimg, effect);
				}
			}			
			
			//set image stripes
			var setPieces = function(jQueryimg, effect) {
				switch (effect) {
					case EFFECTS["vert.tl"]:
					case EFFECTS["vert.tr"]:
						setVertPieces(jQueryimg, -areaHeight, 1, stripeSize, false);		
						break;
					case EFFECTS["vert.bl"]:
					case EFFECTS["vert.br"]:
						setVertPieces(jQueryimg, areaHeight, 1, stripeSize, false);
						break;
					case EFFECTS["alt.left"]:
					case EFFECTS["alt.right"]:
						setVertPieces(jQueryimg, 0, 1, stripeSize, true);
						break;
					case EFFECTS["blinds.left"]:
					case EFFECTS["blinds.right"]:
						setVertPieces(jQueryimg, 0, 1, 0, false);
						break;
					default:
						setVertPieces(jQueryimg, 0, 0, stripeSize, false);
				}
			}
			
			//set vertical stripes
			var setVertPieces = function(jQueryimg, topPos, opacity, width, alt) {
				var imgSrc = jQueryimg.attr("src");
				var tOffset = (areaHeight - jQueryimg.height())/2;
				var lOffset = (areaWidth - jQueryimg.width())/2;
				for (var i = 0; i < total; i++) {		
					var xPos =  ((-i * stripeSize) + lOffset);
					if (alt) {
						topPos = (i % 2) == 0 ? -areaHeight: areaHeight;
					}
					jQuery(jQuerystripes.get(i)).css({background:bgColor + " url('"+ imgSrc +"') no-repeat", backgroundPosition:xPos + "px " + tOffset + "px",						   
											opacity:opacity, top:topPos, width:width, "z-index":3});						
				}
			}
			
			//animate stripes			
			var animate = function(jQueryimg, effect) {
				var start, end, incr, limit;
				switch (effect) {
					case EFFECTS["vert.tl"]:   case EFFECTS["vert.bl"]: 
					case EFFECTS["fade.left"]: case EFFECTS["blinds.left"]: 
					case EFFECTS["alt.left"]:
						start = 0;
						end = total - 1;
						incr = 1;	
						break;
					default:
						start = total - 1;
						end = 0;
						incr = -1;
				}
				
				intervalId = setInterval(
					function() {
						jQuery(jQuerystripes.get(start)).animate({top:0, opacity:1, width:stripeSize}, duration, "",
							function() {
								if (jQuery(this).attr("id") == end) {
									rotator.setComplete(jQueryimg);
								}
							}
						);
						if (start == end) {
							clearInterval(intervalId);
						}
						start += incr;
					}, delay);							
			}
			
			//animate random fade 
			var animateRandom = function(jQueryimg) {		
				shuffleArray(jQueryarr);
				var i = 0;
				var count = 0;
				intervalId = setInterval(
					function() {
						jQueryarr[i++].animate({opacity:1}, duration, "",
								function() {
									if (++count == total) {
										rotator.setComplete(jQueryimg);
									}
								});
						if (i == total) {
							clearInterval(intervalId);
						}
					}, delay);			
			}
			
			init();
		}
		
		//Horizontal Stripes
		function HorzStripes(rotator, areaWidth, areaHeight, stripeSize, bgColor, duration, delay) {
			var jQuerystripes;
			var jQueryarr;
			var total;
			var intervalId = null;
			
			//init stripes
			var init = function() {			
				total = Math.ceil(areaHeight/stripeSize);				
				var divs = "";
				for (var j = 0; j < total; j++) {
					divs += "<div class='hpiece' id='" + j + "'><!-- --></div>";
				}				
				rotator.addToScreen(divs);
				
				jQuerystripes = jQuery("div.hpiece", rotator.jQueryel);
				jQueryarr = new Array(total);
				jQuerystripes.each(
					function(n) {
						jQuery(this).css({top:(n * stripeSize), width: areaWidth});
						jQueryarr[n] = jQuery(this);
					}							 
				);
			}

			//clear animation
			this.clear = function() {
				clearInterval(intervalId);
				jQuerystripes.stop(true).css({"z-index":2, opacity:0});
			}

			//display content
			this.displayContent = function(jQueryimg, effect) {
				setPieces(jQueryimg, effect);
				if (effect == EFFECTS["horz.random.fade"]) {
					animateRandom(jQueryimg);
				}
				else {
					animate(jQueryimg, effect);
				}
			}			
			
			//set image stripes
			var setPieces = function(jQueryimg, effect) {
				switch (effect) {
					case EFFECTS["horz.tr"]:
					case EFFECTS["horz.br"]:
						setHorzPieces(jQueryimg, areaWidth, 1, stripeSize, false);		
						break;
					case EFFECTS["horz.tl"]:
					case EFFECTS["horz.bl"]:
						setHorzPieces(jQueryimg, -areaWidth, 1, stripeSize, false);
						break;
					case EFFECTS["alt.top"]:
					case EFFECTS["alt.bottom"]:
						setHorzPieces(jQueryimg, 0, 1, stripeSize, true);
						break;
					case EFFECTS["blinds.top"]:
					case EFFECTS["blinds.bottom"]:
						setHorzPieces(jQueryimg, 0, 1, 0, false);
						break;
					default:
						setHorzPieces(jQueryimg, 0, 0, stripeSize, false);		
				}
			}
			
			//set horizontal stripes
			var setHorzPieces = function(jQueryimg, leftPos, opacity, height, alt) {
				var imgSrc = jQueryimg.attr("src");
				var tOffset = (areaHeight - jQueryimg.height())/2;
				var lOffset = (areaWidth - jQueryimg.width())/2;
				for (var i = 0; i < total; i++) {			
					var yPos = ((-i * stripeSize) + tOffset);
					if (alt) {
						leftPos = (i % 2) == 0 ? -areaWidth: areaWidth;
					}
					jQuery(jQuerystripes.get(i)).css({background:bgColor + " url('"+ imgSrc +"') no-repeat", backgroundPosition:lOffset + "px " + yPos + "px",
											opacity:opacity, left:leftPos, height:height, "z-index":3});			  
				}
			}
			
			//animate stripes			
			var animate = function(jQueryimg, effect) {
				var start, end, incr;
				switch (effect) {
					case EFFECTS["horz.tl"]:  case EFFECTS["horz.tr"]: 
					case EFFECTS["fade.top"]: case EFFECTS["blinds.top"]: 
					case EFFECTS["alt.top"]:
						start = 0;
						end = total - 1;
						incr = 1;
						break;
					default:
						start = total - 1;
						end = 0;
						incr = -1;
				}
				
				intervalId = setInterval(
					function() {
						jQuery(jQuerystripes.get(start)).animate({left:0, opacity:1, height:stripeSize}, duration, "",
							function() {
								if (jQuery(this).attr("id") == end) {
									rotator.setComplete(jQueryimg);
								}
							}
						);						
						if (start == end) {
							clearInterval(intervalId);
						}
						start += incr;
					}, delay);							
			}
			
			//animate random fade 
			var animateRandom = function(jQueryimg) {		
				shuffleArray(jQueryarr);
				var i = 0;
				var count = 0;
				intervalId = setInterval(
					function() {
						jQueryarr[i++].animate({opacity:1}, duration, "",
								function() {
									if (++count == total) {
										rotator.setComplete(jQueryimg);
									}
								});
						if (i == total) {
							clearInterval(intervalId);
						}
					}, delay);			
			}
			
			init();
		}
		
		//class Blocks
		function Blocks(rotator, areaWidth, areaHeight, blockSize, bgColor, duration, delay) {
			var jQueryblockArr;
			var jQueryblocks;
			var jQueryarr;
			var numRows;
			var numCols;
			var total;
			var intervalId;
			
			//init blocks
			var init = function() {
				numRows = Math.ceil(areaHeight/blockSize);
				numCols = Math.ceil(areaWidth/blockSize);				
				total = numRows * numCols;
				var divs = "";								
				for (var i = 0; i < numRows; i++) {					
					for (var j = 0; j < numCols; j++) {
						divs += "<div class='block' id='" + i + "-" + j + "'></div>";		
					}
				}
				rotator.addToScreen(divs);
				jQueryblocks = jQuery("div.block", rotator.jQueryel);	
				jQueryblocks.data({tlId:"0-0", trId:"0-"+(numCols - 1), blId:(numRows - 1)+"-0", brId:(numRows - 1)+"-"+(numCols - 1)});
				
				var k = 0;
				jQueryarr = new Array(total);
				jQueryblockArr = new Array(numRows);
				for (var i = 0; i < numRows; i++) {
					jQueryblockArr[i] = new Array(numCols);
					for (var j = 0; j < numCols; j++) {
						jQueryblockArr[i][j] = jQueryarr[k++] = jQueryblocks.filter("#" + (i + "-" + j)).data("top", i * blockSize);
					}
				}				
			}
			
			//clear blocks
			this.clear = function() {
				clearInterval(intervalId);
				jQueryblocks.stop(true).css({"z-index":2, opacity:0});
			}
			
			//display content
			this.displayContent = function(jQueryimg, effect) {
				switch (effect) {
					case EFFECTS["diag.fade"]:
						setBlocks(jQueryimg, 0, blockSize, 0);
						diagAnimate(jQueryimg, {opacity:1}, false);		
						break;
					case EFFECTS["diag.exp"]:
						setBlocks(jQueryimg, 0, 0, 0);
						diagAnimate(jQueryimg, {opacity:1, width:blockSize, height:blockSize}, false);
						break;
					case EFFECTS["rev.diag.fade"]:
						setBlocks(jQueryimg, 0, blockSize, 0);
						diagAnimate(jQueryimg, {opacity:1}, true);
						break;
					case EFFECTS["rev.diag.exp"]:
						setBlocks(jQueryimg, 0, 0, 0);
						diagAnimate(jQueryimg, {opacity:1, width:blockSize, height:blockSize}, true);
						break;
					case EFFECTS["block.fade"]:
						setBlocks(jQueryimg, 0, blockSize, 0);
						randomAnimate(jQueryimg);
						break;
					case EFFECTS["block.exp"]:
						setBlocks(jQueryimg, 1, 0, 0);
						randomAnimate(jQueryimg);
						break; 
					case EFFECTS["block.drop"]:
						setBlocks(jQueryimg, 1, blockSize, -(numRows * blockSize));
						randomAnimate(jQueryimg);
						break;
					case EFFECTS["block.top.zz"]: 
					case EFFECTS["block.bottom.zz"]:					
						setBlocks(jQueryimg, 0, blockSize, 0);
						horzZigZag(jQueryimg, effect);
						break;
					case EFFECTS["block.left.zz"]: 
					case EFFECTS["block.right.zz"]:
						setBlocks(jQueryimg, 0, blockSize, 0);
						vertZigZag(jQueryimg, effect);
						break;
					case EFFECTS["spiral.in"]:
						setBlocks(jQueryimg, 0, blockSize, 0);
						spiral(jQueryimg, false);
						break;
					case EFFECTS["spiral.out"]:
						setBlocks(jQueryimg, 0, blockSize, 0);
						spiral(jQueryimg, true);
						break;
					default:
						setBlocks(jQueryimg, 1, 0, 0);
						dirAnimate(jQueryimg, effect);					
				}
			}
			
			//set blocks 
			var setBlocks = function(jQueryimg, opacity, size, tPos) {
				var tOffset = (areaHeight - jQueryimg.height())/2;
				var lOffset = (areaWidth - jQueryimg.width())/2;
				var imgSrc = jQueryimg.attr("src");
				for (var i = 0; i < numRows; i++) {							
					for (var j = 0; j < numCols; j++) {
						var tVal = ((-i * blockSize) + tOffset);
						var lVal = ((-j * blockSize) + lOffset);
						jQueryblockArr[i][j].css({background:bgColor + " url('"+ imgSrc +"') no-repeat", backgroundPosition:lVal + "px " + tVal + "px",
											 opacity:opacity, top:(i * blockSize) + tPos, left:(j * blockSize), width:size, height:size, "z-index":3});
					}					
				}
			}
			
			//diagonal effect
			var diagAnimate = function(jQueryimg, props, rev) {
				var jQueryarray = new Array(total);
				var start, end, incr, lastId;
				var diagSpan = (numRows - 1) + (numCols - 1);
				if (rev) {				
					start = diagSpan;
					end = -1;
					incr = -1;
					lastId = jQueryblocks.data("tlId");
				}
				else {
					start = 0;
					end = diagSpan + 1;
					incr = 1;
					lastId = jQueryblocks.data("brId");
				}
				
				var count = 0;
				while (start != end) {
					i = Math.min(numRows - 1, start);
					while(i >= 0) {			
						j = Math.abs(i - start);
						if (j >= numCols) {
							break;
						}
						jQueryarray[count++] = jQueryblockArr[i][j];
						i--;
					}
					start+=incr;	
				}
				
				count = 0;
				intervalId = setInterval(
					function() {
						jQueryarray[count++].animate(props, duration, "",
								function() {
									if (jQuery(this).attr("id") == lastId) {
										rotator.setComplete(jQueryimg);
									}
								});							
						if (count == total) {
							clearInterval(intervalId);
						}			
					}, delay);				
			}

			//vertical zig zag effect
			var vertZigZag = function(jQueryimg, effect) {
				var fwd = true;
				var i = 0, j, incr, lastId;
				if (effect == EFFECTS["block.left.zz"]) {
					lastId = (numCols%2 == 0) ? jQueryblocks.data("trId") : jQueryblocks.data("brId");
					j = 0;
					incr = 1;
				}
				else {
					lastId = (numCols%2 == 0) ? jQueryblocks.data("tlId") : jQueryblocks.data("blId");
					j = numCols - 1;
					incr = -1;
				}
				
				intervalId = setInterval(
					function() {
						jQueryblockArr[i][j].animate({opacity:1}, duration, "",
								function() {
									if (jQuery(this).attr("id") == lastId) {
										rotator.setComplete(jQueryimg);
									}});
						
						if (jQueryblockArr[i][j].attr("id") == lastId) {
							clearInterval(intervalId);
						}
						
						(fwd ? i++ : i--);
						if (i == numRows || i < 0) {
							fwd = !fwd;
							i = (fwd ? 0 : numRows - 1);
							j+=incr;
						}						
					}, delay);
			}
			
			//horizontal zig zag effect
			var horzZigZag = function(jQueryimg, effect) {
				var fwd = true;
				var i, j = 0, incr, lastId;
				if (effect == EFFECTS["block.top.zz"]) {
					lastId = (numRows%2 == 0) ? jQueryblocks.data("blId") : jQueryblocks.data("brId");
					i = 0;
					incr = 1;
				}
				else {
					lastId = (numRows%2 == 0) ? jQueryblocks.data("tlId") : jQueryblocks.data("trId");
					i = numRows - 1;
					incr = -1;
				}
				
				intervalId = setInterval(
					function() {
						jQueryblockArr[i][j].animate({opacity:1}, duration, "",
								function() {
									if (jQuery(this).attr("id") == lastId) {
										rotator.setComplete(jQueryimg);
									}});
						
						if (jQueryblockArr[i][j].attr("id") == lastId) {
							clearInterval(intervalId);
						}
						
						(fwd ? j++ : j--);
						if (j == numCols || j < 0) {
							fwd = !fwd;
							j = (fwd ? 0 : numCols - 1);
							i+=incr;
						}						
					}, delay);
			}
			
			//vertical direction effect
			var dirAnimate = function(jQueryimg, effect) {
				var jQueryarray = new Array(total);
				var lastId;
				var count = 0;
				switch (effect) {
					case EFFECTS["block.left"]:
						lastId = jQueryblocks.data("brId");
						for (var j = 0; j < numCols; j++) {
							for (var i = 0; i < numRows; i++) {
								jQueryarray[count++] = jQueryblockArr[i][j];			
							}
						}
						break;
					case EFFECTS["block.right"]:
						lastId = jQueryblocks.data("blId");
						for (var j = numCols - 1; j >= 0; j--) {
							for (var i = 0; i < numRows; i++) {
								jQueryarray[count++] = jQueryblockArr[i][j];			
							}
						}					
						break;
					case EFFECTS["block.top"]:
						lastId = jQueryblocks.data("brId");
						for (var i = 0; i < numRows; i++) {
							for (var j = 0; j < numCols; j++) {
								jQueryarray[count++] = jQueryblockArr[i][j];			
							}
						}					
						break;
					default:
						lastId = jQueryblocks.data("trId");
						for (var i = numRows - 1; i >= 0; i--) {
							for (var j = 0; j < numCols; j++) {
								jQueryarray[count++] = jQueryblockArr[i][j];			
							}
						}
				}
				count = 0;
				intervalId = setInterval(
					function() {
						jQueryarray[count++].animate({width:blockSize, height:blockSize}, duration, "",
								function() {
									if (jQuery(this).attr("id") == lastId) {
										rotator.setComplete(jQueryimg);
									}
								});	
						if (count == total) {
							clearInterval(intervalId);	
						}
					}, delay);
			}
			
			//random block effect
			var randomAnimate = function(jQueryimg) {
				shuffleArray(jQueryarr);
				var i = 0;
				count = 0;
				intervalId = setInterval(
					function() {
						jQueryarr[i].animate({top:jQueryarr[i].data("top"), width:blockSize, height:blockSize, opacity:1}, duration, "",
								function() {
									if (++count == total) {
										rotator.setComplete(jQueryimg);
									}
								});	
						i++;
						if (i == total) {
							clearInterval(intervalId);
						}
					}, delay);
			}
			
			//spiral effect
			var spiral = function(jQueryimg, spiralOut) {			
				var i = 0, j = 0;
				var rowCount = numRows - 1;
				var colCount = numCols - 1;
				var dir = 0;
				var limit = colCount;
				var jQueryarray = new Array();
				while (rowCount >= 0 && colCount >=0) {
					var count = 0; 
					while(true) { 
						jQueryarray[jQueryarray.length] = jQueryblockArr[i][j];
						if ((++count) > limit) {
							break;
						}
						switch(dir) {
							case 0:
								j++;
								break;
							case 1:
								i++;
								break;
							case 2:
								j--;
								break;
							case 3:
								i--;
						}
   					} 
					switch(dir) {
						case 0:
							dir = 1;
							limit = (--rowCount);
							i++;
							break;
						case 1:
							dir = 2;
							limit = (--colCount);
							j--;
							break;
						case 2:
							dir = 3;
							limit = (--rowCount);
							i--;
							break;
						case 3:
							dir = 0;
							limit = (--colCount);
							j++;
					}
				}
				if (jQueryarray.length > 0) {
					if (spiralOut) {
						jQueryarray.reverse();
					}
					var end = jQueryarray.length - 1;
					var lastId = jQueryarray[end].attr("id");
					var k = 0;				
					intervalId = setInterval(
						function() {
							jQueryarray[k].animate({opacity:1}, duration, "",
								function() {
									if (jQuery(this).attr("id") == lastId) {
										rotator.setComplete(jQueryimg);
									}
								});						
							if (k == end) {
								clearInterval(intervalId);	
							}	
							k++;
						}, delay);					
				}
			}
			
			init();
		}
		
		//class Rotator
		function Rotator(jQueryobj, opts) {
			//set options
			var screenWidth =  	getPosNumber(opts.width, 825);
			var screenHeight = 	getPosNumber(opts.height, 300);
			var margin = 		getNonNegNumber(opts.button_margin, 4);
			var globalEffect = 	opts.transition.toLowerCase();	
			var duration =   	getPosNumber(opts.transition_speed, DURATION);
			var globalDelay = 	getPosNumber(opts.delay, DEFAULT_DELAY);
			var rotate = 		opts.auto_start;	
			var cpPos =			opts.cpanel_position.toLowerCase();
			var cpAlign = 		opts.cpanel_align.toUpperCase();
			var buttonWidth =  	getPosNumber(opts.button_width, 24);
			var buttonHeight =	getPosNumber(opts.button_height, 24);
			var displayThumbs = opts.display_thumbs;
			var displayDBtns = 	opts.display_dbuttons;
			var displayPlayBtn =opts.display_playbutton;
			var cpMouseover = 	opts.cpanel_mouseover;
			var textMousover = 	opts.text_mouseover;
			var pauseMouseover =opts.mouseover_pause;
			var tooltipType = 	opts.tooltip_type.toLowerCase();
			var textEffect = 	opts.text_effect.toLowerCase();
			var textSync =		opts.text_sync;
			
			var numItems;
			var currIndex;
			var prevIndex;
			var delay;		
			var vStripes;
			var hStripes;
			var blocks;		
			var timerId = null;
			
			var jQueryrotator = jQuery(".wt-rotator", jQueryobj);
			var jQueryscreen = jQueryrotator.find("div.screen");
			var jQuerymainLink;
			var jQuerytextBox;
			var jQuerypreloader;			
			var jQuerycPanel 	= jQueryrotator.find("div.c-panel");
			var jQuerythumbPanel = jQuerycPanel.find("div.thumbnails");
			var jQuerythumbs 	= jQuerythumbPanel.find(">ul:first>li");
			var jQuerybuttonPanel2= jQuerycPanel.find("div.buttons");
			var jQuerybuttonPanel= jQueryrotator.find("div.buttons");
			var jQueryplayBtn 	= jQuerybuttonPanel.find("div.play-btn");
			var jQueryprevBtn 	= jQuerybuttonPanel.find("div.prev-btn");
			var jQuerynextBtn 	= jQuerybuttonPanel.find("div.next-btn");
			var jQuerytimer;
			var jQuerytooltip;
			var jQueryitems;
			var jQueryinnerText;
			this.jQueryel = jQueryobj;
			
			//init rotator
			this.init = function() {
				currIndex = 0;
				prevIndex = -1;
				numItems = jQuerythumbs.size();	
				jQueryitems = new Array(numItems);
				
				//init components
				initScreen();
				initTextBox();
				initItems();
				initButtons();
				initCPanel();
				initTimerBar();
				
				jQueryrotator.css({width:screenWidth, height:screenHeight + (cpPos == OUTSIDE ? jQuerycPanel.outerHeight(): 0)});
				
				//init transition components
				var bgColor = jQueryscreen.css("background-color");
				vStripes =  new VertStripes(this, screenWidth, screenHeight, getPosNumber(opts.vert_size, 50), bgColor, duration, getPosNumber(opts.vstripe_delay, 75));
				hStripes =  new HorzStripes(this, screenWidth, screenHeight, getPosNumber(opts.horz_size, 50), bgColor, duration, getPosNumber(opts.hstripe_delay, 75));				
				blocks = 	new Blocks(this, screenWidth, screenHeight, getPosNumber(opts.block_size, 75), bgColor, duration, getPosNumber(opts.block_delay, 25));	
				
				//init image loading
				loadImg(0);
				
				//display initial image
				loadContent(currIndex);
			}
			
			//set complete
			this.setComplete = function(jQueryimg) {
				showContent(jQueryimg);
			}
			
			//add to screen
			this.addToScreen = function(content) {
				jQuerymainLink.append(content);
			}
			
			//init screen
			var initScreen = function() {
				var content =  "<a class='#' href='#'></a>\
								<div class='desc'></div>\
								<div class='preloader'></div>\
								<div id='timer'></div>";
				jQueryscreen.empty().append(content);
				jQuerymainLink 	= jQueryscreen.find(">a:first");
			 	jQuerytextBox 	= jQueryscreen.find("div.desc");
			 	jQuerypreloader 	= jQueryscreen.find("div.preloader");
				jQueryscreen.css({width:screenWidth, height:screenHeight});
			}
			
			//init text box
			var initTextBox = function() {								
				jQuerytextBox.append("<div class='inner-bg'></div><div class='inner-text'></div>");
				jQueryinnerText = jQuerytextBox.find("div.inner-text");
				if (textMousover) {
					jQueryrotator.hover(displayText, hideText);
				}
				else {
					jQueryrotator.bind(UPDATE_TEXT, updateText);
				}
			}
			
			//init control panel
			var initCPanel = function() {	
				if (displayThumbs || displayDBtns || displayPlayBtn) {
					jQuerythumbPanel.css("height", jQuerythumbs.outerHeight());
					var maxWidth = screenWidth - (jQuerybuttonPanel.width() + margin);
					if (jQuerythumbPanel.width() > maxWidth) {
						jQuerythumbPanel.width(maxWidth);
					}
					if (cpPos == INSIDE) {
						jQuerycPanel.css({"margin-top":margin, "margin-right":0, "margin-bottom":margin, "margin-left":margin});
						var cpWidth = jQuerycPanel.outerWidth(true);
						var cpHeight = jQuerycPanel.outerHeight(true);
						switch (cpAlign) {
							case TOP_LEFT:
								setCPanel(0, 0, -cpHeight, "left");			
								break;
							case TOP_CENTER:
								setCPanel(0, Math.round((screenWidth - cpWidth)/2), -cpHeight, "right");
								break;
							case TOP_RIGHT:
								setCPanel(0, (screenWidth - cpWidth), -cpHeight, "right");
								break;
							case BOTTOM_LEFT:
								setCPanel((screenHeight - cpHeight), 0, screenHeight, "left");
								break;
							case BOTTOM_CENTER:
								setCPanel((screenHeight - cpHeight), Math.round((screenWidth - cpWidth)/2), screenHeight, "right");
								break;
							default:
								setCPanel((screenHeight - cpHeight), (screenWidth - cpWidth), screenHeight, "right");
						}
						
						if (cpMouseover) {
							jQueryrotator.hover(displayCPanel, hideCPanel);
						}
					}
					else {
						if (jQueryrotator.outerWidth() - jQueryrotator.width() > 0) {
							jQuerycPanel.css({"border-left":"none", "border-right":"none"});
						}
						jQuerycPanel.css({"padding-top":margin, "padding-bottom":margin}).addClass("cp-bg");
						var cpWidth = jQuerycPanel.outerWidth();
						switch (cpAlign) {
							case TOP_LEFT:
								setOutsideCPanel(jQuerycPanel.outerHeight(), 0, margin, "left");
								break;
							case TOP_CENTER:
								setOutsideCPanel(jQuerycPanel.outerHeight(), 0, Math.round((screenWidth - cpWidth)/2), "right");
								break;
							case TOP_RIGHT:
								setOutsideCPanel(jQuerycPanel.outerHeight(), 0, screenWidth - cpWidth, "right");
								break;
							case BOTTOM_LEFT:
								setOutsideCPanel(0, screenHeight, margin, "left");
								break;
							case BOTTOM_CENTER:
								setOutsideCPanel(0, screenHeight, Math.round((screenWidth - cpWidth)/2), "right");
								break;
							default:
								setOutsideCPanel(0, screenHeight, screenWidth - cpWidth, "right");					
						}
					}
					jQuerycPanel.css("visibility", "visible");
				}
			}
			
			//set control panel attributes
			var setCPanel = function(yPos, xPos, offset, align) {
				jQuerycPanel.data({offset:offset, pos:yPos}).css({top:(cpMouseover ? offset : yPos), left:xPos});
				jQuerythumbPanel.css("float", align);
				jQuerybuttonPanel.css("float", align);	   
			}
			
			//set outside control panel attributes
			var setOutsideCPanel = function(screenTop, cpTop, leftPad, align) {
				jQueryscreen.css("top",screenTop);
				jQuerycPanel.css(screenTop == 0 ? "border-bottom": "border-top", "none");
				jQuerycPanel.css({top:cpTop, "padding-left":leftPad, "padding-right":screenWidth - (leftPad + jQuerycPanel.outerWidth())});
				jQuerythumbPanel.css("float", align);
				jQuerybuttonPanel.css("float", align);	   
			}
			
			//init buttons
			var initButtons = function() {
				var props = {"margin-right":margin, width:buttonWidth, height:buttonHeight};
				//config directional buttons
				if (displayDBtns) {					
					jQueryprevBtn.css(props).click(prevImg).mouseover(buttonOver).mouseout(buttonOut).mousedown(preventDefault);
					jQuerynextBtn.css(props).click(nextImg).mouseover(buttonOver).mouseout(buttonOut).mousedown(preventDefault);					
				}
				else {
					jQueryprevBtn.hide();
					jQuerynextBtn.hide();
				}
				
				//config play button
				if (displayPlayBtn) {
					if (rotate) {
						jQueryplayBtn.addClass("pause");
					}			
					jQueryplayBtn.css(props).click(togglePlay).mouseover(buttonOver).mouseout(buttonOut).mousedown(preventDefault);
				}
				else {
					jQueryplayBtn.hide();
				}
				
				if (pauseMouseover) {
					jQueryrotator.hover(pause, play);
				}
			}			
			
			//init timer bar
			var initTimerBar = function() {
				jQuerytimer = jQueryscreen.find("#timer").data("pct", 1);
				if (opts.display_timer) {
					var align = opts.timer_align.toLowerCase();
					jQuerytimer.css("visibility", "visible");
					jQuerytimer.css(align == "bottom" ? "bottom" : "top", 0);
				}
				else {
					jQuerytimer.hide();
				}
			}
			
			//init items
			var initItems = function() {
				var padding = jQueryinnerText.outerHeight() - jQueryinnerText.height();
				jQuerythumbs.each(
					function(n) {
						var jQueryimgLink = jQuery(this).find(">a:first");
						jQuery(this).data({imgurl:jQueryimgLink.attr("href"), caption:jQueryimgLink.attr("title"), tturl:jQueryimgLink.find(">img:first").attr("src"),
							   		  effect:EFFECTS[jQuery(this).attr("effect")] != undefined ? EFFECTS[jQuery(this).attr("effect")] : EFFECTS[globalEffect],
							   		  delay:getPosNumber(jQuery(this).attr("delay"), globalDelay)});
						initTextData(jQuery(this), padding);				
						jQueryitems[n] = jQuery(this);
						
						if (opts.display_numbers) {
							jQuery(this).append(n+1);
						}
					}
				);
				jQueryinnerText.css({width:"auto", height:"auto"}).html("");
				jQuerytextBox.css("visibility", "visible");

				if (opts.shuffle) {
					shuffleItems();
				}
				
				if (displayThumbs) { 
					jQuerythumbPanel.click(selectItem);
					jQuerythumbs.css({width:buttonWidth, height:buttonHeight, "line-height":buttonHeight + "px", "margin-right":margin})
						   .mouseover(itemOver).mouseout(itemOut).mousedown(preventDefault);
					initTooltip();
				}
				else {
					jQuerythumbs.hide();
				}
			}			
			
			//init text data
			var initTextData = function(jQueryitem, padding) {				
				var jQueryp = jQueryitem.find(">div:hidden");				
				var textWidth =  getPosNumber(parseInt(jQueryp.css("width")) - padding, 300);				
				var textHeight = getPosNumber(parseInt(jQueryp.css("height")) - padding, 0);
				jQueryinnerText.width(textWidth).html(jQueryp.html());
				if (textHeight < jQueryinnerText.height()) {
					textHeight = jQueryinnerText.height();
				}
				jQueryitem.data("textbox", {x:jQueryp.css("left"), y:jQueryp.css("top"), w:textWidth + padding, h:textHeight + padding, color:jQueryp.css("color"), bgcolor:jQueryp.css("background-color")});
			}
			
			//init tool tip
			var initTooltip = function() {				
				jQuerytooltip = jQuery("<div id='rotator-tooltip'></div>");
				if (tooltipType == "text") {
					jQuerytooltip.append("<div class='tt-txt'></div>");
					jQuery("body").append(jQuerytooltip);
					switch (cpAlign) {
						case TOP_LEFT: case TOP_CENTER: case TOP_RIGHT:
							jQuerytooltip.data("bottom",true).addClass("txt-down");
							break;
						default:
							jQuerytooltip.data("bottom",false).addClass("txt-up");
					}
					
					for (var i = 0; i < jQueryitems.length; i++) {
						var caption = jQueryitems[i].data("caption");
						if (caption != "") {
							jQueryitems[i].mouseover(showTooltip).mouseout(hideTooltip).bind("mousemove", moveTooltip);
						}
					}
				}
				else if (tooltipType == "image") {
					jQuerytooltip.append("<img class='tt-img'/>");
					jQuery("body").append(jQuerytooltip);
					switch (cpAlign) {
						case TOP_LEFT: case TOP_CENTER: case TOP_RIGHT:
							jQuerytooltip.data("bottom",true).addClass("img-down");
							break;
						default:
							jQuerytooltip.data("bottom",false).addClass("img-up");
					}
					
					for (var i = 0; i < jQueryitems.length; i++) {
						var tturl = jQueryitems[i].data("tturl");
						if (tturl != undefined) {
							jQueryitems[i].mouseover(showImgTooltip).mouseout(hideTooltip).bind("mousemove", moveImgTooltip);
						}
					}
				}
				
				if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
					jQuerytooltip.css("background-image", "none").find(":only-child").css("margin",0);
				}
			}
			
			//show image tooltip
			var showImgTooltip = function(e) {
				var yOffset = jQuerytooltip.data("bottom") ? 0 : -jQuerytooltip.outerHeight(true);
				jQuerytooltip.find(">img.tt-img").attr("src", jQueryitems[jQuery(this).index()].data("tturl"));
				jQuerytooltip.css({top:e.pageY + yOffset, left:e.pageX - jQuerytooltip.outerWidth()/2}).stop(true, true).delay(TOOLTIP_DELAY).fadeIn(300);
			}
			
			//move image tooltip
			var moveImgTooltip = function(e) {
				var yOffset = jQuerytooltip.data("bottom") ? 0 : -jQuerytooltip.outerHeight(true);
				jQuerytooltip.css({top:e.pageY + yOffset, left:e.pageX - jQuerytooltip.outerWidth()/2});
			}
			
			//show tooltip
			var showTooltip = function(e) {
				var yOffset = jQuerytooltip.data("bottom") ? 0 : -jQuerytooltip.outerHeight(true);
				jQuerytooltip.find(">div.tt-txt").html(jQueryitems[jQuery(this).index()].data("caption"));
				jQuerytooltip.css({top:e.pageY + yOffset, left:e.pageX}).stop(true, true).delay(TOOLTIP_DELAY).fadeIn(300);
			}
			
			//tooltip move
			var moveTooltip = function(e) {
				var yOffset = jQuerytooltip.data("bottom") ? 0 : -jQuerytooltip.outerHeight(true);
				jQuerytooltip.css({top:e.pageY + yOffset, left:e.pageX});
			}
			
			//hide tooltip
			var hideTooltip = function() {
				jQuerytooltip.stop(true, true).fadeOut(0);
			}
			
			//display control panel
			var displayCPanel = function() {
				jQuerycPanel.stop(true).animate({top:jQuerycPanel.data("pos"), opacity:1}, ANIMATE_SPEED);
			}
			
			//hide control panel
			var hideCPanel = function() {
				jQuerycPanel.stop(true).animate({top:jQuerycPanel.data("offset"), opacity:0}, ANIMATE_SPEED);
			}
			
			//select list item
			var selectItem = function(e) {
				if (e.target.nodeName == "LI") {
					var i = jQuery(e.target).index();	
					if ( i >= 0 && i != currIndex) {					
						resetTimer();
						prevIndex = currIndex;
						currIndex = i;
						loadContent(currIndex);
					}
				}
				return false;
			}
			
			//on item mouseover
			var itemOver = function() {
				jQuery(this).addClass("thumb-over");
			}
			
			//on item mouseout
			var itemOut = function() {
				jQuery(this).removeClass("thumb-over");
			}
			
			//go to previous image
			var prevImg = function() {
				resetTimer();
				prevIndex = currIndex;
				currIndex = (currIndex > 0) ? (currIndex - 1) : (numItems - 1);
				loadContent(currIndex);	
				return false;
			}
			
			//go to next image
			var nextImg = function() {
				resetTimer();
				prevIndex = currIndex;
				currIndex = (currIndex < numItems - 1) ? (currIndex + 1) : 0;
				loadContent(currIndex);
				return false;
			}
			
			//play/pause
			var togglePlay = function() {
				rotate = !rotate;
				jQuery(this).toggleClass("pause", rotate);					
				rotate ? startTimer() : pauseTimer();
				return false;
			}
			
			//play
			var play = function() {
				rotate = true;
				jQueryplayBtn.toggleClass("pause", rotate);
				startTimer();
			}

			//pause
			var pause = function() {
				rotate = false;
				jQueryplayBtn.toggleClass("pause", rotate);
				pauseTimer();
			}
						
			//on button over
			var buttonOver = function() {
				jQuery(this).addClass("button-over");
			}
			
			//on button out
			var buttonOut = function() {
				jQuery(this).removeClass("button-over");
			}
			
			//update text box
			var updateText = function(e) {
				if (!jQuerytextBox.data("visible")) {
					jQuerytextBox.data("visible", true);
					var text = jQueryitems[currIndex].find(">div:first").html();
					if (text && text.length > 0) {			
						var data = jQueryitems[currIndex].data("textbox");
						jQueryinnerText.css("color",data.color);
						jQuerytextBox.find(".inner-bg").css(" ",data.bgcolor);
						switch(TEXT_EFFECTS[textEffect]) {
							case TEXT_EFFECTS["fade"]:
								fadeInText(text, data);
								break;
							case TEXT_EFFECTS["down"]:
								expandText(text, {display:"block", top:data.y, left:data.x, width:data.w, height:0}, {height:data.h});
								break;
							case TEXT_EFFECTS["right"]:
								expandText(text, {display:"block", top:data.y, left:data.x, width:0, height:data.h}, {width:data.w});
								break;
							default:
								showText(text, data);
						}
					}					
				}
			}
			
			//reset text box
			var resetText = function() {
				jQuerytextBox.data("visible", false).stop(true, true);
				switch(TEXT_EFFECTS[textEffect]) {
					case TEXT_EFFECTS["fade"]:
						if (jQuery.browser.msie) {
							jQueryinnerText.css("opacity",0);
						}
						jQuerytextBox.fadeOut(ANIMATE_SPEED, function() { jQuery(this).css("display", "none"); });
						break;
					case TEXT_EFFECTS["down"]:
						jQueryinnerText.html("");
						jQuerytextBox.animate({height:0}, ANIMATE_SPEED);
						break;
					case TEXT_EFFECTS["right"]:
						jQueryinnerText.html("");
						jQuerytextBox.animate({width:0}, ANIMATE_SPEED);
						break;
					default:
						jQuerytextBox.css("display", "none");
				}
			}
			
			//expand text effect
			var expandText = function(text, props1, props2) {
				jQueryinnerText.html("");
				jQuerytextBox.stop(true).css(props1).animate(props2, ANIMATE_SPEED, 
					function () {  
						jQueryinnerText.html(text);
					});  
			}
			
			//fade in text effect
			var fadeInText = function(text, data) {
				jQueryinnerText.css("opacity",1).html(text);
				jQuerytextBox.css({top:data.y, left:data.x, width:data.w, height:data.h})
						.stop(true, true).fadeIn(ANIMATE_SPEED, function() {
																	if (jQuery.browser.msie) {
																		jQueryinnerText[0].style.removeAttribute('filter'); 
																	}
																});  
			}
			
			//show text effect
			var showText = function(text, data) {
				jQuerytextBox.stop(true).css({display:"block", top:data.y, left:data.x, width:data.w, height:data.h});  
				jQueryinnerText.html(text);
			}
			
			//display text panel on mouseover
			var displayText = function() {
				jQueryrotator.unbind(UPDATE_TEXT).bind(UPDATE_TEXT, updateText).trigger(UPDATE_TEXT);
			}

			//hide text panel on mouseovers
			var hideText = function() {
				jQueryrotator.unbind(UPDATE_TEXT);
				resetText();
			}
			
			//load current content
			var loadContent = function(i) {
				//select thumb
				jQuerythumbs.filter(".curr-thumb").removeClass("curr-thumb");				
				jQuery(jQuerythumbs.get(i)).addClass("curr-thumb");
				
				//set delay
				delay =	jQueryitems[i].data("delay");
				
				//reset text
				resetText();
				if (!textSync) {
					jQueryrotator.trigger(UPDATE_TEXT);
				}
				
				//set link
				var jQuerycurrLink = jQueryitems[i].find(">a:nth-child(2)");
				var href = jQuerycurrLink.attr("href");
				var myClass = jQuerycurrLink.attr("class");
				var target =  jQuerycurrLink.attr("target");
				
				//alert(myClass);
				
				if (href) {					
					
					
										
					/*if (jQuery.browser.msie) {
						
						jQuerymainLink.unbind("click").attr({href:href, className:myClass, target:target});
						
					}*/
						
				
					jQuerymainLink.unbind("click").prop({href:href, className:myClass, target:target});
						
				
					
	
						jQuery(".overlay-flash").fancybox({
							'padding'                : 0,
							'overlayOpacity'        : 0.75,
							'width'				: 820,
							'height'			: 565,
							'autoScale'     	: true,
							'transitionIn'		: 'none',
							'transitionOut'		: 'none',
							'hideOnContentClick'    : false,
							'scrolling':	'auto',
							'type'				: 'iframe'
						});
								
					
					
				}
				else {
					jQuerymainLink.click(preventDefault).css("cursor", "default");
				
				}
				
				
				//jQuerymainClass; 
				
				//load image
				if (jQueryitems[i].data("img")) {
					jQuerypreloader.hide();	
					displayContent(jQueryitems[i].data("img"));
				}	
				else {	
					//load new image
					var jQueryimg = jQuery("<img class='main-img'/>");
					jQueryimg.attr("src", jQueryitems[i].data("imgurl"));								
					if (!jQueryimg[0].complete) {		
						jQuerypreloader.show();
						jQueryimg.load(
							function() {
								jQuerypreloader.hide();
								storeImg(jQueryitems[i], jQuery(this));
								displayContent(jQuery(this));
							}
						).error(
							function() {
								alert("Error loading image");
							}
						);
					}
					else {
						jQuerypreloader.hide();
						storeImg(jQueryitems[i], jQueryimg);
						displayContent(jQueryimg);
					}
				}	    
			}
			
			//display content
			var displayContent = function(jQueryimg) {
				//clear
				vStripes.clear();
				hStripes.clear();
				blocks.clear();
				setPrevious();
				
				//get effect number
				var effect = jQueryitems[currIndex].data("effect");	
				if (effect == EFFECTS["none"]) {
					showContent(jQueryimg);
					return;
				}
				
				if (effect == EFFECTS["random"]) {
					effect = Math.floor(Math.random() * (EFFECTS.length - 2));
				}
				
				if (effect == EFFECTS["fade"]) {
					fadeInContent(jQueryimg);
				}
				else if (effect < EFFECTS["vert.tl"]) {
					blocks.displayContent(jQueryimg, effect);
				}
				else if (effect < EFFECTS["horz.tl"]) {
					vStripes.displayContent(jQueryimg, effect);
				}
				else {
					hStripes.displayContent(jQueryimg, effect);					
				}
			}
			
			//set previous
			var setPrevious = function() {
				if (prevIndex >= 0) {
					var currSrc = jQuery("img#curr-img").attr("src");
					
					var prevSrc = jQueryitems[prevIndex].data("imgurl");
					if (currSrc != prevSrc) {
						jQuery("img.main-img", jQuerymainLink).removeAttr("id").hide();
						var jQueryimg = jQuery("img.main-img", jQuerymainLink).filter(function() { return jQuery(this).attr("src") == prevSrc; });
						jQuery(jQueryimg.get(0)).show();
					}
				}
			}
			
			//display content (no effect)
			var showContent = function(jQueryimg) {
				if (textSync) {
					jQueryrotator.trigger(UPDATE_TEXT);
				}
				jQuery("img.main-img", jQuerymainLink).removeAttr("id").hide();
				jQueryimg.attr("id", "curr-img").show();
				startTimer();
			}
			
			
			//display content (fade effect)
			var fadeInContent = function(jQueryimg) {
				jQuery("img#curr-img", jQuerymainLink).stop(true, true);
				
				jQuery("img.main-img", jQuerymainLink).removeAttr("id").css("z-index", 0);
				jQueryimg.attr("id", "curr-img").css("z-index", 1).stop(true, true).fadeIn(duration, 
					function() {
						jQuery("img.main-img:not('#curr-img')", jQuerymainLink).hide();
						if (textSync) {
							jQueryrotator.trigger(UPDATE_TEXT);
						}
						startTimer();
					}
				);	
			}
			
			//load image
			var loadImg = function(loadIndex) {
				
				var jQueryitem = jQueryitems[loadIndex];
				var jQueryimg = jQuery("<img class='main-img'/>");
				jQueryimg.attr("src", jQueryitem.data("imgurl"));
				jQueryimg.load(function() {
							if (!jQueryitem.data("img")) {
								storeImg(jQueryitem, jQuery(this));
							}
							loadIndex++
							if (loadIndex < numItems) {
								loadImg(loadIndex);
							}
						})
					.error(function() {
							//error loading image, continue next
							loadIndex++
							if (loadIndex < numItems) {
								loadImg(loadIndex);
							}
						});
			}
			
			//process & store image
			var storeImg = function(jQueryitem, jQueryimg) {
				jQuerymainLink.append(jQueryimg);
			
				var tDiff = (screenHeight - jQueryimg.height())/2;
				var lDiff = (screenWidth  - jQueryimg.width())/2
				var top = 0, left = 0, vPad = 0, hPad = 0;
				if (tDiff > 0) {
					vPad = tDiff;
				}
				else if (tDiff < 0) {
					top = tDiff;
				}				
				if (lDiff > 0) {
					hPad = lDiff;
				}
				else if (lDiff < 0) {
					left = lDiff;
				}
				jQueryimg.css({top:top, left:left, "padding-top":vPad, "padding-bottom":vPad, "padding-left":hPad, "padding-right":hPad});	
				jQueryitem.data("img", jQueryimg);
			}
			
			//start timer
			var startTimer = function() {
				if (rotate && timerId == null) {
					var duration = Math.round(jQuerytimer.data("pct") * delay);
					jQuerytimer.animate({width:(jQuerytimer.parent().width()+1)}, duration);
					timerId = setTimeout(nextImg, duration);					
				}
			}
			
			//reset timer
			var resetTimer = function() {
				clearTimeout(timerId);
				timerId = null;
				jQuerytimer.stop(true).width(0).data("pct", 1);
			}
			
			//pause timer
			var pauseTimer = function() {
				clearTimeout(timerId);
				timerId = null;
				var pct = 1 - (jQuerytimer.width()/(jQuerytimer.parent().width()+1));
				jQuerytimer.stop(true).data("pct", pct);
			}
			
			//shuffle items
			var shuffleItems = function() {			
				for (var i = 0; i < jQueryitems.length; i++) {
					var ri = Math.floor(Math.random() * jQueryitems.length);
					var temp = jQueryitems[i];	
					jQueryitems[i] = jQueryitems[ri];
					jQueryitems[ri] = temp;				
				}
			}
			
			//prevent default behavior
			var preventDefault = function() {
				return false;
			}
		}		
			
		//get positive number
		var getPosNumber = function(val, defaultVal) {
			if (!isNaN(val) && val > 0) {
				return val;
			}
			return defaultVal;
		}
		
		//get nonnegative number
		var getNonNegNumber = function(val, defaultVal) {
			if (!isNaN(val) && val >= 0) {
				return val;
			}
			return defaultVal;
		}
		
		//shuffle array
		var shuffleArray = function(arr) {
			var total =  arr.length;
			for (var i = 0; i < total; i++) {
				var ri = Math.floor(Math.random() * total);
				var temp = arr[i];
				arr[i] = arr[ri];
				arr[ri] = temp;	
			}	
		}
		
		var defaults = { 
			width:825,
			height:300,
			button_width:24,
			button_height:24,
			button_margin:4,			
			auto_start:true,
			delay:DEFAULT_DELAY,
			transition:"fade",
			transition_speed:DURATION,
			cpanel_position:INSIDE,
			cpanel_align:BOTTOM_RIGHT,
			timer_align:"top",
			display_thumbs:true,
			display_dbuttons:true,
			display_playbutton:true,
			display_imgtooltip:true,
			display_numbers:true,
			display_timer:true,
			mouseover_pause:false,
			cpanel_mouseover:false,
			text_mouseover:false,
			text_effect:"fade",
			text_sync:true,
			tooltip_type:"text",
			shuffle:false,
			block_size:75,
			vert_size:50,
			horz_size:50,
			block_delay:25,
			vstripe_delay:75,
			hstripe_delay:75
		};
		
		var opts = jQuery.extend({}, defaults, params);		
		return this.each(
			function() {
				var rotator = new Rotator(jQuery(this), opts);
				rotator.init();
			}
		);
	}
})(jQuery);


/* popup */
function popUp(URL, WID, HEI, SCR) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + SCR + ",location=0,statusbar=0,menubar=0,resizable=0,width=" + WID + ",height=" + HEI + "');");
}





var newstate1 = 0;
	var newstate2 = 0;
	var newstate3 = 0;
	var newstate4 = 0;
	var newstate5 = 0;
	var newstate6 = 0;
	var newstate7 = 0;
	var newstate8 = 0;
	var newstate9 = 0;
	var newstate10 = 0;
	var newstate11 = 0;
	var newstate12 = 0;
	var newstate13 = 0;
	var newstate14 = 0;
	var newstate15 = 0;
	var newstate16 = 0;
	var newstate17 = 0;
		
    
	jQuery(function() {
	
	

		
	
			
			jQuery("a.popuplink").click(function(event){
			
			myid = jQuery(this).attr("id");
			

			
			
			eval ('tmpstate = newstate' + myid + ';');
				
				 if (tmpstate == 0) {	 
			
					mylink = jQuery(this).attr("href");
					mywidth = jQuery(this).attr("width");
					myheight = jQuery(this).attr("height");
					myscroll = jQuery(this).attr("scrollbar"); 
					
						if (myheight == "x") {
							
						myheight = screen.availHeight - 200;
						
						
						}
						
						if (myscroll == "y") {
						
						myscroll = 1;
						
						}else {
						
						myscroll = 0;
						
						}
					
					eval ('newstate' + myid + ' = 1;');
					
					jQuery("a#" + myid).attr("href", "javascript:popUp('" + mylink + "', " + mywidth + ", " + myheight + ", " + myscroll + ")");
					
				
					
			
				} 
					
	
   });
   				
	
});

/**/


/*Fancy Box */
	
	/*Fancy Box - jquery.fancybox-1.3.4.pack.js */

;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);


	/* Fancy Box - Mouse Wheel*/
		
	
		(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
		

/* Carousel Byond 3 - Jquery 1.4 */

(function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null, itemFallbackDimension:null},r=false;i(window).bind("load.jcarousel",function(){r=true});i.jcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl? "right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container= this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext= this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden", position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this, j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){e.setup()})}else this.setup()}; var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}}, reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0; this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b= a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")), a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))- b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked|| this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d= this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+= m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g= this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(m===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&& this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail= true}for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation"); if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto(); if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap== "first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+ ".jcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+ ".jcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b, null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback", a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k, this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical? "-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh, d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0; var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel", new h(this,a))})}})(jQuery);

