function hLogin(x,y) {
	getSWF('topmenu').hideLogin(x,y);
}

function setNoPoints() {
	$("#no-points").show().fadeOut(5000);
}

function resetButtons() {
	$("input[id^='bb']").click(function() {
//		alert('resetButtons');
		$("input[id^='bb']").removeClass();
		$("input[id^='bb']").addClass('button-blue');
		$(this).removeClass();
		$(this).addClass('button-down');
	});
}

function setTrainingOrderPick() {
	//$("#new-training").hide();
	$("#gord_type").change(function() {															
				var url="/_show_ordr_gratis.php?save=1&" + $("#order-gratis-form").serialize();
				xmlreqGET('cont-ordr-gratis',url);
		/*	if ($(this).val()==1) {
				$("#new-training").show();
			}	else {
				$("#new-training").hide();
			}*/
		}
	);
}


function setCompanyUserPick() {
	//$("#new-company").hide();
	$("#company_user").change(function() {		
				var url="/_show_ordr_gratis.php?save=1&" + $("#order-gratis-form").serialize();
				xmlreqGET('cont-ordr-gratis',url);
		/*	if ($(this).val()==-1) {
				$("#new-company").show();
			}	else {
				$("#new-company").hide();
			}*/
		}
	);
}

function saveNewCompany() {
	if (!is_nip($("#company_user_login").val())) {
		$("#company_user_login").focus();
		alert('Podaj poprawny numer NIP.');
	} else {
		var url="/_show_ordr_gratis.php?save=1&new-company=1&" + $("#form-new-company").serialize();
		xmlreqGET('cont-ordr-gratis',url);
	}
}

function saveNewTraining() {
		var url="/_show_ordr_gratis.php?save=1&new-training=1&" + $("#form-new-training").serialize();
		xmlreqGET('cont-ordr-gratis',url);
}

function quesMoreLess() {
	$('.question').click(function() {
		$('.answer').slideUp(200);
		$('#an'+ $(this).attr('id')).slideToggle(1000);
	});
}

function setSaveGratisOrder() {
	$("#save-order-gratis").click(function() {
		var url="/_show_ordr_gratis.php?save=1&new=1";
		xmlreqGET('cont-ordr-gratis',url);
		return false;
	});
}

function setSaveOrder() {
	$("#save-order").click(function() {
		var url="/_show_ordr.php?save=1&new=1";
		xmlreqGET('cont-ordr',url);
		return false;
	});
}

function setCloseGratisOrder() {		
	$("#close-order-gratis").click(function() {
		var url= "/_show_ordr_gratis.php?save=1&pd[gord_order_status]=1&" + $("#order-gratis-form").serialize(); 
		xmlreqGET('cont-ordr-gratis',url);
		return false;
	});
}

function setCloseOrder() {		
	$("#close-order").click(function() {
		var url= "/_show_ordr.php?save=1&pd[zinv_order_status]=1&" + $("#order-form").serialize(); 
		xmlreqGET('cont-ordr',url);
		return false;
	});
}

function changeOrderUser() {
	$('#alter_user').change(function() {
		var url="/_show_ordr.php?save=1&" + $("#order-form").serialize();
		xmlreqGET('cont-ordr',url);
		return false;	
	});
}

function setGratisPick() {	
	$(document).bind('keypress',function(event) {
		 if (event.keyCode == '13') {
			 
		 addGratisItem();
		}
	});
}

function setAssortmentPick() {	
	$(document).bind('keypress',function(event) {
		 if (event.keyCode == '13') {
			 
		 addItem();
		}
	});
}

function addBaseItem() {
		if ($("#base_grat_id").val() == '0' || jQuery.trim($("#base_gitm_quantity").val()) == '') { 
			alert('Wybierz produkt i podaj ilość.');  
		} else {											
			var url = "/_show_ordr_gratis.php?save_item=1&" + $("#base-item-form").serialize();
			xmlreqGET('cont-ordr-gratis',url);
			return false;
		}
}

function addGratisItem() {
		if ($("#grat_id").val() == '0' || jQuery.trim($("#gitm_quantity").val()) == '') { 
			alert('Wybierz produkt i podaj ilość.');  
		} else {											
			var url = "/_show_ordr_gratis.php?save_item=1&" + $("#item-form").serialize();
			xmlreqGET('cont-ordr-gratis',url);
			return false;
		}
}

function addItem() {
		if ($("#prod_points").val() == 0 || jQuery.trim($("#zitm_quantity").val()) == '') { 
			alert('Wybierz produkt i podaj ilość.');  
		} else {											
			var url = "/_show_ordr.php?save_item=1&" + $("#item-form").serialize();
			xmlreqGET('cont-ordr',url);
			return false;
		}
}

function setManager(x) {
	$('#mana_id').change(function() {
		var url="/_show_"+x+".php?mana="+ $(this).val();
		xmlreqGET('cont-'+x,url);					 
	});	
}

function setSpecialist(x) {
	$('#spec_id').change(function() {
		var url="/_show_"+x+".php?mana="+ $('#mana_id').val() + "&spec="+ $(this).val();
		xmlreqGET('cont-'+x,url);					 
	});	
}

function setPartner(x) {
	$('#user_id').change(function() {
		var url="/_show_"+x+".php?mana="+ $('#mana_id').val() + "&spec="+ $('#spec_id').val() + "&user="+ $(this).val();
		xmlreqGET('cont-'+x,url);					 
	});	
}

function setPorpMonth(x) {
    $('#mies_id').change(function() {
        var url="/_show_"+x+".php?mies="+$('#mies_id').val() + "&mini="+ $('#min_id').val() + "&maxi="+ $('#max_id').val() + "&ph_id="+ $('#ph_id').val();
        xmlreqGET('cont-'+x,url);
    });
}

function setPorpKwart(x) {
    $('#kwart_id').change(function() {
        var url="/_show_"+x+".php?quar="+$('#kwart_id').val() + "&mini="+ $('#min_id').val() + "&maxi="+ $('#max_id').val() + "&ph_id="+ $('#ph_id').val();
        xmlreqGET('cont-'+x,url);
    });
}

