var jsHTML = window.jsHTML || {};

jsHTML.weatherLocation = function(_this) {
	$("body").createAppend('div', {id:'changeMyLocation', className: 'popupBox', style: 'left: ' + ($(_this).offset().left - 430) + 'px; top: 25px; display: none;'}, [
		'div', {className:'title'}, 'Change your weather location',
		'a', {className: 'close', href: '#'}, 'CLOSE',
		'div', {className:'btnHolder'}, [
			'a', {className: 'btnAZ', href: '#'}, 'A-Z',
			'span', {}, '|',
			'a', {className: 'btnIslands selected', href: '#'}, 'North - South'
		],
		'div', {className:'content'}, [
				'div', {className:'group selected'}, [
					'div', {className:'subTitle'}, 'North Island',
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Kaitaia', id: 'a_Kaitaia'},,
						'span', {}, 'Kaitaia'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Gisborne', id: 'a_Gisborne'},,
						'span', {}, 'Gisborne'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Dargaville', id: 'a_Dargaville'},,
						'span', {}, 'Dargaville'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Napier', id: 'a_Napier'},,
						'span', {}, 'Napier'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Paihia', id: 'a_Paihia'},,
						'span', {}, 'Paihia/Russell'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Hastings', id: 'a_Hastings'},,
						'span', {}, 'Hastings'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Whangarei', id: 'a_Whangarei'},,
						'span', {}, 'Whangarei'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'New_Plymouth', id: 'a_New_Plymouth'},,
						'span', {}, 'New Plymouth'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Auckland', id: 'a_Auckland'},,
						'span', {}, 'Auckland'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Palmerston_North', id: 'a_Palmerston_North'},,
						'span', {}, 'Palmerston North'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Thames', id: 'a_Thames'},,
						'span', {}, 'Thames'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Wanganui', id: 'a_Wanganui'},,
						'span', {}, 'Wanganui'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Te_Kuiti', id: 'a_Te_Kuiti'},,
						'span', {}, 'Te Kuiti'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Taumarunui', id: 'a_Taumarunui'},,
						'span', {}, 'Taumarunui'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Hamilton', id: 'a_Hamilton'},,
						'span', {}, 'Hamilton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Dannevirke', id: 'a_Dannevirke'},,
						'span', {}, 'Dannevirke'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Taupo', id: 'a_Taupo'},,
						'span', {}, 'Taupo'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Masterton', id: 'a_Masterton'},,
						'span', {}, 'Masterton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Tokoroa', id: 'a_Tokoroa'},,
						'span', {}, 'Tokoroa'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Levin', id: 'a_Levin'},,
						'span', {}, 'Levin'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Tauranga', id: 'a_Tauranga'},,
						'span', {}, 'Tauranga'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Paraparaumu', id: 'a_Paraparaumu'},,
						'span', {}, 'Paraparaumu'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Whakatane', id: 'a_Whakatane'},,
						'span', {}, 'Whakatane'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Wellington', id: 'a_Wellington'},,
						'span', {}, 'Wellington'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Rotorua', id: 'a_Rotorua'},,
						'span', {}, 'Rotorua'
					]
				],
				'div', {className:'group selected'}, [
					'div', {className:'subTitle'}, 'South Island',
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Reefton', id: 'a_Reefton'},,
						'span', {}, 'Reefton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Timaru', id: 'a_Timaru'},,
						'span', {}, 'Timaru'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Westport', id: 'a_Westport'},,
						'span', {}, 'Westport'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Oamaru', id: 'a_Oamaru'},,
						'span', {}, 'Oamaru'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Greymouth', id: 'a_Greymouth'},,
						'span', {}, 'Greymouth/Hokitika'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Dunedin', id: 'a_Dunedin'},,
						'span', {}, 'Dunedin'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Nelson', id: 'a_Nelson'},,
						'span', {}, 'Nelson'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Alexandra', id: 'a_Alexandra'},,
						'span', {}, 'Alexandra'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Motueka', id: 'a_Motueka'},,
						'span', {}, 'Motueka'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Wanaka', id: 'a_Wanaka'},,
						'span', {}, 'Wanaka'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Blenheim', id: 'a_Blenheim'},,
						'span', {}, 'Blenheim'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Queenstown', id: 'a_Queenstown'},,
						'span', {}, 'Queenstown'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Kaikoura', id: 'a_Kaikoura'},,
						'span', {}, 'Kaikoura'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Gore', id: 'a_Gore'},,
						'span', {}, 'Gore'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Christchurch', id: 'a_Christchurch'},,
						'span', {}, 'Christchurch'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Invercargill', id: 'a_Invercargill'},,
						'span', {}, 'Invercargill'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeather', value: 'Ashburton', id: 'a_Ashburton'},,
						'span', {}, 'Ashburton'
					]
				],
				'div', {className:'groupAll'}, [
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Alexandra', id: 'b_Alexandra'},,
						'span', {}, 'Alexandra'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Hamilton', id: 'b_Hamilton'},,
						'span', {}, 'Hamilton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Oamaru', id: 'b_Oamaru'},,
						'span', {}, 'Oamaru'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Te_Kuiti', id: 'b_Te_Kuiti'},,
						'span', {}, 'Te Kuiti'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Ashburton', id: 'b_Ashburton'},,
						'span', {}, 'Ashburton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Hastings', id: 'b_Hastings'},,
						'span', {}, 'Hastings'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Paihia', id: 'b_Paihia'},,
						'span', {}, 'Paihia/Russell'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Thames', id: 'b_Thames'},,
						'span', {}, 'Thames'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Auckland', id: 'b_Auckland'},,
						'span', {}, 'Auckland'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Invercargill', id: 'b_Invercargill'},,
						'span', {}, 'Invercargill'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Palmerston_North', id: 'b_Palmerston_North'},,
						'span', {}, 'Palmerston North'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Timaru', id: 'b_Timaru'},,
						'span', {}, 'Timaru'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Blenheim', id: 'b_Blenheim'},,
						'span', {}, 'Blenheim'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Kaikoura', id: 'b_Kaikoura'},,
						'span', {}, 'Kaikoura'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Paraparaumu', id: 'b_Paraparaumu'},,
						'span', {}, 'Paraparaumu'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Tokoroa', id: 'b_Tokoroa'},,
						'span', {}, 'Tokoroa'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Christchurch', id: 'b_Christchurch'},,
						'span', {}, 'Christchurch'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Kaitaia', id: 'b_Kaitaia'},,
						'span', {}, 'Kaitaia'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Queenstown', id: 'b_Queenstown'},,
						'span', {}, 'Queenstown'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Wanaka', id: 'b_Wanaka'},,
						'span', {}, 'Wanaka'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Dannevirke', id: 'b_Dannevirke'},,
						'span', {}, 'Dannevirke'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Levin', id: 'b_Levin'},,
						'span', {}, 'Levin'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Reefton', id: 'b_Reefton'},,
						'span', {}, 'Reefton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Wanganui', id: 'b_Wanganui'},,
						'span', {}, 'Wanganui'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Dargaville', id: 'b_Dargaville'},,
						'span', {}, 'Dargaville'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Masterton', id: 'b_Masterton'},,
						'span', {}, 'Masterton'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Rotorua', id: 'b_Rotorua'},,
						'span', {}, 'Rotorua'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Wellington', id: 'b_Wellington'},,
						'span', {}, 'Wellington'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Dunedin', id: 'b_Dunedin'},,
						'span', {}, 'Dunedin'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Motueka', id: 'b_Motueka'},,
						'span', {}, 'Motueka'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Taumarunui', id: 'b_Taumarunui'},,
						'span', {}, 'Taumarunui'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Westport', id: 'b_Westport'},,
						'span', {}, 'Westport'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Gisborne', id: 'b_Gisborne'},,
						'span', {}, 'Gisborne'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Napier', id: 'b_Napier'},,
						'span', {}, 'Napier'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Taupo', id: 'b_Taupo'},,
						'span', {}, 'Taupo'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Whakatane', id: 'b_Whakatane'},,
						'span', {}, 'Whakatane'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Gore', id: 'b_Gore'},,
						'span', {}, 'Gore'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Nelson', id: 'b_Nelson'},,
						'span', {}, 'Nelson'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Tauranga', id: 'b_Tauranga'},,
						'span', {}, 'Tauranga'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Whangarei', id: 'b_Whangarei'},,
						'span', {}, 'Whangarei'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'Greymouth', id: 'b_Greymouth'},,
						'span', {}, 'Greymouth/Hokitika'
					],
					'div', {className:'rowRadio'}, [
						'input', {type: 'radio', name: 'radioWeatherAll', value: 'New_Plymouth', id: 'b_New_Plymouth'},,
						'span', {}, 'New Plymouth'
					]
				],
				'div', {className:'hr'},,
				'input', {type:'image', src: 'http://images.tvnz.co.nz/tvnz_site_images/images/btnSaveChanges.gif', className: 'button', id: 'changeWeather'},,
		],
		'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/makeHPArrow.gif', height:'9', width:'17', className:'arrow', alt:'Make TVNZ my Homepage', style:'left:465px'}
	]);
}

