//Trim string
function Trim(text) {
	 return text.replace(/(^\s*)|(\s*$)/g, ""); 
}			
function Search() {
			var searchWord = Trim(document.getElementById('searchText').value);
			if (document.getElementById('searchText').value == 'Please enter your search keyword')
			{
				return false;
			}
			window.location = "/searchresult.aspx?search=" + searchWord;
			}
function PreSearch(txtBox)
{
    if (txtBox.value == '')
    {
        txtBox.value = 'Please enter your search keyword';
    }
    else if (txtBox.value == 'Please enter your search keyword')
    {
        txtBox.value = '';
    }
}
function PreSearchAgain()
{
    if (Trim(document.getElementById('txtSearchAgain').value) == '')
    {
        document.getElementById("labelMessage").innerText = 'Please enter your search keyword';
        return false;
    }
    return true;
}

function emil()
{
	$(document).ready(function(){

		$(".email").each(function(){
			var ats, dots, address, i;
			ats = [ ' at ', ' (at) ', ' [at] ' ];
			dots = [ ' dot ', ' (dot) ', ' [dot] ' ];
			address = $(this).html();
			for ( i = 0; i < ats.length; i++ ) {
				address = address.replace(ats[i], '@');
			}
			for ( i = 0; i < dots.length; i++ ) {
				address = address.replace(dots[i], '.');
			}
			$(this).html('<a href="mailto:' + address + '">' + address + '</a>');
		});
		
	});

}


function theRotator() {


        var imgs = [
        '/media/11868/ist2_9184987-frontpage.jpg',
        '/media/11874/ist2_7989977-frontpage.jpg',
        '/media/11879/ist2_5241132-frontpage.jpg',
        '/media/11884/ist2_1925028-frontpage.jpg',
        '/media/9215/ist2_3709871.jpg',
	'/media/12102/istock_000010193165_frontpage.jpg',
	'/media/12094/ist2_10353204_frontpage.jpg',
	'/media/9225/ist2_10142855.jpg',
	'/media/12097/ist2_7531180-frontpage.jpg'
	
];
 var cnt = imgs.length;

        $(function() {
            setInterval(Slider, 5000);
        });

        function Slider() {
        $('#imageSlide').fadeIn(0, function() {
            $(this).attr('src', imgs[(imgs.length++) % cnt]).fadeIn(0);
        });
        };
        }


	