function setPorpUpdate(x) {
    $('#update_porp').click(function() {
        var url="/_show_"+x+".php?from_d="+$('#from_id').val() + "&till_d="+ $('#till_id').val() + "&mini="+ $('#min_id').val() + "&maxi="+ $('#max_id').val() + "&ph_id="+ $('#ph_id').val() + "&prod_id="+ $('#prod_id').val();
        xmlreqGET('cont-'+x,url);
    });
}

function setPorpYear(x) {
    $('#year_id').change(function() {
        var url="/_show_"+x+".php?year="+$('#year_id').val() + "&mini="+ $('#min_id').val() + "&maxi="+ $('#max_id').val() + "&ph_id="+ $('#ph_id').val();
        xmlreqGET('cont-'+x,url);
    });
}

function setStatKlasy(x) {
    $('#klas_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val() + "&klas="+$(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatManager(x) {
    $('#mana_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&mana="+$(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatSpecialist(x) {
    $('#spec_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&spec="+$(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatPartner(x) {
    $('#user_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&user="+ $(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatSupAdmin(x) {
    $('#sadm_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&sadm="+$(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatAdmin(x) {
    $('#admi_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&admi="+$(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatControl(x) {
    $('#cont_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&cont="+ $(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}

function setStatGroup(x) {
    $('#grup_id').change(function() {
        var url="/_show_"+x+".php?from="+$('#from_id').val()+"&till="+$('#till_id').val()+"&klas="+$('#klas_id').val() + "&grup="+ $(this).val();
        xmlreqGET('cont-'+x,url);                     
    });    
}


function setQuestion(e) {
	$("*[id^='ques_']").blur(function(){
		$(this).css('background-color','white');
	});
	$("#send-form").click(function () {		
		if (jQuery.trim($("#ques_fullname").val()) == '' ) { alert(e); $("#ques_fullname").focus().css('background-color','#EEEEEE');  }
		else if (!is_em($("#ques_email").val())) { alert(e); $("#ques_email").focus().css('background-color','#EEEEEE');  }
		else if (jQuery.trim($("#ques_question").val()) == '' ) { alert(e); $("#ques_question").focus().css('background-color','#EEEEEE');  }
		else {
			var url="/_ask_question.php?" + $("#contact-form").serialize();
			xmlreqGET('cont-ques',url);
		}
		return false;
	});
}

function setApplication(e) {
	$("#user_login").change( function () { 
		$(this).val($(this).val().replace(/[^0-9]+/g,""));
	});
	$("*[id^='user_']").blur(function(){
		$(this).css('background-color','white');
	});
	$("#send-form").click(function () {		
		if (jQuery.trim($("#user_company").val()) == '' ) { alert(e); $("#user_company").focus().css('background-color','#EEEEEE');  }
		else if ( !is_nip($("#user_login").val())) { alert("Wpisz poprawny numer NIP."); $("#user_login").focus().css('background-color','#EEEEEE');  }
		else if (jQuery.trim($("#user_name").val()) == '' ) { alert(e); $("#user_name").focus().css('background-color','#EEEEEE');  }
		else if (jQuery.trim($("#user_surname").val()) == '' ) { alert(e); $("#user_surname").focus().css('background-color','#EEEEEE');  }
		else if (jQuery.trim($("#user_address").val()) == '' ) { alert(e); $("#user_address").focus().css('background-color','#EEEEEE');  }
		else if (jQuery.trim($("#user_postal_code").val()) == '' ) { alert(e); $("#user_postal_code").focus().css('background-color','#EEEEEE');  } 
		else if (jQuery.trim($("#user_city").val()) == '' ) { alert(e); $("#user_city").focus().css('background-color','#EEEEEE');  } 
		else if (jQuery.trim($("#user_province").val()) == '0' ) { alert(e); $("#user_province").focus().css('background-color','#EEEEEE');  } 
		else if (jQuery.trim($("#user_tel").val()) == '' ) { alert(e); $("#user_tel").focus().css('background-color','#EEEEEE');  } 
		else if ( !is_em($("#user_email").val())) { alert("Wpisz poprawny adres e-mail."); $("#user_email").focus().css('background-color','#EEEEEE');  } 
		else if ( !$("#user_agreement1").attr('checked') ) { alert(e); $("#user_agreement1").focus().css('background-color','#EEEEEE');  } 
		else if ( !$("#user_agreement2").attr('checked') ) { alert(e); $("#user_agreement2").focus().css('background-color','#EEEEEE');  } 
		else if ( !$("#user_agreement3").attr('checked') ) { alert(e); $("#user_agreement3").focus().css('background-color','#EEEEEE');  } 
		else {
			var url="/_application.php?" + $("#contact-form").serialize();
			xmlreqGET('cont-appl',url);
		}
		return false;
	});
}

function setMyTrng() {
	$(".trng-normal-day").click(function() {
		if (confirm('Czy na pewno chcesz zarezerwować ten termin?')) {												 
			$(this).attr('class','trng-active-day');
			$.get('/_set_trng.php', { user: $("#user_id").val(),  date: $("#trng-year").val()+'-'+$("#trng-mon").val()+'-'+$(this).html() } , function (data) {
				$("#trng-msg").html(data).show().fadeOut(5000);																																						
			});
		}
	});
}
function changeCalendar() {
	$("#trng-year").change(function (){
		$.get('/_set_cldr.php', { y: $("#trng-year").val(), m: $("#trng-mon").val(), user: $("#user_id").val() }, function (data) {
				$("#trening").html(data);																																						
			});
	});
	$("#trng-mon").change(function (){
		$.get('/_set_cldr.php', { y: $("#trng-year").val(), m: $("#trng-mon").val(), user: $("#user_id").val() }, function (data) {
				$("#trening").html(data);																																						
			});
	});
	
}
function setMyInvc() {
	$("[id^=it_]").click(function() {	
		$("#t"+$(this).attr('id')).slideToggle();									
		if ($(this).attr('class') != 'invc-active-tr') {
			$(this).attr('class','invc-active-tr') ;
		} else {
			$(this).attr('class','invc-normal-tr') ;
		}
	});
}

function setMyPriz() {
	$("[id^=it_]").click(function() {	
		$("#t"+$(this).attr('id')).slideToggle();									
		if ($(this).attr('class') != 'invc-active-tr') {
			$(this).attr('class','invc-active-tr') ;
		} else {
			$(this).attr('class','invc-normal-tr') ;
		}
	});
}


function setItemForm(x,y) {	
	$('#ft_new').click(function() {
		var url="/_show_item_form.php?user="+ x + "&invc="+ y;
		xmlreqGET('item-form',url);					 
	});
	
	$('#ft_save').click(function() {
		var url="/_show_item_list.php?user="+ x +"&save=1&" + $("#f_item").serialize();
		xmlreqGET('item-list',url);
		url="/_show_item_form.php?user="+ x +"&invc=" + y;
		xmlreqGET('item-form',url);					 
	});
}

function setInvcForm(x) {	
	$('#fv_new').click(function() {
		var url="/_show_invc_form.php?user="+ x;
		xmlreqGET('invc-form',url);									 
		url="/_show_item_form.php?user="+ x;
		xmlreqGET('item-form',url);					 
		url="/_show_item_list.php?user="+ x;
		xmlreqGET('item-list',url);
	});
	
	$('#fv_save').click(function() {
		var url="/_show_invc_list.php?user="+ x +"&save=1&" + $("#f_invc").serialize();
		xmlreqGET('invc-list',url);						 
		url="/_show_invc_form.php?user="+ x;
		xmlreqGET('invc-form',url);									 
	});

}

function setInvcList(x) {	
	$('.invc_tr').click(function(){	
		var url="/_show_invc_form.php?user="+ x +"&invc=" + $(this).attr('title');
		xmlreqGET('invc-form',url);
		url="/_show_item_form.php?user="+ x +"&invc=" + $(this).attr('title');
		xmlreqGET('item-form',url);
		url="/_show_item_list.php?user="+ x +"&invc=" + $(this).attr('title');
		xmlreqGET('item-list',url);	
	});
}

function setItemList(x) {	
	var url="/_show_invc_list.php?user="+ x;
	xmlreqGET('invc-list',url);
	
	$('.item_tr').click(function(){								  	
		var url="/_show_item_form.php?user="+ x +"&item=" + $(this).attr('title');
		xmlreqGET('item-form',url);					 
	});
}

////////////////////

function setGitmForm(x,y) {	
	$('#ft_new').click(function() {
		var url="/_show_gitm_form.php?user="+ x + "&gord="+ y;
		xmlreqGET('gitm-form',url);					 
	});
	
	$('#ft_save').click(function() {
		var url="/_show_gitm_list.php?user="+ x +"&save=1&" + $("#f_gitm").serialize();
		xmlreqGET('gitm-list',url);
		url="/_show_gitm_form.php?user="+ x +"&gord=" + y;
		xmlreqGET('gitm-form',url);					 
	});
}

function setZitmForm(x,y) {	
	$('#ft_new').click(function() {
		var url="/_show_zitm_form.php?user="+ x + "&zinv="+ y;
		xmlreqGET('zitm-form',url);					 
	});
	
	$('#ft_save').click(function() {
		var url="/_show_zitm_list.php?user="+ x +"&save=1&" + $("#f_zitm").serialize();
		xmlreqGET('zitm-list',url);
		url="/_show_zitm_form.php?user="+ x +"&zinv=" + y;
		xmlreqGET('zitm-form',url);					 
	});
}

function setGordForm(x) {	
	$('#fv_new').click(function() {
		var url="/_show_gord_form.php?user="+ x;
		xmlreqGET('gord-form',url);									 
		url="/_show_gitm_form.php?user="+ x;
		xmlreqGET('gitm-form',url);					 
		url="/_show_gitm_list.php?user="+ x;
		xmlreqGET('gitm-list',url);
	});
	
	$('#fv_save').click(function() {
		var url="/_show_gord_list.php?user="+ x +"&save=1&" + $("#f_gord").serialize();
		xmlreqGET('gord-list',url);						 
		url="/_show_gord_form.php?user="+ x;
		xmlreqGET('gord-form',url);									 
	});
	// $("#wzd_send").click(function() {$("#form1").attr('action',"/_wz_print.php").submit(); });
}

function setZinvForm(x) {	
	$('#fv_new').click(function() {
		var url="/_show_zinv_form.php?user="+ x;
		xmlreqGET('zinv-form',url);									 
		url="/_show_zitm_form.php?user="+ x;
		xmlreqGET('zitm-form',url);					 
		url="/_show_zitm_list.php?user="+ x;
		xmlreqGET('zitm-list',url);
	});
	
	$('#fv_save').click(function() {
		var url="/_show_zinv_list.php?user="+ x +"&save=1&" + $("#f_zinv").serialize();
		xmlreqGET('zinv-list',url);						 
		url="/_show_zinv_form.php?user="+ x;
		xmlreqGET('zinv-form',url);									 
	});
	$("#wz_print").click(function() { $("#f_zinv").attr('action',"/_wz_print.php").submit(); });
	$("#wztxt_print").click(function() { $("#f_zinv").attr('action',"/_wztxt_print.php").submit(); });
}

function setGordList(x) {	
	$('.gord_tr').click(function(){	
		var url="/_show_gord_form.php?user="+ x +"&gord=" + $(this).attr('title');
		xmlreqGET('gord-form',url);
		url="/_show_gitm_form.php?user="+ x +"&gord=" + $(this).attr('title');
		xmlreqGET('gitm-form',url);
		url="/_show_gitm_list.php?user="+ x +"&gord=" + $(this).attr('title');
		xmlreqGET('gitm-list',url);	
	});
}


function setZinvList(x) {	
	$('.zinv_tr').click(function(){	
		var url="/_show_zinv_form.php?user="+ x +"&zinv=" + $(this).attr('title');
		xmlreqGET('zinv-form',url);
		url="/_show_zitm_form.php?user="+ x +"&zinv=" + $(this).attr('title');
		xmlreqGET('zitm-form',url);
		url="/_show_zitm_list.php?user="+ x +"&zinv=" + $(this).attr('title');
		xmlreqGET('zitm-list',url);	
	});
}

function setGitmList(x) {	
	var url="/_show_gord_list.php?user="+ x;
	xmlreqGET('gord-list',url);
	
	$('.gitm_tr').click(function(){								  	
		var url="/_show_gitm_form.php?user="+ x +"&gitm=" + $(this).attr('title');
		xmlreqGET('gitm-form',url);					 
	});
}

function setZitmList(x) {	
	var url="/_show_zinv_list.php?user="+ x;
	xmlreqGET('zinv-list',url);
	
	$('.zitm_tr').click(function(){								  	
		var url="/_show_zitm_form.php?user="+ x +"&zitm=" + $(this).attr('title');
		xmlreqGET('zitm-form',url);					 
	});
}

//////////////////////////////////////////

function change_parent_url(url) {
	document.getElementById('poz').src = url;
}	
function reload_parent_url(url) {
	document.getElementById('list').src = url;
}	
function getRightBG(x) {
	$('#img-right').css('background-image','url(/img_page/'+x+')');
}
function getRightSize(y) {
	$('#img-r').css('width',y+'px');
	$('#img-r img').css('width',y+'px');
	$('#img-c').css('width',(741-y)+'px');
	$('#img-c img').css('width',(741-y)+'px');
}
function showProduct() {
	$('#product-swf').css('width','540px');
	getSWF("product-swf").showPopup();
}

function hideProduct() {
	$('#product-swf').css('width','15px');
}


function ToggleFlights(t1,t2) {
	$('#more-view').toggle();
	$('.contact_header2').text($('#more-view').state?t1:t2);
	$('#schedule-more img').attr('src','/img/arrows_' + ( $('#more-view').state?'down':'up') + '.jpg');
	$('#more-view').state = 0?1:0;
}
function Logout(x) {
	$("#sign-out").click(function () {
		if(confirm(x)) { 
			getPageLogout(); 
		}							   
	});
}

function setContact(d,e,t,c,e1,t1,c1) {
	$("#cf_email").focus(function () {		if ($(this).val() == e1 ) $(this).val('') ;				  	});
	$("#cf_email").blur(function () {		if (jQuery.trim($(this).val()) == '' ) $(this).val(e1) ;	});
//	$("#cf_subject").focus(function () {	if ($(this).val() == t1 ) $(this).val('') ;					});
//	$("#cf_subject").blur(function () {		if (jQuery.trim($(this).val()) == '' ) $(this).val(t1) ;	});
	$("#cf_content").focus(function () {	if ($(this).val() == c1 ) $(this).val('') ;					});
	$("#cf_content").blur(function () {		if (jQuery.trim($(this).val()) == '' ) $(this).val(c1) ;	});
	$("#clear-form").click(function () {	$("#contact-form").resetForm();} );
	$("#send-form").click(function () {								
		if (!$("input:checked").length) { alert(d); $("#sub0").focus(); }
		else if (jQuery.trim($("#cf_email").val()) == ''   || jQuery.trim($("#cf_email").val()) ==   e1) { alert(e); $("#cf_email").focus();  }
//		else if (jQuery.trim($("#cf_subject").val()) == '' || jQuery.trim($("#cf_subject").val()) == t1) { alert(t); $("#cf_subject").focus();  }
		else if (jQuery.trim($("#cf_content").val()) == '' || jQuery.trim($("#cf_content").val()) == c1) { alert(c); $("#cf_content").focus();  } 
		else {
			var url="/_contact.php?" + $("#contact-form").serialize();
			xmlreqGET('contact-form',url);
		}
	});
}

function buyInit(page_link, x) {
	var url="/_show_page.php?page_link=" + page_link;
	var query;
	$("#where").focus(function () {
		if ($(this).val() == x ) $(this).val('') ;						  
	});
	$("#where").blur(function () {
		if (jQuery.trim($(this).val()) == '' ) $(this).val(x) ;
	});
	$("#go-mini").click(function() {
		if (jQuery.trim($("#where").val()) == x) $("#where").val('');
		query = "&how=" + $(":checked").val();
		query = query + "&where=" + $("#where").val();
		query = query + "&d1=" + $("#d1").val();
		query = query + "&m1=" + $("#m1").val();
		query = query + "&d2=" + $("#d2").val();
		query = query + "&m2=" + $("#m2").val();
		query = query + "&adults=" + $("#adults").val();
		query = query + "&children=" + $("#children").val();
		query = query + "&infants=" + $("#infants").val();
		url = url + query;
		xmlreqGET('adiv',url);
	});	
}


function contactInit() {
	$("#clear-form").click(function() {
		$("#cf_content").val('');
		$("#cf_subject").val('');
		$("#cf_main_subject").val('');
	});
	
}
function titleUpdate(t) {
	document.getElementsByTagName("title")[0].text = t;
}

function myk_subs(x) {
	$("#in_subs").focus(function () {
		if ($(this).val() == x ) $(this).val('') ;						  
	});
	$("#in_subs").blur(function () {
		if (jQuery.trim($(this).val()) == '' ) $(this).val(x) ;
	});
}

function myk_login(x,y) {
	$("#login").focus(function () {
		if ($(this).val() == x ) $(this).val('') ;						  
	});
	$("#login").blur(function () {
		if (jQuery.trim($(this).val()) == '' ) $(this).val(x) ;
	});
	
	$("#passt").focus(function () {
		$(this).toggle();
		$("#pass").toggle().focus();
	})
	$("#pass").blur(function () {
		if (jQuery.trim($(this).val()) == '' ) {
			$(this).toggle();
			$(this).val('');
			$("#passt").toggle().blur();
		}
	});
}

function myk_ub() {
	$("#menu_top").toggle(500);
	$("#main_menu").toggle(500);
}

var xmlreqs = new Array();

function CXMLReq(freed) {
	this.freed = freed;
	this.xmlhttp = false;
	this.xmlhttp = GetXmlHttpObject();
}

function xmlreqGET(para,url) {
	var pos = -1;
	for (var i=0; i<xmlreqs.length; i++) {
		if (xmlreqs[i].freed == 1) { 
			pos = i; 
			break; 
		}
	}
	if (pos == -1) { 
		pos = xmlreqs.length; 
		xmlreqs[pos] = new CXMLReq(1); 
	}
	if (xmlreqs[pos].xmlhttp) {
		xmlreqs[pos].freed = 0;
		xmlreqs[pos].xmlhttp.open("GET",url,true);
		xmlreqs[pos].xmlhttp.onreadystatechange = function() {
			if (typeof(xmlhttpChange) != 'undefined') { xmlhttpChange(pos,para); }
		}
		if (window.XMLHttpRequest) {
			xmlreqs[pos].xmlhttp.send(null);
		} else if (window.ActiveXObject) {
			xmlreqs[pos].xmlhttp.send();
		}
	}
}

function xmlreqPOST(para,url,data) {
	var pos = -1;
	for (var i=0; i<xmlreqs.length; i++) {
		if (xmlreqs[i].freed == 1) { 
			pos = i; 
			break; 
		}
	}
	if (pos == -1) { 
		pos = xmlreqs.length; 
		xmlreqs[pos] = new CXMLReq(1); 
	}
	if (xmlreqs[pos].xmlhttp) {
		xmlreqs[pos].freed = 0;
		xmlreqs[pos].xmlhttp.open("POST",url,true);
		xmlreqs[pos].xmlhttp.onreadystatechange = function() {
			if (typeof(xmlhttpChange) != 'undefined') { xmlhttpChange(pos,para); }
		}
		xmlreqs[pos].xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlreqs[pos].xmlhttp.send(data);
	}
}

function handle_response(responseText, para) {
	$("#" + para).html(responseText);
	
}

function xmlhttpChange(pos,para) {
	if (typeof(xmlreqs[pos]) != 'undefined' && xmlreqs[pos].freed == 0 ) {
		if (xmlreqs[pos].xmlhttp.readyState == 4 ) {
			if (xmlreqs[pos].xmlhttp.status == 200 || xmlreqs[pos].xmlhttp.status == 304) {
				handle_response(xmlreqs[pos].xmlhttp.responseText, para);
			} else {
				alert('Proszę odświeżyć stronę.');
			}
			xmlreqs[pos].freed = 1;
		}
	}
}


function getPage(page_link, params) {
	var url="/_show_page.php?page_link=" + page_link;
	if (params.length) url += params;
	xmlreqGET('adiv',url);
}

function getRecord(what,id,opts) {
	var url="/_show_"+ what +".php?" + what + "=" +id + "&options=" + opts;
	xmlreqGET('cont-'+what,url);
}
function getPageEdit(edit) {
	var url="/_show_page.php?edit=" + edit;
	xmlreqGET('adiv',url);
}
function getPageLang(lang) {
	var url="/_show_page.php?lang=" + lang;
	xmlreqGET('adiv',url);
}
function getPageSubs(email) {
	var url="/_show_subs.php";
	if (is_em(email)) url = url + "?email=" + email;		
	xmlreqGET('subs_form',url);
}
function getPageTop() {
	var url="/_show_top.php";
	xmlreqGET('menu-user',url);
}
function getPageLeft() {
	var url="/_show_left.php";
	xmlreqGET('left-menu',url);
}

function getPageBottom() {
	var url="/_show_bottom.php";
	xmlreqGET('container-bot',url);
}
function getPageLogin(login, pass) { 
	var url="/_show_page.php";
	url = url + "?login=" + login;
	url = url + "&pass=" + pass;
	xmlreqGET('adiv',url);
}
function getPageLogout() { 
	window.location.href = "/?logout=1";
}

function GetXmlHttpObject() {
	var xmlHttpObject=null;
		try {
			xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlHttpObject = false;
			}
		}
		if (!xmlHttpObject && typeof XMLHttpRequest != "undefined") {
			try {
				xmlHttpObject = new XMLHttpRequest();
			} catch (e) {
				xmlHttpObject = false;
			}
		}
	return xmlHttpObject;
}

function menuUpdate(I,l){
try {	getSWF("topmenu").updateMenu(I,l); }
catch(e) {}
}
function menuRefresh(I,l){
	try { getSWF("topmenu").refreshMenu(I,l); }
	catch(e) {}
}

function handleChange(event) {
	var parameters = '';
    for (var p in event.parameters) {
        parameters += '&' + p + '=' + event.parameters[p];
    }
	if (event.path !=  '/') getPage( event.path.substring(1), parameters);
}

function getSWF(i){
	try{if(top.document.embeds&&top.document.embeds[i]){
		return top.document.embeds[i];
	}else{
		return top.document.getElementById(i); }}
catch(e){if(e.toString().indexOf("cyclic __proto__ value")>-1)getSWF(i)}}

function pick_list(x,v) {
	var newWindow = top.poz.open('/inc_forms/f_' + x + '.php?' + x + '=' + v ,"poz","");
	newWindow.focus( );
}

function lm_resize(I){var i=document.getElementById('leftmenu');i.style.height=I+'px'}
function sho_hid(I,l){var i=document.getElementById(I);i.className=l?"visy":"vis"}
function news_agree(i){if(!is_em(document.getElementById('subs_input'))){alert('Podaj prawidłowy adres e-mail.');return false}
if(confirm(i)){return true}else{return false}}
function make_titles(d,E,b,i,a){d=document;E=d.documentElement;b=d.body;if(!E)return;for(i=0;a=(d.all?b.all:b.getElementsByTagName("*"))[i];i++){if(a.title){a.t=d.createElement("div");with(a.t){className="tooltip";var buf=a.title.substr(0,4);a.t.modtop=0;a.t.modleft=0;var txtleft="left",txtright="righ",txtbottom="bott";if(buf!=txtleft&&buf!=txtright&&buf!=txtbottom){innerHTML=a.title}
if(buf==txtleft){a.t.modleft=0;innerHTML=a.title.substring(4)}
if(buf==txtright){a.t.modleft=-230;innerHTML=a.title.substring(5)}
if(buf==txtbottom){a.t.modtop=-120;innerHTML=a.title.substring(6)}}
a.onmouseover=function(e){with(this){title="";onmousemove(e)}
b.appendChild(this.t)}
a.onmouseout=function(){with(this){title=t.innerHTML}
b.removeChild(this.t)}
a.onmousemove=function(e){e=e||event;with(this.t.style){left=e.clientX+(E.scrollLeft||b.scrollLeft)+this.t.modleft+"px"
top=e.clientY+(E.scrollTop||b.scrollTop)+this.t.modtop+"px"}}}}}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false,isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false,isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function js_check_group(I){elements=document.forms[I].elements;for(var i=0;i<elements.length;i++){if(elements[i].type=="checkbox"){elements[i].onclick=sel_down}}}
function sel_down(){var o=this,I=Array(),i=o.form.elements,l=o.id.match(/rel_\d+_(\d+)/i);for(var O=0;O<i.length;O++){if(i[O].type=="checkbox"){I=i[O].id.match(/rel_(\d+)_\d+/i);if(I[1]==l[1]){if(o.checked){i[O].checked=true}else{i[O].checked=false}}}}}
function dost(l){var i=top.document.getElementById(l),I=0;if(i){if(i.contentWindow){if(i.contentWindow.document.body.scrollHeight){I=i.contentWindow.document.body.scrollHeight}}else if(i.contentDocument){if(i.contentDocument.body.offsetHeight){I=i.contentDocument.body.offsetHeight}}else if(i.Document){if(i.Document.body.scrollHeight){I=i.Document.body.scrollHeight}}
if(I)i.style.height=I+"px";else i.style.height="0px"}}
function show_h(l){var i=top.document.getElementById(l),I=0;if(i){if(i.contentDocument){if(i.contentDocument.body.offsetHeight){I=i.contentDocument.body.offsetHeight}}else if(i.Document){if(i.Document.body.scrollHeight){I=i.Document.body.scrollHeight}}}}
function dost2(l,O){var o=self.document.getElementById(l),I=self.document.getElementById(O),i=0;if(o){if(o.contentDocument){if(o.contentDocument.body.offsetHeight){i=o.contentDocument.body.offsetHeight}}else if(o.Document){if(o.Document.body.scrollHeight){i=o.Document.body.scrollHeight}}
if(i)I.style.height=i+"px";else o.style.height="0px"}}
function is_em(i){var I=/^[\w-]+(\.[\w-_]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;if(i.match(I))return true;else return false}
function desel(I,l){for(var i=1;i<document.up.elements.length;i++){if(this.checked==false){if(document.up.elements[i]==document.getElementById(l)){document.up.elements[i].checked=false}}}}
function fu(){x=document.kont.eml.selectedIndex;y=document.kont.imnaz;y.options[x].selected=true}
function tot(){x=document.kont.imnaz.selectedIndex;y=document.kont.eml;y.options[x].selected=true}
function myk(I){var i=I.parentNode.nextSibling.nextSibling;if(i.className=='visy'){i.className='vis'}else{i.className='visy'}}

var hexcase=0,b64pad="",chrsz=8;function hex_md5(i){return binl2hex(core_md5(str2binl(i),i.length*chrsz))}
function b64_md5(i){return binl2b64(core_md5(str2binl(i),i.length*chrsz))}
function str_md5(i){return binl2str(core_md5(str2binl(i),i.length*chrsz))}
function hex_hmac_md5(i,I){return binl2hex(core_hmac_md5(i,I))}
function b64_hmac_md5(i,I){return binl2b64(core_hmac_md5(i,I))}
function str_hmac_md5(i,I){return binl2str(core_hmac_md5(i,I))}
function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}
function core_md5(V,X){V[X>>5]|=0x80<<((X)%32);V[(((X+64)>>>9)<<4)+14]=X;var x=1732584193,I=-271733879,i=-1732584194,l=271733878;for(var o=0;o<V.length;o+=16){var O=x,c=I,C=i,v=l;x=md5_ff(x,I,i,l,V[o+0],7,-680876936);l=md5_ff(l,x,I,i,V[o+1],12,-389564586);i=md5_ff(i,l,x,I,V[o+2],17,606105819);I=md5_ff(I,i,l,x,V[o+3],22,-1044525330);x=md5_ff(x,I,i,l,V[o+4],7,-176418897);l=md5_ff(l,x,I,i,V[o+5],12,1200080426);i=md5_ff(i,l,x,I,V[o+6],17,-1473231341);I=md5_ff(I,i,l,x,V[o+7],22,-45705983);x=md5_ff(x,I,i,l,V[o+8],7,1770035416);l=md5_ff(l,x,I,i,V[o+9],12,-1958414417);i=md5_ff(i,l,x,I,V[o+10],17,-42063);I=md5_ff(I,i,l,x,V[o+11],22,-1990404162);x=md5_ff(x,I,i,l,V[o+12],7,1804603682);l=md5_ff(l,x,I,i,V[o+13],12,-40341101);i=md5_ff(i,l,x,I,V[o+14],17,-1502002290);I=md5_ff(I,i,l,x,V[o+15],22,1236535329);x=md5_gg(x,I,i,l,V[o+1],5,-165796510);l=md5_gg(l,x,I,i,V[o+6],9,-1069501632);i=md5_gg(i,l,x,I,V[o+11],14,643717713);I=md5_gg(I,i,l,x,V[o+0],20,-373897302);x=md5_gg(x,I,i,l,V[o+5],5,-701558691);l=md5_gg(l,x,I,i,V[o+10],9,38016083);i=md5_gg(i,l,x,I,V[o+15],14,-660478335);I=md5_gg(I,i,l,x,V[o+4],20,-405537848);x=md5_gg(x,I,i,l,V[o+9],5,568446438);l=md5_gg(l,x,I,i,V[o+14],9,-1019803690);i=md5_gg(i,l,x,I,V[o+3],14,-187363961);I=md5_gg(I,i,l,x,V[o+8],20,1163531501);x=md5_gg(x,I,i,l,V[o+13],5,-1444681467);l=md5_gg(l,x,I,i,V[o+2],9,-51403784);i=md5_gg(i,l,x,I,V[o+7],14,1735328473);I=md5_gg(I,i,l,x,V[o+12],20,-1926607734);x=md5_hh(x,I,i,l,V[o+5],4,-378558);l=md5_hh(l,x,I,i,V[o+8],11,-2022574463);i=md5_hh(i,l,x,I,V[o+11],16,1839030562);I=md5_hh(I,i,l,x,V[o+14],23,-35309556);x=md5_hh(x,I,i,l,V[o+1],4,-1530992060);l=md5_hh(l,x,I,i,V[o+4],11,1272893353);i=md5_hh(i,l,x,I,V[o+7],16,-155497632);I=md5_hh(I,i,l,x,V[o+10],23,-1094730640);x=md5_hh(x,I,i,l,V[o+13],4,681279174);l=md5_hh(l,x,I,i,V[o+0],11,-358537222);i=md5_hh(i,l,x,I,V[o+3],16,-722521979);I=md5_hh(I,i,l,x,V[o+6],23,76029189);x=md5_hh(x,I,i,l,V[o+9],4,-640364487);l=md5_hh(l,x,I,i,V[o+12],11,-421815835);i=md5_hh(i,l,x,I,V[o+15],16,530742520);I=md5_hh(I,i,l,x,V[o+2],23,-995338651);x=md5_ii(x,I,i,l,V[o+0],6,-198630844);l=md5_ii(l,x,I,i,V[o+7],10,1126891415);i=md5_ii(i,l,x,I,V[o+14],15,-1416354905);I=md5_ii(I,i,l,x,V[o+5],21,-57434055);x=md5_ii(x,I,i,l,V[o+12],6,1700485571);l=md5_ii(l,x,I,i,V[o+3],10,-1894986606);i=md5_ii(i,l,x,I,V[o+10],15,-1051523);I=md5_ii(I,i,l,x,V[o+1],21,-2054922799);x=md5_ii(x,I,i,l,V[o+8],6,1873313359);l=md5_ii(l,x,I,i,V[o+15],10,-30611744);i=md5_ii(i,l,x,I,V[o+6],15,-1560198380);I=md5_ii(I,i,l,x,V[o+13],21,1309151649);x=md5_ii(x,I,i,l,V[o+4],6,-145523070);l=md5_ii(l,x,I,i,V[o+11],10,-1120210379);i=md5_ii(i,l,x,I,V[o+2],15,718787259);I=md5_ii(I,i,l,x,V[o+9],21,-343485551);x=safe_add(x,O);I=safe_add(I,c);i=safe_add(i,C);l=safe_add(l,v)}
return Array(x,I,i,l)}
function md5_cmn(O,I,i,l,o,c){return safe_add(bit_rol(safe_add(safe_add(I,O),safe_add(l,c)),o),i)}
function md5_ff(c,I,i,l,o,O,C){return md5_cmn((I&i)|((~I)&l),c,I,o,O,C)}
function md5_gg(c,I,i,l,o,O,C){return md5_cmn((I&l)|(i&(~l)),c,I,o,O,C)}
function md5_hh(c,I,i,l,o,O,C){return md5_cmn(I^i^l,c,I,o,O,C)}
function md5_ii(c,I,i,l,o,O,C){return md5_cmn(i^(I|(~l)),c,I,o,O,C)}
function core_hmac_md5(O,C){var c=str2binl(O);if(c.length>16)c=core_md5(c,O.length*chrsz);var I=Array(16),i=Array(16);for(var l=0;l<16;l++){I[l]=c[l]^0x36363636;i[l]=c[l]^0x5C5C5C5C}
var o=core_md5(I.concat(str2binl(C)),512+C.length*chrsz);return core_md5(i.concat(o),512+128)}
function safe_add(i,o){var l=(i&0xFFFF)+(o&0xFFFF),I=(i>>16)+(o>>16)+(l>>16);return(I<<16)|(l&0xFFFF)}
function bit_rol(i,I){return(i<<I)|(i>>>(32-I))}
function str2binl(o){var l=Array(),I=(1<<chrsz)-1;for(var i=0;i<o.length*chrsz;i+=chrsz)l[i>>5]|=(o.charCodeAt(i/chrsz)&I)<<(i%32);return l}
function binl2str(o){var l="",I=(1<<chrsz)-1;for(var i=0;i<o.length*32;i+=chrsz)l+=String.fromCharCode((o[i>>5]>>>(i%32))&I);return l}
function binl2hex(o){var l=hexcase?"0123456789ABCDEF":"0123456789abcdef",I="";for(var i=0;i<o.length*4;i++){I+=l.charAt((o[i>>2]>>((i%4)*8+4))&0xF)+l.charAt((o[i>>2]>>((i%4)*8))&0xF)}
return I}
function binl2b64(c){var O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I="";for(var i=0;i<c.length*4;i+=3){var l=(((c[i>>2]>>8*(i%4))&0xFF)<<16)|(((c[i+1>>2]>>8*((i+1)%4))&0xFF)<<8)|((c[i+2>>2]>>8*((i+2)%4))&0xFF);for(var o=0;o<4;o++){if(i*8+o*6>c.length*32)I+=b64pad;else I+=O.charAt((l>>6*(3-o))&0x3F)}}
return I}
function window_open(i,I){newWindow=window.open(i,I,"height=700,width=500");newWindow.focus()}
function is_radio_checked(I){for(i=0;i<I.length;i++)if(I[i].checked)return true;return false}
function validate_declaration(I){var i=document.declaration;if(i.surname.value==''){alert('Podaj nazwisko.');i.surname.focus();return false}else if(i.name.value==''){alert('Podaj imię.');i.name.focus();return false}else if(!is_id_number(i.id_number)){alert('Podaj prawidłowy numer i serię dowodu osobistego.');i.id_number.focus();return false}else if(!is_pesel(i.pesel)){alert('Podaj prawidłowy numer PESEL.');i.pesel.focus();return false}else if(i.birth_place.value==''){alert('Podaj miejsce urodzenia.');i.birth_place.focus();return false}else if(i.tel1.value.length+i.tel2.value.length<9){alert('Podaj prawidłowy numer telefonu w formacie XX XXXXXXX lub XXX XXXXXX.');i.tel1.focus();return false}else if(!is_em(i.email)){alert('Podaj prawidłowy adres e-mail.');i.email.focus();return false}else if(i.p_street.value==''){alert('Podaj ulicę.');i.p_street.focus();return false}else if(i.p_street_number.value==''&&i.p_local_number.value==''){alert('Podaj numer ulicy i/lub numer loklau.');i.p_street_number.focus();return false}else if(!is_postal_code(i.p_postal_code)){alert('Podaj prawidłowy kod pocztowy w formacie XX-XXX.');i.p_postal_code.focus();return false}else if(i.p_city.value==''){alert('Podaj miasto.');i.p_city.focus();return false}else if(i.delivery_time&&!is_radio_checked(i.delivery_time)){alert('Podaj godziny odbioru przesyłki.');i.delivery_time_1.focus();return false}else if(i.amount&&!is_currency(i.amount,parseInt(I))){alert('Podaj prawidłową kwotę inwestycji.');i.amount.focus();return false}else if(i.account_number&&!is_IBANAccount(i.account_number.value)){alert('Podaj prawidłowy numer konta bankowego w formacie NRB (26 cyfr).');i.account_number.focus();return false}else return true}
function validate_contact(){var i=document.contact;if(i.surname.value==''){alert('Podaj nazwisko.');i.surname.focus();return false}else if(i.name.value==''){alert('Podaj imię.');i.name.focus();return false}else if(i.tel1.value.length+i.tel2.value.length<9){alert('Podaj prawidłowy numer telefonu w formacie XX XXXXXXX lub XXX XXXXXX.');i.tel1.focus();return false}else if(!is_em(i.email)){alert('Podaj prawidłowy adres e-mail.');i.email.focus();return false}else if(i.city.value==''){alert('Podaj miasto.');i.city.focus();return false}else if(i.content.value==''){alert('Podaj treść zapytania.');i.content.focus();return false}else if(!i.agree_contact.checked){alert('Aby wysłać zapytanie, należy zaakceptować warunki.');i.agree_contact.focus();return false}else if(!i.agree_contact2.checked){alert('Aby wysłać zapytanie, należy zaakceptować warunki.');i.agree_contact2.focus();return false}else return true}
function validate_sal(){var i=document.declaration;if(i.surname.value==''){alert('Podaj nazwisko.');i.surname.focus();return false}else if(i.name.value==''){alert('Podaj imię.');i.name.focus();return false}else if(!is_pesel(i.pesel)){alert('Podaj numer PESEL.');i.pesel.focus();return false}else if(!is_decimal(i.participation)){alert('Podaj procentowy udział w uposażeniu. Suma musi być równa 100%.');i.participation.focus();return false}else if(i.street.value==''){alert('Podaj ulicę.');i.street.focus();return false}else if(i.street_number.value==''&&i.local_number.value==''){alert('Podaj numer ulicy i/lub numer loklau.');i.street_number.focus();return false}else if(!is_postal_code(i.postal_code)){alert('Podaj prawidłowy kod pocztowy w formacie XX-XXX.');i.postal_code.focus();return false}else if(i.city.value==''){alert('Podaj miasto.');i.city.focus();return false}else return true}
function mod97(l){var I=0;var i=[];var O=[];i[1]=1;O[1]=parseInt(l.substring(29,30));I=i[1]*O[1];for(var o=2;o<=30;o+=1){i[o]=(i[o-1]*10)%97;O[o]=parseInt(l.substring(30-o,30-o+1));I=I+i[o]*O[o]}
return(I%97)}
function validate_agreement(){var i=document.declaration;al='Aby wysłać deklarację, należy zaakceptować warunki.';if(i.agree&&!i.agree.checked){alert(al);i.agree.focus();return false}
if(i.agree2&&!i.agree2.checked){alert(al);i.agree2.focus();return false}
if(i.agree3&&!i.agree3.checked){alert(al);i.agree3.focus();return false}else return true}
function is_postal_code(l){var i=l.value,I=/^[0-9]{2}-[0-9]{3}$/;if(i.match(I))return true;else return false}
function checkSum(i){if(i.length==26)i="PL"+i;country=i.substring(0,2);cc=i.substring(2,4);rest=i.substring(4,28);base=replaceAlpha(rest+country+cc);if(mod97(base)==1)return true;else
return false}
function replaceAlpha(I){I=I.toUpperCase();var i="";for(var l=0;l<I.length;l++)i+=(I.charCodeAt(l)>=65?Number(I.charCodeAt(l)-55):I.charAt(l));return(i)}
function is_IBANAccount(l){var i=/\d{26}/,I=/[a-zA-Z]{2}\d{26}/ig;if(l.match(i))return checkSum(l);return false}

function is_nip(str)
{
	str = str.replace(/[^0-9]+/g,"");
	if (str.length != 10)
	{
		return false;
	}
	var arrSteps = new Array(6, 5, 7, 2, 3, 4, 5, 6, 7);
	var intSum=0;	
	for (var i = 0; i < 9; i++)
	{
		intSum += arrSteps[i] * parseInt(str.charAt(i));
	}
	var int = intSum % 11;
	
	var intControlNr = (int == 10) ? 0 : int;
	
	if (intControlNr == parseInt(str.charAt(9)))
	{
		return true;
	}
	return false;
}


//function is_nip(l){var i=l,I=/^(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3})|(\d{10})$/;if(i.match(I))return true;else return false}
function is_pesel(l){var i=l.value,I=/^[0-9]{11}$/;if(i.match(I))return true;else return false}
function is_decimal(l){var i=l.value,I=/^[0-9]+$/;if(i.match(I))return true;else return false}
function is_id_number(l){var i=l.value,I=/^[a-zA-Z]{3}[0-9]{6}$/;if(i.match(I))return true;else return false}
function is_currency(i,o){var l=i.value,I=/(^\d+$)|(^\d+\.\d+$)|(^\d+\,\d+$)/;if(l.match(I)&&(parseInt(l)>=parseInt(o)))return true;else return false}
function txt_update(l){var i=document.getElementById("p_"+l),I=document.getElementById("s_"+l);if(i.value&&!I.value)I.value=i.value}
function white_space(i){var I=document.getElementById(i);I.value=(I.value).replace(/\s*/g,'')}
