var Site = {

	initialize: function(){
		if (Browser.Engine.webkit)
			$('searchform').addClass('safari');
	}

};

window.addEvent('domready', Site.initialize);

function submissionEmail()
{
	if (trim($('name').value) == '')
	{
		alert('Please input your name.');
		$('name').focus();
		return false;
	}	
	
	if (!isEmail($('email').value))
	{
		alert('Your email is invalid.Please input your email again.');
		$('email').focus();
		return false;
	}	
	
	return true;
}

function trim(str) {
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function isBlank(str) {
	if( trim(str) == "" ) 
		return true ;
	return false ;
}

function isEmail(s){
	if (s.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]{2,4}$/) != -1)
		return true ;
	return false ;
}




jQuery.noConflict();
jQuery(document).ready(function(){
	if (jQuery('.rotateCopy').html != null) rotateImg();
});
var delayRotate = 7000;
var animationSpeed = 1000;
var tempRotateI = 0;
var tempRotateY = 0;
var count_lastest;
var buttonClick = false;
function rotateImg(){
	count_lastest = jQuery('.rotateCopy').length;
	
	//images
	//$('.rotateCopy:eq('+tempRotateY+')').fadeOut(animationSpeed);
	jQuery('.rotateCopy').fadeOut(animationSpeed);
	jQuery('.rotateCopy:eq('+tempRotateI+')').fadeIn(animationSpeed);
	
	if ((count_lastest>1) && (buttonClick==false)) t=setTimeout("rotateImg()",delayRotate)
	tempRotateI = tempRotateI+1;
	tempRotateY = tempRotateI-1;
	if (tempRotateI == count_lastest) tempRotateI=0;	
};