$(document).ready(function() {
	
	/*** iPhone, iPod, iPad detection for pagination number on homepage slidehow ***/
	/*** useful links: 	http://snipplr.com/view/31607/iphone-ipad-ipod-detect/
						http://www.jquery4u.com/mobile/jquery-detect-mobile-devices-iphone-ipod-ipad/
	***/
	if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {
		$('body').css({'width':'3350px'});
		$('.dashboard_tab').css({'left':'800px'});
		$('#navigation').css({'left':'460px'});
		$('.homepage-slideshow-container .left-arrow, .homepage-slideshow-container .right-arrow').css({'display':'block'});
		
		$('.slideshows-pagination-placeholder .slide-name').css({'height':'22px','width':'710px'});
		$('.slideshows-pagination-placeholder .pagination-number').css({'width':'203px'});
		
		$('.portfolios-pagination-placeholder .portfolio-name').css({'height':'22px', 'width':'623px'});
		$('.portfolios-pagination-placeholder .pagination-number').css({'width':'232px'});
		$('.portfolios-pagination .left-arrow, .portfolios-pagination .right-arrow').css({'height':'21px'});
		
		$('.products-pagination-placeholder .product-name').css({'height':'22px', 'width':'707px'});
		$('.products-pagination-placeholder .pagination-number').css({'width':'145px'});
		$('.products-pagination .left-arrow, .products-pagination .right-arrow').css({'height':'21px'});
		
		$('.press-pagination-placeholder .press-name').css({'height':'22px', 'width':'305px'});
		$('.press-pagination-placeholder .pagination-number').css({'width':'87px'});
		$('.press-pagination .left-arrow, .press-pagination .right-arrow').css({'height':'20px'});
		
		$('#footer-bottom-border, #footer-extension-top-border, #footer-extension, #footer-extension-bottom-border').css({'width':'2370px'});
	}
	
	/*** DASHBOARD ***/
	var connectWithUsToggle = false;
	/*** slideToggle the connect with us button ***/
	$('.dashboard_tab #connect-with-us-dashbord').click(function() {
		/*
		$('.dashboard_tab_icons li a').each(function() {
			$(this).css({'display':'block'});
		});
		*/
		if (!connectWithUsToggle) {
			$('#connect-with-us-dashbord').css({
				'color': '#E0CF71'
			});
			connectWithUsToggle = true;
		} else {
			$('#connect-with-us-dashbord').css({
				'color': ''
			});
			connectWithUsToggle = false;
		}
		$('.dashboard_tab_extension').slideToggle();
	});
	
	/*** empty input field if it is clicked ***/
	$('#connect-with-us-username, #connect-with-us-password').click(function(e) {
		e.preventDefault();
        $(this).val('');
    });
	
	/*** put back input field value ***/
	$('#connect-with-us-username').blur(function(e){
    	if ($(this).val() == "") {
    		$(this).val('user name');
    	}
    });
	
	/*** put back input field value ***/
	$('#connect-with-us-password').blur(function(e){
    	if ($(this).val() == "") {
    		$(this).val('password');
    	}
    });
	
	/*** /DASHBOARD ***/
	
	/*** HOLIDAY BANNER
	$('.holiday-banner.close').live('click', function(e) {
		e.preventDefault();
		
		$(this).removeClass('close').addClass('open');
		setTimeout("$('.holiday-banner.open').trigger('click');", 5000);
	});
	
	$('.holiday-banner.open').live('click', function(e) {
		e.preventDefault();
		
		$(this).removeClass('open').addClass('close');
	});
	***/
	
	
	//display a popup saying "comming soon"
	/*
	$('#youtube-icon').hover(
		function(){
			$('#youtube-coming-soon').css("display","block");
			$('#dashboard_tab_extension').css("height", "464px");
			
		},function(){
			$('#youtube-coming-soon').css("display","none");	
			$('#dashboard_tab_extension').css("height", "427px");
		}
	);
	*/
	/*
	if (Math.floor(Math.random()*200) > 195)
	{
		
	
		var t=setTimeout("smokin_rick()",20000);
	}
	*/
	
	// body width
	/*
	$(window).resize(function() {
		  $('body').width($(window).width());
	});	
	*/
	
});
/*
function smokin_rick()
{
	var placement = $(window).width() - 198;
	$('.container').append('<img src="/images/smokin-rick.png" id="smokin-rick" style="display:none; position:absolute; top:400px; left:' + placement + 'px">');
	$('#smokin-rick').show();
	
	var t=setTimeout("remove_smokin_rick()",1000);
}

function remove_smokin_rick()
{
	$('#smokin-rick').hide();
}
*/
