function setUpStartUpPage() {
    SetUpImageRotator();
    SetUPMenuItems();
    SetUpProductsSideBar();
    SetUpFabricsSideBar();
    SetUpFabricsSideBar();
    SetUpAccessoriesSideBar();
    SetUpLinksSideBar();
			
    $("#readMoreAboutUS").click(function () {$('#contentHolder').load('aboutus.html'); return false;});
    $("#readMoreHome").click(function () {$('#contentHolder').load('home.html'); return false;});
}

function SetUpImageRotator() {
	$('#imageRotator').crossSlide({sleep: 2,fade: 1},
	[
		{ src: 'images/rnd/weding  rouse spring.jpg'},
		{ src: 'images/rnd/001_white damsk reception.jpg'},
		{ src: 'images/rnd/autdoor wedding.jpg'},
		{ src: 'images/rnd/002_ZAR0036z.JPG'},
		{ src: 'images/rnd/003_RAPSODY 333.jpg'},
		{ src: 'images/rnd/004_DRAPE BAND.jpg'},
		{ src: 'images/rnd/005_IMG_1227.JPG'},
		{ src: 'images/rnd/006_SOFT SASHES CLOSE UP.jpg'}
	]);
/*
    $('#imageRotator').crossSlide({
		speed: 45,
		fade: 1
		}, [
			{ src: 'images/rnd/Copy  of PINK GREEN 1RAPSODY 1.jpg', dir: 'up'   },
			{ src: 'images/rnd/overlay PURPLE AND FLOCK ORGANZA.jpg',   dir: 'down' },
			{ src: 'images/rnd/top table  ORGANZA ROUSE.jpg',  dir: 'up'   },
			{ src: 'images/rnd/TEAL SWAG AND GATHERED HOOD.jpg', dir: 'down' },
			{ src: 'images/rnd/RED FLOCK HOOD.jpg', dir: 'up'   },
			{ src: 'images/rnd/corset 4.jpg',   dir: 'down' },
			{ src: 'images/rnd/GREEN BLACK SASH.jpg',  dir: 'up'   },
			{ src: 'images/rnd/SHORT HOOD.jpg', dir: 'down' },
			{ src: 'images/rnd/CHAIR DRAPE.jpg',  dir: 'up'   }
		]);
		*/
}

function SetUPMenuItems() {
    $("#menuAboutUs").click(function () {$('#imageRotator').slideDown("slow"); $('#contentHolder').load('aboutus.html'); return false;});
    $("#menuHowToOrder").click(function () {$('#imageRotator').slideUp("slow"); $('#contentHolder').load('howtoorder.html'); return false;});
    $("#menuGallery").click(function () {$('#imageRotator').slideUp("slow"); document.getElementById('contentHolder').innerHTML = "<iframe src='gallery.php' frameborder='0' scrolling='no' width='100%' height='550px'></iframe>"; return false;});
    $("#menuContactUs").click(function () { $('#imageRotator').slideUp("slow"); $('#contentHolder').load('contactus.html'); return false; });
	//$("#newsletter").click(function () { $('#imageRotator').slideUp("slow"); $('#contentHolder').load('newsletter.html'); return false; });
	$("#menuTraining").click(function () { $('#imageRotator').slideUp("slow"); $('#contentHolder').load('training.html'); return false; });
}

var xhr = null;
function LoadSLinenPage(getURL) {
	
	if (xhr != null) {
	xhr.abort();
	} 
	
	$("#allLoader").slideDown('slow');
	$("#contentHolder").html("");
	$('#imageRotator').slideUp("fast");
	xhr = $.ajax({cache: false, url: getURL, success: function (data){xhr = null; $("#allLoader").slideUp('fast'); $("#contentHolder").html(data); }	});
	return false;
}

function SetUpProductsSideBar() {        
    $("#productsNewProducts").click(function () {return LoadSLinenPage('productsNewProducts.php');});
    $("#productsChairCovers").click(function () {return LoadSLinenPage('productsChairCovers.php');});
    $("#productsSashes").click(function () {return LoadSLinenPage('productsSashes.php');});
    $("#productsTableCloths").click(function () {return LoadSLinenPage('productsTableCloths.php');});
    $("#productsOverlays").click(function () {return LoadSLinenPage('productsOverlays.php');});
    $("#productsRunners").click(function () {return LoadSLinenPage('productsRunners.php');});
    $("#productsNapkins").click(function () {return LoadSLinenPage('productsNapkins.php');});
    $("#productsHoods").click(function () {return LoadSLinenPage('productsHoods.php');});
    $("#productsDrapes").click(function () {return LoadSLinenPage('productsDrapes.php');});
	$("#productsTopTable").click(function () {return LoadSLinenPage('productsTopTable.php');});
}

function SetUpFabricsSideBar() {    
	$("#fabricsNewFabrics").click(function () {return LoadSLinenPage('fabricsNewFabrics.php');});
	$("#fabricsOrganza").click(function () {return LoadSLinenPage('fabricsOrganza.php');});
	$("#fabricsPanama").click(function () {return LoadSLinenPage('fabricsPanama.php');});
	$("#fabricsSolidFabric").click(function () {return LoadSLinenPage('fabricsSolidFabric.php');});
	$("#fabricsTaffeta").click(function () {return LoadSLinenPage('fabricsTaffeta.php');});
	$("#fabricsVelvet").click(function () {return LoadSLinenPage('fabricsVelvet.php');});
}

function SetUpAccessoriesSideBar() {
    $("#accessoriesNewAccessories").click(function () {return LoadSLinenPage('accessoriesNewAccessories.php');});
}

function SetUpLinksSideBar() {
		$("li[myURL]").click(function(){window.open(this.title); return false;});
}

function SetUpChairCoverLinks(){
	$("li[ChairCover]").click(function (){return LoadSLinenPage(this.title);});
	$("img[ChairCover]").click(function (){return LoadSLinenPage(this.title);});
	$("a[ChairCover]").click(function (){return LoadSLinenPage(this.href);});
}
