function getCookie(c_name){
	if (document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}

function PopupMainPicture(src){
	 window.open("/popup.html?"+src,"","scrollbars=1 resizable=1,HEIGHT=575,WIDTH=780");
}

$(document).ready(function(){ 
	Home.homeInit($('#home-id').html());
	$('a.lightbox').lightBox();
	$("#homeinquiry").validate({
		rules: {
			name: "required",
			captchainput: {
				required: true,
				equalTo: 'captcha'
			},
			email: {
				required: true,
				email: true
			},
			phone: "required"
		},
		messages: {
			name: "Please enter your name",
			phone: "Please enter your lastname",
			captchainput: {
				required: "Please enter the same text as above",
				equalTo: "Please enter the same text as above"
			},
			email: "Please enter a valid email address"
		}
	});
});

var Home = {
	id: 0,
	homeInit: function(homeid){
		Home.id = homeid;
	},
	flash: function(){
		$('#mssHolder').flash({
			swf: '/tampa/monoslideshow.swf',
			height:200,
			width:340,
			params: {
				wmode: 'transparent'
			},
			flashvars:{
				dataFile: '/tampa/homexml/'+Home.id+'.xml'
			}
		});
	}
}