// JavaScript Document
function HideContent(d) {
	if(d.length < 1) { return; }
	document.getElementById(d).style.display = "none";
}

function close_items() {
	$(".faq_list li p").each(function(){
			$(this).hide();
	});
}
	
function open_item(topic) {
	close_items();
	$("p", topic).show();
}




function toggle_msg(id) {
		var e = document.getElementById(id);
		e.style.display = 'block';
}
function toggle_visibility(id) {
	var e = document.getElementById(id);
	if(e.style.display == 'block')
		e.style.display = 'none';
	else
		e.style.display = 'block';
}

function more_me(mode){
	if (mode){
		if (mode==1) $('#may').show(800); else $('#may').show();
		$('#mayOpen').hide();
		$('#mayClose').show();
	} else {
		$('#may').hide(200);
		$('#mayOpen').show();
		$('#mayClose').hide();		
	}
}
function more_lk(mode){
	if (mode){
		if (mode==1) $('#lk').show(800); else $('#lk').show();
		$('#lkOpen').hide();
		$('#lkClose').show();
	} else {
		$('#lk').hide(200);
		$('#lkOpen').show();
		$('#lkClose').hide();		
	}
}


function move2(v){
	n=''+v;
	n=n.replace("'",'.');
	if (n.indexOf('.')<0) n+='.0';
	if (n<4.0) n='4.0'; else if (n>8.0) n='8.0';
	sp=n.split('\.');
	if (sp[1]>11) sp[1]=11;
	document.F.h.value=sp[0]+"'"+sp[1];
	pos=3+((sp[0]-4)+(sp[1]/12))*34.5; 
	document.getElementById('nob').style.left=pos+'px';
}

/***********************************************
* Modification of Drag and Drop Script: 
* © Dynamic Drive (http://www.dynamicdrive.com)
***********************************************/
var dragobject={
	x: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0,
	initialize:function(){
		document.onmousedown=this.drag
		document.onmouseup=function(){this.dragapproved=0}
	},drag:function(e){
		var evtobj=window.event? window.event : e
		this.targetobj=window.event? event.srcElement : e.target
		if (this.targetobj.id=="nob"){
			this.dragapproved=1
			if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0}
			this.offsetx=parseInt(this.targetobj.style.left)
			this.x=evtobj.clientX
			if (evtobj.preventDefault) evtobj.preventDefault()
			document.onmousemove=dragobject.moveit
		}
	},moveit:function(e){
		var evtobj=window.event? window.event : e
		if (this.dragapproved==1){
			v=evtobj.clientX-this.x+this.offsetx;
			if (v<3) v=3; else if (v>142) v=142;
			this.targetobj.style.left=v+"px"
			v = 4 + (v-3)/34.5;
			ft=parseInt(v); 
			if (ft==v) inch='0';
			else inch=parseInt((v-ft)*12)
			document.F.h.value=ft+"'"+inch;
			return false
		}
	}
}
dragobject.initialize();