﻿function initialiseStyles()
{
  var links = $("div.links");
  var linksCategory = $("div.links-category");
  var news = $("div.news");
  var newsHeader = $("div.news-header");
  var newsFooter = $("div.news-footer");
  var page = $("div#page");
  var pageHeader = $("div#page-header");
  var pageHeaderTitle = $("div#page-header-title");
  var pageHeaderMenu = $("div#page-header-menu");
  var pageHeaderSubmenu = $("div#page-header-submenu");
  var pageFooter = $("div#page-footer");

  if ((links.length != 0) && (linksCategory.length != 0))
  {
    links.css("borderStyle", "none");
    linksCategory.css("borderStyle", "none");
  }

  if ((news.length != 0) && (newsHeader.length != 0) && (newsFooter.length != 0))
  {
    news.css("borderStyle", "none");
    newsHeader.css("borderStyle", "none");
    newsFooter.css("borderStyle", "none");
  }

  pageHeader.css("paddingBottom", "4px");
  pageHeader.css("paddingLeft", "3px");
  pageHeader.css("paddingRight", "3px");
  pageHeader.css("paddingTop", "2px");

  page.css("borderStyle", "none");
  pageHeader.css("borderStyle", "none");
  pageFooter.css("borderStyle", "none");

  page.liquidCanvas("[shadow{color:#222222; shift:1} gradient{from:#E0E0E0; to:#FFFFFF}] => roundedRect{radius:19}");
  pageHeader.liquidCanvas("shadow{color:#222222; shift:1} => roundedRect{radius:13}");

  if (pageHeaderMenu.length == 0)
  {
    pageHeaderTitle.liquidCanvas("fill{color:#000000} => roundedRect{radius:12}");
  }
  else
  {
    pageHeaderTitle.liquidCanvas("fill{color:#000000} => roundedRect{radius:12; bottomLeftRadius:0; bottomRightRadius:0}");

    if (pageHeaderSubmenu.length == 0)
    {
      pageHeaderMenu.liquidCanvas("fill{color:#585858} => roundedRect{radius:12; topLeftRadius:0; topRightRadius:0}");
    }
    else
    {
      pageHeaderMenu.liquidCanvas("fill{color:#585858} => rect");
      pageHeaderSubmenu.liquidCanvas("fill{color:#A8A8A8} => roundedRect{radius:12; topLeftRadius:0; topRightRadius:0}");
    }
  }

  if ((links.length != 0) && (linksCategory.length != 0))
  {
    links.liquidCanvas("[shadow{color:#111111; shift:1} gradient{from:#F0F0F0; to:#FFFFFF}] => roundedRect{radius:17}");
    linksCategory.liquidCanvas("[shadow{color:#111111; width:2; shift:1} gradient{from:#A8A8A8; to:#FFFFFF; horizontal:true; vertical:false}] => roundedRect{radius:11}");
  }

  if ((news.length != 0) && (newsHeader.length != 0) && (newsFooter.length != 0))
  {
    news.liquidCanvas("[shadow{color:#111111; shift:1} gradient{from:#F0F0F0; to:#FFFFFF}] => roundedRect{radius:17}");
    newsHeader.liquidCanvas("[shadow{color:#111111; width:2; shift:1} gradient{from:#A8A8A8; to:#FFFFFF; horizontal:true; vertical:false}] => roundedRect{radius:11}");
    newsFooter.liquidCanvas("[shadow{color:#111111; width:2; shift:1} gradient{from:#C8C8C8; to:#FFFFFF; horizontal:true; vertical:false}] => roundedRect{radius:11}");
  }

  pageFooter.liquidCanvas("[shadow{color:#111111; shift:1} gradient{from:#A8A8A8; to:#FFFFFF; horizontal:true; vertical:false}] => roundedRect{radius:12}");
}

$(window).load(initialiseStyles);