// JavaScript Document
var j = jQuery.noConflict();   



function switchLiCntByMouseover(obja,objb){
	
	j('#' + obja).children().mouseover(function(){
		if(j(this).attr("class") != "on"){
			j('#' + obja).children().removeClass('on');
			j(this).addClass("on");
			key = j('#' + obja).children().index(j(this));
			j('#' + objb).children().removeClass('on');
			j('#' + objb).children().eq(key).addClass("on");
		}
	})
}
function switchLiCntByClick(obja,objb){
	
	j('#' + obja).children().click(function(){
		if(j(this).attr("class") != "on"){
			j('#' + obja).children().removeClass('on');
			j(this).addClass("on");
			key = j('#' + obja).children().index(j(this));
			j('#' + objb).children().removeClass('on');
			j('#' + objb).children().eq(key).addClass("on");
		}
	})
}
function switchLiClass(obja){
	j('#' + obja + "> li").mouseover(function(){
		if(j(this).attr("class") != "on"){
			j('#' + obja +'> li').removeClass();
			j(this).addClass("on");
		}
	})
}
function switchClass(obja){
	j(obja).mouseover(function(){
		if(j(this).attr("class") != "on"){
			j(this).addClass("on");
		}
	}).mouseout(function(){
		j(this).removeClass("on");
	})
}
function clearInput(a,val){
	if(j("#"+a).val()==''){
		j("#"+a).val(val);
	}
	j("#"+a).focus(function(){
		if(j(this).val()==val){
			j(this).val('');
		}
	})
	j("#"+a).blur(function(){
		if(j(this).val()==''){
			j(this).val(val);
		}
	})
}

function clickHideOrShowAnimate(a,b){
	j(a).click(function(){
		j(this).toggleClass("close");
		j(b).animate({ height: 'toggle'},   "fast"); 
	})
}

function switchPic(a,b){
	j(a + ' > img').mouseover(function(){
		if(j(this).attr("class") != "on"){
			j(a + ' > img').removeClass('on');
			j(this).addClass("on");
			j(b).attr("src",j(this).attr("src"));
		}
	})
}




/////////////////////////////////////////////////

function selectCheckBox(a,b){
	j(a).click(function(){
		if(j(this).attr("checked")){
			j(b + " input[type='checkbox']").each(function() {
				j(this).attr("checked", true);
			});
		}else{
			j(b + " input[type='checkbox']").each(function() {
				j(this).attr("checked", false);
			});
		}
	})
}