jsHTML.makeHomeMozilla = function(_this) {
	$("body").createAppend('div', {id:'makeThisMyHP', className: 'popupBox', style: 'left: ' + ($(_this).offset().left - 320) + 'px; top: 25px; display: none;'}, [
		'div', {className:'title'}, 'How to make TVNZ.co.nz your homepage',
		'a', {className:'close'}, 'CLOSE',
		'div', {className:'content'}, [
			'ol', {}, [
				'li', {}, [
					'a', {href:'http://tvnz.co.nz', title:'Make TVNZ.co.nz your homepage'}, [
						'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/hpIcon.gif', width:'29', height:'29', align:'left', alt:'Make TVNZ.co.nz your homepage'}
					],
					'span', {}, 'Drag this TVNZ icon and drop it onto the "house icon" in the tool bar of the browser'
				],
				'li', {}, [
					'span', {}, 'Select "Yes" from the popup window and you\'re done!'
				]
			],
			'a', {href:'/content/2353278', className:'moreInfo'}, 'More Information'
		],
		'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/makeHPArrow.gif', height:'9', width:'17', className:'arrow', alt:'Make TVNZ my Homepage'}
	]);
}
jsHTML.shareMore = function(_this, _title, _url, _width) {
	var leftCalc = $(_this).offset().left - (_width / 2) + (($(_this).width() + parseInt($(_this).css("padding-left")) + parseInt($(_this).css("padding-right"))) / 2);
	$("body").createAppend('div', {id:'shareMore', className: 'popupBox', style: 'left: ' + leftCalc + 'px; top: ' + ($(_this).offset().top + 15) + 'px; display: none;'}, [
		'div', {className:'title'}, [
			'h2', {}, 'Share this page',
			'div', {className: 'hr'}, ,
			'span', {}, 'Share TVNZ stories on some of the most-popular social networking and content sites on the internet.'
		],
		'a', {href: '#', className:'close'}, 'CLOSE',
		'div', {className:'content'}, [
			'a', {href: 'http://del.icio.us/post?url=' + _url + '&title=' + _title, title: 'Bookmark on Delicious', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxDelicious.gif', alt:'Delicious'}],
			'a', {href: 'http://digg.com/submit?url=' + _url + '&title=' + _title, title: 'Share on Digg', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxDigg.gif', alt:'Digg'}],
			'a', {href: 'http://www.facebook.com/sharer.php?u=' + _url + '&t=' + _title, title: 'Share on Facebook', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxFacebook.gif', alt:'Facebook'}],
			'a', {href: 'http://reddit.com/submit?url=' + _url + '&title=' + _title, title: 'Share on Reddit', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxReddit.gif', alt:'Reddit'}],
			'a', {href: 'http://www.bebo.com/c/share?Url=' + _url + '&Title=' + _title, title: 'Share on Bebo', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBebo2.gif', alt:'Bebo'}],
			'a', {href: 'http://www.newsvine.com/_wine/save?popoff=0&u=' + _url + '&h=' + _title, title: 'Share on Newsvine', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxNewsvine.gif', alt:'Newsvine'}],
			'a', {href: 'http://www.stumbleupon.com/submit?url=' + _url + '&title=' + _title, title: 'Share on Stumbleupon', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxStumbleupon.gif', alt:'Stumbleupon'}],
			'a', {href: 'http://www.myspace.com/Modules/PostTo/Pages/?u=' + _url + '&t=' + _title, title: 'Share on MySpace', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxMyspace.gif', alt:'MySpace'}],
			'a', {href: 'http://www.mixx.com/submit?page_url=' + _url + '&title=' + _title, title: 'Share on Mixx', target: '_blank'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxMixx.gif', alt:'Mixx'}],
			'a', {href: '#', title: 'Share on Twitter', target: '_blank', id: 'twitterBtn'}, [
				'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/share/shareBoxTwitter.gif', alt:'Twitter'}],
		],
		'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/makeHPArrow.gif', height:'9', width:'17', className:'arrow', alt:'Share this page'}
	]);
	$(document).ready(function(){
		$("#twitterBtn").click(function(event){
			twitter_click();
			event.preventDefault();
		});
	});
}

jsHTML.shareVideo = function(_this, _title, _url, _width) {
	var leftCalc = $(_this).offset().left - (_width / 2) + (($(_this).width() + parseInt($(_this).css("padding-left")) + parseInt($(_this).css("padding-right"))) / 2);
	$("body").createAppend('div', {id:'shareMore', className: 'popupBox', style: 'left: ' + leftCalc + 'px; top: ' + ($(_this).offset().top + 15) + 'px; display: none;'}, [
		'div', {className:'title'}, [
			'span', {}, 'Share TVNZ pages on some of the most-popular social networking and content sites on the internet.',
			'a', {href: '#', className:'close'}, 'CLOSE'
		] ,
		'div', {className:'content'}, [
			'ul', {}, [
				'li', {className:'delicious'}, [
					'a', {href: 'http://del.icio.us/post?url=' + _url + '&title=' + _title, title: 'Bookmark on Delicious', target: '_blank'}, 'Delicious'],
				'li', {className:'digg'}, [
					'a', {href: 'http://digg.com/submit?url=' + _url + '&title=' + _title, title: 'Share on Digg', target: '_blank'}, 'Digg'],
				'li', {className:'facebook'}, [
					'a', {href: 'http://www.facebook.com/sharer.php?u=' + _url + '&t=' + _title, title: 'Share on Facebook', target: '_blank'}, 'Facebook'],
				'li', {className:'reddit'}, [
					'a', {href: 'http://reddit.com/submit?url=' + _url + '&title=' + _title, title: 'Share on Reddit', target: '_blank'}, 'Reddit'],
				'li', {className:'bebo'}, [
					'a', {href: 'http://www.bebo.com/c/share?Url=' + _url + '&Title=' + _title, title: 'Share on Bebo', target: '_blank'}, 'Bebo'],
				'li', {className:'newsvine'}, [
					'a', {href: 'http://www.newsvine.com/_wine/save?popoff=0&u=' + _url + '&h=' + _title, title: 'Share on Newsvine', target: '_blank'}, 'Newsvine'],
				'li', {className:'stumbleupon'}, [
					'a', {href: 'http://www.stumbleupon.com/submit?url=' + _url + '&title=' + _title, title: 'Share on Stumbleupon', target: '_blank'}, 'Stumbleupon'],
				'li', {className:'myspace'}, [
					'a', {href: 'http://www.myspace.com/Modules/PostTo/Pages/?u=' + _url + '&t=' + _title, title: 'Share on MySpace', target: '_blank'}, 'MySpace'],
				'li', {className:'mixxed'}, [
					'a', {href: 'http://www.mixx.com/submit?page_url=' + _url + '&title=' + _title, title: 'Share on Mixx', target: '_blank'}, 'Mixxed'],
				'li', {className:'twitter'}, [
					'a', {href: 'http://twitter.com/home?status=' + _title + ' ' + _url, title: 'Twitter', target: '_blank'}, 'Twitter'],
			],
			'div', {className:'formRow', id: 'copyBox'}, [
				'label', {}, 'Or copy this link:',
				'input', {type: 'text', name: 'copylink', id: 'copyShareLink', value: _url}, '',
			],
			'div', {className:'formRow'}, [
				'a', {href: '#', className: 'copyLink'}, 'Click to copy link',
			], 
		],
		'div', {className:'corners'}, [], 
		'div', {className:'arrow'}, []
	]);
}


jsHTML.email = function(_this, _id, _title, _keyword, _url, _width) {
	var leftCalc = $(_this).filter(":first").offset().left - (_width / 2) + (($(_this).filter(":first").width() + parseInt($(_this).filter(":first").css("padding-left")) + parseInt($(_this).filter(":first").css("padding-right"))) / 2);

	$("body").createAppend('div', {id:'emailBox', className: 'popupBox', style: 'width: ' + _width + 'px; left: ' + leftCalc + 'px; top: ' + ($(_this).offset().top + 15) + 'px; display: none;'}, [
		'div', {className:'title'}, [
			'h2', {}, 'Email this page',
			'div', {className: 'hr'}, '',
			'span', {}, 'Enter your friend\'s name and email address first, then your own and hit submit.',
			'p', {}, 'The marked fields below are manditory.'
		],
		'a', {href: '#', className:'close'}, 'CLOSE',
		'div', {className:'content'}, [
			'form', {id: 'emailForm', action: 'http://runes.tvnz.co.nz/tvnz_email_story_mail_latest.php', method: 'post'}, [
				'input', {type: 'hidden', value: _keyword, name: 'parentKeyword'}, '',
				'input', {type: 'hidden', value: _title, name: 'articleTitle'}, '',
				'input', {type: 'hidden', value: _id, name: 'articleId'}, '',
				'input', {type: 'hidden', value: _url, name: 'articleUrl'}, '',
				'div', {className:'formRow'}, [
					'label', {}, '&nbsp;',
					'span', {}, 'Name:',
					'span', {}, 'Email:'
				],
				'div', {className:'formRow'}, [
					'label', {}, 'To:*',
					'input', {type: 'text', name: 'reciever', id: 'reciever'}, '',
					'input', {type: 'text', name: 'to', id: 'to'}, ''
				],
				'div', {className:'formRow'}, [
					'label', {}, 'From:*',
					'input', {type: 'text', name: 'sender', id: 'sender'}, '',
					'input', {type: 'text', name: 'from', id: 'from'}, ''
				],
				'div', {className:'formRow'}, [
					'a', {className: 'button', id: 'btnSubmit', href: '#'}, [
						'span', {}, 'Submit'
					]
				]
			]
		],
		'img', {src: 'http://images.tvnz.co.nz/tvnz_site_images/images/makeHPArrow.gif', height:'9', width:'17', className:'arrow', alt:'Email This Story'}
	]);
}

jsHTML.emailVideo = function(_this, _id, _title, _keyword, _url, _width) {
	var leftCalc = $(_this).offset().left - (_width / 2) + (($(_this).width() + parseInt($(_this).css("padding-left")) + parseInt($(_this).css("padding-right"))) / 2);
	$("body").createAppend('div', {id:'emailBox', className: 'popupBox', style: 'left: ' + leftCalc + 'px; top: ' + ($(_this).offset().top + 15) + 'px; display: none;'}, [
		'div', {className:'title'}, [
			'span', {}, 'Enter your friend\'s name and email address first, then your own and hit submit. All fields below are manditory.',
			'a', {href: '#', className:'close'}, 'CLOSE'
		],
		'div', {className:'content'}, [
			'form', {id: 'emailForm', action: '', method: 'post'}, [ //http://runes.tvnz.co.nz/tvnz_email_story_mail_latest.php
				'input', {type: 'hidden', value: _keyword, name: 'parentKeyword'}, '',
				'input', {type: 'hidden', value: _title, name: 'articleTitle'}, '',
				'input', {type: 'hidden', value: _id, name: 'articleId'}, '',
				'input', {type: 'hidden', value: _url, name: 'articleUrl'}, '',
				'div', {className:'formRow'}, [
					'label', {}, 'Your Name:',
					'input', {type: 'text', name: 'sender', id: 'sender'}, '',
				],
				'div', {className:'formRow'}, [
					'label', {}, 'Your Email Address:',
					'input', {type: 'text', name: 'from', id: 'from'}, '',
				],
				'div', {className:'formRow'}, [
					'label', {}, 'Friend\'s Email Address:',
					'input', {type: 'text', name: 'to', id: 'to'}, '',
				],
				'div', {className:'formRow smallText'}, 'Seperate multiple addresses with a comma',
				'div', {className:'formRow'}, [
					'a', {className: 'button', id: 'btnSubmit', href: '#'}, [
						'span', {}, 'Submit'
					],
				],
				'div', {className:'formRow', id: 'copyBox'}, [
					'label', {}, 'Or copy this link:',
					'input', {type: 'text', name: 'copylink', id: 'copyEmailLink', wrap: 'virtual', value: _url}, '',
				],
				'div', {className:'formRow'}, [
					'a', {href: '#', className: 'copyLink'}, 'Click to copy link',
				]
			]
		],
		'div', {className:'corners'}, [],
		'div', {className:'arrow'}, []
	]);
}