initializeWindows = function(){

	
	MochaUI.loadNewsPage = function() {
		new MochaUI.Window({
			id: 'newspage',
			title: 'Jotterpro:News',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/news',
			width:600,
			height:250,
			scrollbars:true,
			x:10,
			y:10
		});	
	}
	
	if($('newsLink')) {
		$('newsLink').addEvent('click',function(e){
			new Event(e).stop();
			MochaUI.loadNewsPage();
		});	
	}
	
	MochaUI.loadServicePage = function() {
		new MochaUI.Window({
			id: 'service',
			title: 'Jotterpro:Services',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/services',
			width:500,
			height:400,
			scrollbars:true,
			x:10,
			y:10
		});	
	}
	
	if($('serviceLink')) {
		$('serviceLink').addEvent('click',function(e){
			new Event(e).stop();
			MochaUI.loadServicePage();
		});	
	}
	
	MochaUI.jhonGallery = function(){
		new MochaUI.Window({
			id: 'gallery',
			title: 'Jotterpro:Gallery',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/gallery',
			width:screen.width-20,
			height:screen.height-320,
			x:10,
			y:10,
			scrollbars:true,
			toolbar: true,
			toolbarURL: 'http://www.jotterpro.com/wp-content/themes/default/tab/gallery-tabs.html',
			contentBgColor: '#000'
		});
	}
	
	if ($('galleryLink')) {
		$('galleryLink').addEvent('click', function(e){
		new Event(e).stop();
		MochaUI.minimizeAll();
		MochaUI.jhonGallery();
		});
	}

	MochaUI.youtubeWindow = function(){
		new MochaUI.Window({
			id: 'youtube',
			title: 'youtube',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/about-us',
			width: 500,
			height: 350,
			scrollbars: true,
			resizeLimit:  {'x': [480, 2500], 'y': [380, 2000]},
			contentBgColor: '#000'
		});
	}
	
	if ($('youtubeLinkCheck')) {
		$('youtubeLinkCheck').addEvent('click', function(e){
		new Event(e).stop();
			MochaUI.youtubeWindow();
		});
	}
	
	MochaUI.jAbout = function(){
		new MochaUI.Window({
			id: 'jAbout',
			title: 'Jotterpro:About',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/about-us',
			width: 500,
			height: 350,
			x:25,
			y:40,
			scrollbars:true,
			toolbar: true,
			toolbarURL: 'http://www.jotterpro.com/wp-content/themes/default/tab/about-tabs.html'
		});
	}
	
	if ($('aboutLink')) {
		$('aboutLink').addEvent('click', function(e){
		new Event(e).stop();
			MochaUI.jAbout();
		});
	}
	
	MochaUI.linkWindow = function(){
		new MochaUI.Window({
			id :'linkWindow',
			title:'Jotterpro:Links',
			loadMethod:'iframe',
			contentURL:'http://www.jotterpro.com/links',
			width:500,
			height:150,
			x:140,
			y:10,
			scrollbars:true
		});	
	}
	
	if($('linkLink')) {
		$('linkLink').addEvent('click',function(e){
			new Event(e).stop();
			MochaUI.linkWindow();
		});	
	}
	
	MochaUI.contactWindow = function(){
		new MochaUI.Window({
			id: 'contactUs',
			title: 'Jotterpro:ContactUs',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/inquiry',
			width:500,
			height:400,
			x:165,
			y:40,
			scrollbars:true,
			toolbar:true,
			toolbarURL: 'http://www.jotterpro.com/wp-content/themes/default/tab/contact-tabs.html'
		});
	}
	
	if($('contactLink')) {
		$('contactLink').addEvent('click',function(e){
			new Event(e).stop();
			MochaUI.contactWindow();
		});
	}
	
	MochaUI.fbWindow = function(){
		new MochaUI.Window({
			id: 'jotterFB',
			title: 'Jotterpro:FB Page',
			loadMethod: 'iframe',
			contentURL: 'http://www.jotterpro.com/fbPage',
			width:320,
			height:400,
			x:10,
			y:10,
			resizable:false,
			maximizable:false,
			scrollbars:true
		});
	}
	
	if($('followfb')) {
		$('followfb').addEvent('click',function(e){
			new Event(e).stop();
			MochaUI.fbWindow();
		});	
	}
	
	if($('followyt')) {
		$('followyt').addEvent('click',function(e){
			window.open('http://www.youtube.com/jotterproduction');
		});	
	}
}

// Initialize MochaUI when the DOM is ready
window.addEvent('domready', function(){
	MochaUI.Desktop = new MochaUI.Desktop();
	MochaUI.Dock = new MochaUI.Dock({
		dockPosition: 'bottom'
	});
	MochaUI.Modal = new MochaUI.Modal();
	
	MochaUI.Desktop.desktop.setStyles({
		'background': '#fff',
		'visibility': 'visible'
	});
	
	initializeWindows();
});

// This runs when a person leaves your page.
window.addEvent('unload', function(){
	if (MochaUI) MochaUI.garbageCleanUp();
});