// JavaScript Document
function center() {
	with (document) {
		getElementById('content').style.height=body.clientHeight-204+'px';
	}
}
function name_wid(up) {
	var ar=new Array(up),m,ar2=new Array(up),m2;
	with (document) {
		for (i=0; i < ar.length; i++) {
			ar[i]=getElementById('n'+i).clientHeight;
		}
		m=ar[0]; m2=ar2[0];
		for (i=1; i < ar.length; i++) {
			if (ar[i] > m) m=ar[i];
		}
		for (i=0; i < ar.length; i++) {
			getElementById('n'+i).style.height=m+'px';
		}
	}
}
function trim(x) {
	var ch,c
	ch=x.toString()
	c=ch.charAt(0)
	while (c==" ") { 
	  ch=ch.slice(1)
	  c=ch.charAt(0)
	}
	c=ch.charAt(ch.length-1)
	while(c==" ") { 
	  ch=ch.slice(0,-1)
	  c=ch.charAt(ch.length-1)
	}
	return ch;
}
function faq_f1() {
	with (document) {
		var tmp2=form_783410_search.search;
		if (trim(tmp2.value)!='') {
			form_783410_search.page_num.value=-1;
			form_783410_search.submit();
		}
		else {tmp2.className='enter_sl_no'; tmp2.focus(); return 0;}
	}
}
function res_serch() {
	document.form_783410_search.search.value='';
	document.form_783410.submit();
}
function res(disp,ifserch) {
	if (!disp) disp='Use search form or post your question.';
	with (document) {
		for (i=1; i < 4; i++) {
			if (getElementById('res'+i).className=='faq_f2_res_'+i) {
				getElementById('res'+i).className='faq_f2_ask_'+i;
				getElementById('ask'+i).className='faq_f2_res_'+i;
			}
		}
		if (getElementById('res3').className=='faq_f2_ask_3') {
			getElementById('sod').style.display='none';
			getElementById('faq_f2').className='faq_f2_fon_s';
			getElementById('sod2').style.display='block';
			if (ifserch==1) getElementById('sod2').innerHTML=disp+'<div class="res_btn" onclick="res_serch();">Show All Questions</div>';
			else getElementById('sod2').innerHTML=disp;
		}
	}
}
function ask() {
	with (document) {
		for (i=1; i < 4; i++) {
			if (getElementById('res'+i).className!='faq_f2_res_'+i) {
				getElementById('res'+i).className='faq_f2_res_'+i;
				getElementById('ask'+i).className='faq_f2_ask_'+i;
			}
		}
		if (getElementById('res3').className=='faq_f2_res_3') {
			getElementById('sod2').style.display='none';
			getElementById('faq_f2').className='faq_f2_fon';
			getElementById('sod').style.display='block';
		}
	}
}
function box() {
	with (document) {
		if (form_783410.notify.value=="") {
			form_783410.notify.value="on";
			getElementById('bx').style.background='url(images/gal.gif)';
			form_783410.email.readOnly=false;
		}
		else {
			form_783410.notify.value="";
			getElementById('bx').style.background='#fff';
			form_783410.email.className='ent_email';
			form_783410.email.value="";
			form_783410.email.readOnly='readOnly';
		}
	}
}
function scan_box() {
	with (document) {
		if (form_783410.email.value!='') {
			form_783410.notify.value="on";
			getElementById('bx').style.background='url(images/gal.gif)';
			form_783410.email.readOnly=false;
		}
	}
}
function testKey(e) {
	var key=(typeof e.charCode=='undefined'?e.keyCode:e.charCode);
	if (e.ctrlKey || e.altKey || key<32) return true;
	key=String.fromCharCode(key);
	return /\d/.test(key);
}
function check_mail(email) { 
	var re = new RegExp("^[\\w\\.-]+@[\\w\\.-]+\\.[A-Za-z]{2,}");
  	return (re.test(email));
}
function faq_send() {
	var ok=1;
	with (document) {
		tmp2=form_783410.number;
		if (trim(tmp2.value)) tmp2.className='ent_numb';
		else {
			ok=0;
			tmp2.className='ent_numb_d';
			tmp2.focus();
		}
		tmp2=form_783410.messg;
		if (trim(tmp2.value)) tmp2.className='ent_mes';
		else {
			ok=0;
			tmp2.className='ent_mes_d';
			tmp2.focus();
		}
		tmp2=form_783410.email;
		if (form_783410.notify.value=='on') { 
			if (check_mail(tmp2.value)) tmp2.className='ent_email';
			else { 
				ok=0;
				tmp2.className='ent_email_d';
				tmp2.focus();
			}
		}
		tmp2=form_783410.fname;
		if (trim(tmp2.value)) tmp2.className='ent_n';
		else {
			ok=0;
			tmp2.className='ent_n_d';
			tmp2.focus();
		}
		
		if (ok==1) {
			form_783410.func.value='post_quest';
			form_783410.submit();
		}
		else return false;
	}
}
function add_comment() {
	var ok=1;
	with (document) {
		tmp2=form_comm_news.ch_num;
		if (getElementById('n_r_n').style.visibility=='visible') getElementById('n_r_n').style.visibility='hidden'; 
		if (trim(tmp2.value)) tmp2.className='nc_inp3';
		else {
			ok=0;
			tmp2.className='nc_inp3_d';
			tmp2.focus();
		}
		tmp2=form_comm_news.bodymessg;
		if (trim(tmp2.value)) tmp2.className='nc_tara';
		else {
			ok=0;
			tmp2.className='nc_tara_d';
			tmp2.focus();
		}
		tmp2=form_comm_news.email;
		if (tmp2.value) 
			if (check_mail(tmp2.value)) tmp2.className='nc_inp12';
			else {
				ok=0;
				tmp2.className='nc_inp12_d';
				tmp2.focus();
			}
		else tmp2.className='nc_inp12';
		tmp2=form_comm_news.fname;
		if (trim(tmp2.value)) tmp2.className='nc_inp12';
		else {
			ok=0;
			tmp2.className='nc_inp12_d';
			tmp2.focus();
		}
		
		if (ok==1) {
			form_comm_news.action.value='post_comm';
			form_comm_news.submit();
		}
		else return false;
	}
}
function cu_head(num,sid) {
	with(document) {
		var obj=getElementById(sid);
		form_4371.let_subj.value=num;
		for (i=1; i < 8; i++) getElementById('s'+i).className='cu_span_d';	
		obj.className='cu_span_e';
		getElementById('cu_head').innerHTML=obj.innerHTML;
	}
}
function cu_form() {
	var ok=1;
	with (document) {
		tmp2=form_4371.ch_num;
		if (getElementById('cu_r_n').style.visibility=='visible') getElementById('cu_r_n').style.visibility='hidden'; 
		if (trim(tmp2.value)) tmp2.className='cu_inp4';
		else {
			ok=0;
			tmp2.className='cu_inp4_d';
			tmp2.focus();
		}
		tmp2=form_4371.bodymessg;
		if (trim(tmp2.value)) tmp2.className='cu_tara';
		else {
			ok=0;
			tmp2.className='cu_tara_d';
			tmp2.focus();
		}
		tmp2=form_4371.question;
		if (trim(tmp2.value)) tmp2.className='cu_inp123';
		else {
			ok=0;
			tmp2.className='cu_inp123_d';
			tmp2.focus();
		}
		tmp2=form_4371.email;
		if (check_mail(tmp2.value)) tmp2.className='cu_inp123';
		else {
			ok=0;
			tmp2.className='cu_inp123_d';
			tmp2.focus();
		}
		tmp2=form_4371.fname;
		if (trim(tmp2.value)) tmp2.className='cu_inp123';
		else {
			ok=0;
			tmp2.className='cu_inp123_d';
			tmp2.focus();
		}
		
		if (ok==1) {
			if (confirm('Send now?')) {
				form_4371.action.value='2';
				form_4371.submit();
			}
		}
		else return false;
	}
}
function cu_f_inf(disp) {
	with (document) {
		getElementById('cu_form_sod').style.display='none';
		form_4371.className='cu_form_inf';
		getElementById('cu_form_sod2').innerHTML=disp+'<br /><span onclick="cu_forn_refr();">click here</span>';
	}
}
function cu_forn_refr() {
	with (document) {
		getElementById('cu_form_sod').style.display='block';
		form_4371.className='cu_form';
		getElementById('cu_form_sod2').innerHTML='';
	}
}
function form_comm_refr() {
	with (document) {
		getElementById('form_comm_sod').style.display='block';
		getElementById('form_comm_sod2').style.display='none';
	}
}
function getBodyScrollTop() {
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

function showDiv(x,y){
document.getElementById("note").style.display='block';
document.getElementById("note").style.top=y+getBodyScrollTop()+'px';
document.getElementById("note").style.left=x+'px';
}
function hideDiv(){
document.getElementById("note").style.display='none';
}
