homeIntro = function() {
	var currentSet = 1;
	var lastSet = 0;
	var timer = 0;
	var hlY = [0,-150,-300,-450];
	this.changeSet = function(set,hold) {
		if(set != currentSet) {
			lastSet=currentSet;
			currentSet=set;
			if(!hold) {
				clearInterval(this.timer);
				this.timer = setInterval("sh.autoChange()",7000); 
			}
			$("#hi_img_s"+currentSet+"").css("opacity",1).css("z-index","102").fadeIn("normal",function(){
				if(lastSet > 0) $("#hi_img_s"+lastSet+"").css("z-index","100") 
				$("#hi_img_s"+currentSet+"").css("z-index","101"); 
			});
			$("#hi_balls_s"+currentSet+" div.hi_balls_on").fadeIn();
			if(lastSet > 0) $("#hi_balls_s"+lastSet+" div.hi_balls_on").fadeOut();
			$("#hi_text_w3").animate({"marginTop": hlY[(set-1)]},400);
		}
	}
	this.autoChange = function() {
		if(currentSet < 4) this.changeSet((currentSet+1),true);
		else this.changeSet(1,true);
	}
	this.start = function() {
		this.timer = setInterval("sh.autoChange()",5000);
	}
}
popupCaptcha = function() {
	var holdLogin=true;
	this.close = function() {
		$("#popup_w1").hide();
		$("#popup_w2").hide();
	}
	this.load = function() {
		$("#popup_w1").css("opacity",.83).css("width",document.body.clientWidth).css("height",document.body.clientHeight).show();
		$("#popup_w2").show();
		$("#popup_w2").load("pc_ajax.php");
	}
	this.load_pc = function() {
		if(holdLogin == true) {
			this.load();
			return false;
		} else return true;
	}
	this.doSubmit = function(clicked) {
		if(clicked >= 0 && clicked <= 5) {
			$("#form_rid").val( $("#ptc_rid").val() );
			$("#routing_code").val(clicked);
			holdLogin=false;
			$("#loginForm").attr("onsubmit","").submit();
		}

	}
}

if(atHome == true) {
	var pc = new popupCaptcha;
	var sh = new homeIntro;
	$(document).ready(function(){ sh.start(); });
}
$(document).ready(function(){
	if($.browser.opera && (jQuery.browser.version < 9) ) $(".tableData").css("width","566px");
	ht_obj = '#m_w2 #ht_e';
	$('#m_w2 ul li').hover(function() {
		$(ht_obj).dequeue().css('display', 'block').animate({width:  (this.offsetWidth-17),left: (this.offsetLeft-4)}, 200, "linear");
	}, function() {$(ht_obj).css('display', 'none');});
});
