
function submitStepWithInputHidden(step,hiddenName){
    form = document.getElementById(step);
   
    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hiddenName);
    input.setAttribute("id", hiddenName);
    input.setAttribute("value", hiddenName);
    form.appendChild(input);

    form.submit();
}
function submitStepWithInputHiddenAndValue(step,hiddenName, value){

 form = document.getElementById(step);
   
    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hiddenName);
    input.setAttribute("id", hiddenName);
    input.setAttribute("value", value);
    form.appendChild(input);

    form.submit();
}
function submitDoubleStepWithInputHidden(step1,step2,hiddenName){
    form = document.getElementById(step2);
   
    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hiddenName);
    input.setAttribute("id", hiddenName);
    input.setAttribute("value", hiddenName);
    form.appendChild(input);
	
	document.getElementById(step1).submit();
    document.getElementById(step2).submit();
    return false;
}

function submitStepWithDoubleInputHidden(step,hiddenName, hiddenName2, hiddenName2Value){
    form = document.getElementById(step);
   
    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hiddenName);
    input.setAttribute("id", hiddenName);
    input.setAttribute("value", hiddenName);
    form.appendChild(input);
	
	var input2 = document.createElement("input");
    input2.setAttribute("type", "hidden");
    input2.setAttribute("name", hiddenName2);
    input2.setAttribute("id", hiddenName2);
    input2.setAttribute("value", hiddenName2Value);
    form.appendChild(input2);
	
	
    form.submit();
}
function submitStepWithDoubleInputHiddenAndValues(step,hiddenName,hiddenNameValue, hiddenName2, hiddenName2Value){
    form = document.getElementById(step);
   
    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hiddenName);
    input.setAttribute("id", hiddenName);
    input.setAttribute("value", hiddenNameValue);
    form.appendChild(input);
	
	var input2 = document.createElement("input");
    input2.setAttribute("type", "hidden");
    input2.setAttribute("name", hiddenName2);
    input2.setAttribute("id", hiddenName2);
    input2.setAttribute("value", hiddenName2Value);
    form.appendChild(input2);
	
	
    form.submit();
}

function submitDoubleStep(step1,step2){
    document.getElementById(step1).submit();
    document.getElementById(step2).submit();
    return false;
}

function submitStep(step1){
    document.getElementById(step1).submit();
    return false;
}

function show_hide(what){
	var element = document.getElementById(what);
	if(element.style.display == 'none'){
		element.style.display = '';
	}else{
		element.style.display = 'none';
	}
}
function hide(what){
	var element = document.getElementById(what);
	
	element.style.display = 'none';
	
}

function change_bg_des(what){
	var element = document.getElementById(what);
	var a = element.src;
	var b = a.indexOf(what+"_over");
	if(b == -1){
		element.src = baseURL+'assets/images/'+what+'_over.png';
		
	}else{
		element.src = baseURL+'assets/images/'+what+'.png';
	}
}

function change_bg_def(what){
	var element = document.getElementById(what);
	element.src = baseURL+'assets/images/'+what+'.png';
}

function submitDoubleStepWithInputHiddenAndValue(step1,hiddenName1, value1,step2,hiddenName2, value2){
    form = document.getElementById(step1);
   
    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hiddenName1);
    input.setAttribute("id", hiddenName1);
    input.setAttribute("value", value1);
    form.appendChild(input);
	
	document.getElementById(step1).submit();
	
	form2 = document.getElementById(step2);
   
    var input2 = document.createElement("input");
    input2.setAttribute("type", "hidden");
    input2.setAttribute("name", hiddenName2);
    input2.setAttribute("id", hiddenName2);
    input2.setAttribute("value", value2);
    form2.appendChild(input2);
	
	
    document.getElementById(step2).submit();
    return false;
}

function changeNewsTab(side){
	var element = document.getElementById('home_news_tabs');
	
	if(side == 'left'){
		element.className  = 'news_newsletters_box';
		var image = document.getElementById('arrow_left');
		image.src = baseURL+'assets/images/down_arrow.png';
		
		var image2 = document.getElementById('arrow_right');
		image2.src = baseURL+'assets/images/up_arrow.png';
	}else{
		element.className  = 'news_newsletters_box_right';
		var image = document.getElementById('arrow_right');
		image.src = baseURL+'assets/images/down_arrow.png';
		
		var image2 = document.getElementById('arrow_left');
		image2.src = baseURL+'assets/images/up_arrow.png';
	}
	
}

function displayBlogText(blog_text,blog_text_full,read_more_id,hide_id){

	var element_text = document.getElementById(blog_text);
	var element_text_full = document.getElementById(blog_text_full);
	
	var read_more = document.getElementById(read_more_id);
	var hide = document.getElementById(hide_id);
	
	element_text.innerHTML = element_text_full.innerHTML ;
	read_more.style.display ='none' ;
	hide.style.display ='block' ;
	
	
}

function hiddenBlogText(blog_text,blog_text_short,read_more_id,hide_id){
	var element_text = document.getElementById(blog_text);
	var element_text_short = document.getElementById(blog_text_short);
	
	element_text.innerHTML = element_text_short.innerHTML;
	
	var read_more = document.getElementById(read_more_id);
	var hide = document.getElementById(hide_id);
	
	
	read_more.style.display ='block' ;
	hide.style.display ='none' ;
	
}

function activeLogin(){

	var login_button = document.getElementById('login_button');
	var login_form = document.getElementById('login_form_small');
	
	if(login_form.style.display == 'none'){
		login_form.style.display = 'block';
		login_button.src = baseURL+'assets/images/login_down.png';
	}else{
		login_form.style.display = 'none';
		login_button.src = baseURL+'assets/images/login_up.png';
	}
	
}
