//error support
function error(error){
	alert(error);
}




function show_hide(divName) {
   if (document.getElementById) {
       obj=document.getElementById(divName)
   } else if (document.all) {
       obj=document.all[divName]
   }

   if (obj) {
       if (obj.style.display == "none") {
           obj.style.display = '';
       }
       else {
           obj.style.display = 'none';
       }
   }
}

function checkCount(field, field_left, max_char){
    if (field.value.length > max_char) {
        field.value = field.value.substring(0,max_char);
    }
	field_left.value = ( max_char - field.value.length);
}

function charCount() {
	checkCount(document.f.short_description_bg, document.f.short_desc_left_bg, 200);
	checkCount(document.f.description_bg, document.f.desc_left_bg, document.f.desc_left_bg.maxLength);
}


//tagove
function showAbout(x, y){
	if(x == 'tea'){
		document.getElementById('lit').className = 'selected';
		document.getElementById('lic').className = '';
		document.getElementById('lip').className = '';
	}
	if(x == 'con') {
		document.getElementById('lit').className = '';
		document.getElementById('lic').className = 'selected';
		document.getElementById('lip').className = '';
	}
	if(x == 'pro') {
		document.getElementById('lit').className = '';
		document.getElementById('lic').className = '';
		document.getElementById('lip').className = 'selected';
	}
	document.getElementById('about').innerHTML = '<img src="html/img/indicator.gif" />'
	return false;
}

//Ajax functions
//change District via City
function changeDistrict(x, y){
	xajax_processDistrict(x, y);
	return false;
}

function changeDistrict2(x, y){
	xajax_processDistrict2(x, y);
	return false;
}

function request(){
	xajax_processRequest(xajax.getFormValues("f"));
	return false;
}

function ShowInfo(x){
	xajax_processShowInfo(x);
	return false;
}

function ShowImage(x){
	document.getElementById('image').innerHTML = 'Loading...'
	xajax_processShowImage(x);
	return false;
}

function send2friend(){
	my_window= window.open ("", "s2f","location=0,status=0,scrollbars=0,width=300,height=300");
	my_window.document.write('<H1>Popup Test!</H1>');
}


function GetCity()
{
	xajax_processAddCity(xajax.getFormValues("firmaddform"));
}
