<?xml version="1.0" encoding="UTF-8"?>

<!-- 

	All content on this website (including text, images, source
	code and any other original works), unless otherwise noted,
	is licensed under a Creative Commons License.
	
	http://creativecommons.org/licenses/by-nc-sa/2.5/
	
	Copyright (C) 2004-2010 Open-Xchange, Inc.
	Mail: info@open-xchange.com 
	
	@author Viktor Pracht <viktor.pracht@open-xchange.com>

 -->

<stylesheet version="1.0"
            xmlns="http://www.w3.org/1999/XSL/Transform"
            xmlns:ox="http://localhost/html/dtd/style.dtd">
	<output method="text"/>

	<template match="/">
		<apply-templates select="*"/>
	</template>

	<variable name="cssdir">default</variable>
	<template name="makestyle" match="ox:border">
		<param name="type" select="@type"/>
		<param name="suffixes" select="concat(normalize-space(@dirs), ' ')"/>
		<variable name="suffix" select="substring-before($suffixes, ' ')"/>
		<variable name="file" select="concat($type, '-', $suffix)"/>
		<if test="string-length($suffixes) > 1">
.<value-of select="$file"/> {
	background-image: url(themes/<value-of select="$cssdir"/>/img/border/<value-of select="$file"/>.png);
	background-position: <if test="contains($suffix, 'r')">10</if>0% <if test="contains($suffix, 'b')">10</if>0%;
	background-repeat: <if test="string-length($suffix) > 1">no-repeat</if>
	                   <if test="$suffix = 't' or $suffix = 'b'">repeat-x</if>
	                   <if test="$suffix = 'l' or $suffix = 'r'">repeat-y</if>;
}
			<call-template name="makestyle">
				<with-param name="type" select="@type"/>
				<with-param name="suffixes" select="substring-after($suffixes, ' ')"/>
			</call-template>
		</if>
	</template>
	
	<template match="ox:split">
		
	</template>
	
</stylesheet>