// JavaScript Document

//action slideshow
$(document).ready(function() {

		
	
	$('.slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:  5000
	
	});
	


	
	
	
});

// pause slideshow 
function slideshow_pause()
{
	 $('.slideshow').cycle('pause');
}

// resume slideshow 
function slideshow_resume()
{
	 $('.slideshow').cycle('resume'); 
}

function slideshow_start()
{

	 $('.slideshow').cycle(0); 
}



		jQuery(function() {
    		jQuery(".slider").jCarouselLite({
        		btnNext: ".next",
        		btnPrev: ".prev",
        		visible: 5,
				scroll:5
    		});

			jQuery(".slider2").jCarouselLite({
        		btnNext: ".next2",
        		btnPrev: ".prev2",
        		visible: 5
    		});
		});



var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;


// hold collection link colour and open list
function mcancelclosetime_collection()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
	
	 $("#index_collection_1ink").css("background-position", "-356px 0");  
}







// revert collection link colour and close list
function mclosetime_collection()
{
	closetimer = window.setTimeout(mclose, timeout);
	 $("#index_collection_1ink").css("background-position", "0"); 
}


















// hold clearance link colour and open list
function mcancelclosetime_clearance()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
	
	  $("#index_clearance_1ink").css("background-position", "-367px 0");  
}

// revert collection link colour and close list
function mclosetime_clearance()
{
	closetimer = window.setTimeout(mclose, timeout);
	 $("#index_clearance_1ink").css("background-position", "0"); 
}


// hold clearance link colour and open list
function mcancelclosetime_reglaze()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
	
	  $("#index_reglaze_1ink").css("background-position", "-140px 0");  
}

// revert collection link colour and close list
function mclosetime_reglaze()
{
	closetimer = window.setTimeout(mclose, timeout);
	 $("#index_reglaze_1ink").css("background-position", "0"); 
}


function goto_page(page,cID) {

    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null) {
        alert ("Your browser does not support AJAX!");
        return;
    }
    var url="ajax_paging.php";
    url=url+"?page="+page+"&cID="+cID;
	
	function showLoader(){
		$('#loading').fadeIn(400);
	}
	//hide loading bar
	function hideLoader(){
		$('#loading').fadeOut(800);
	};

	showLoader();
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") {
			
            document.getElementById('results').innerHTML=xmlhttp.responseText;
			hideLoader();
        }
		
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
	
}





function GetXmlHttpObject() {
    var xmlhttp=null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlhttp=new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlhttp;
}


function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
return (true)
}
alert("Please enter a valid email address.")
return (false)
}







