﻿

$(document).ready(function () {
	var startSlide = 0;
	var param = $.url.param("s");
	startSlide = parseInt(param);
	if (isNaN(startSlide))
		startSlide = 0;

	$("div#WebSiteProductCycle").show().cycle({
		fx: 'fade',
		prev: '.WebSiteProductTemplateButtonLeft',
		next: '.WebSiteProductTemplateButtonRight',
		speed: 500,
		timeout: 0,
		startingSlide: startSlide,
		cleartype: !$.support.opacity
		//cleartype: false
	});
	$("div#WebSiteProductCycle2").show().cycle({
		fx: 'fade',
		prev: '.WebSiteProductTemplateButtonLeft',
		next: '.WebSiteProductTemplateButtonRight',
		speed: 500,
		timeout: 0,
		startingSlide: startSlide,
		cleartype: !$.support.opacity
	});
	$("div#WebSiteProductCycle3").show().cycle({
		fx: 'fade',
		prev: '.WebSiteProductTemplateButtonLeft',
		next: '.WebSiteProductTemplateButtonRight',
		speed: 0,
		timeout: 0,
		startingSlide: startSlide,
		cleartype: !$.support.opacity
    });

    $("a[rel='ImageGallery']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples1']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples2']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples3']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples4']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples5']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples6']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples7']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples8']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples9']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples10']").each(function () { $(this).colorbox(); });
    $("a[rel='gallery-examples11']").each(function () { $(this).colorbox(); });	
});

function selectThis() {
	var newHref = $('.WebSiteProductTemplateContent2:visible input[type=\'hidden\'][name=\'childUrl\']').val();
	window.location = newHref;
	//alert(newHref);
}
function buyThis() {
	var newHref = $('.WebSiteProductTemplateContent2:visible input[type=\'hidden\'][name=\'buyUrl\']').val();
	window.location = newHref;
	//alert(newHref);
}
function demoThis() {
    var newHref = $('.WebSiteProductTemplateContent2:visible input[type=\'hidden\'][name=\'demoUrl\']').val();
    window.location = newHref;
    //alert(newHref);
}
function demoThis2() {
	var newHref = $('.WebSiteProductTemplateContent2:visible input[type=\'hidden\'][name=\'demoUrl\']').val();
	$('#demolink2').attr('href', newHref);
}

