function tranpagelinknews1(page,first,last,click,bot)
{


	url='ajax-tran-page-link.php?page='
	url +=+page
	url += '&';
	url += 'first=';
	url +=+first;
	url += '&';
	url += 'last=';
	url +=+last;
	url += '&';
	url += 'click=';
	url +=+click;
	url += '&';
	url += 'bot=';
	url +=+bot;

	javascript:void(0);
	new Ajax.Updater('main-right-news',url );
}

function getarticle(id)
{

	javascript:void(0);
	new Ajax.Updater('news_body','ajax-get-article.php?id='+id );
}

function getjob(id)
{

	javascript:void(0);
	new Ajax.Updater('job_body','ajax-get-job.php?id='+id );
}

function tranpagelinknews2(from,page,first,last,click,bot,search_vars)
{


	url='ajax-tran-page-archive-link.php?page='
	url +=+page
	url += '&';
	url += 'first=';
	url +=+first;
	url += '&';
	url += 'last=';
	url +=+last;
	url += '&';
	url += 'click=';
	url +=+click;
	url += '&';
	url += 'from=';
	url =url+from;
	url += '&';
	url += 'bot=';
	url +=+bot;
	url += '&';
	url += 'search_vars=';
	url =url+search_vars;


	javascript:void(0);
	new Ajax.Updater('main-full',url );
}

function search_news(form)
{

	var select=form.select.options[form.select.selectedIndex].value
	var exp=form.exp.value;
	if (select == 'Select' || exp == 'Any Words')
	{
		alert('Please select the search field and enter the search expression')
	}else{
		url='ajax-search-archive.php?select='
		url =url+select
		url += '&';
		url += 'exp=';
		url =url+exp;

		//alert(select+'-'+exp);
			
		javascript:void(0);
		new Ajax.Updater('main-full', url);
	}
	
}

function centerElement(elem) {
    var intH = 0, intW = 0;
    
    if(self.innerHeight) {
       intH = window.innerHeight;
       intW = window.innerWidth;
    } 
    else {
        if(document.documentElement && document.documentElement.clientHeight) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else {
            if(document.body) {
                intH = document.body.clientHeight;
                intW = document.body.clientWidth;
            }
        }
    }
//alert (intH+'='+intW);
    var scrollY = 0;

scrollY += document.body.parentNode.scrollTop;
//alert ('3='+scrollY)


    var left = Math.round(intW  / 2)-390;
    var top = Math.round(intH  / 2)-350+scrollY;
//alert(left+'='+top);
    document.getElementById(elem).style.left = left + 'px';
    document.getElementById(elem).style.top = top + 'px';

   "viewport = left = top = ele = null;"
    
}

function showshoppinginfo(id,type) {
//alert(id);
    // Process HTTP response and update input form
    centerElement("shoppinginfoWaiting");
    document.getElementById("shoppinginfoWaiting").className = "shoppinginfowaitingshow";
    centerElement("shoppinginfo");

     // next row it should be after saving item on cart
    document.getElementById("shoppinginfoWaiting").className = "shoppinginfowaitinghide";
    document.getElementById("shoppinginfo").className="shoppinginfoShow";
    	make_table_detail(id,type);

}

function showshoppinginfoFailure() {
    // Process HTTP response and update input form
   document.getElementById("basketWaiting").className = "shoppinginfowaitinghide";
   alert("Problem: " + transport.statusText);
}

function hideshoppinginfo(){
  document.getElementById("shoppinginfo").className="shoppinginfoHide";
}

function make_table_detail(id,type)
{
	url='ajax-make_detail_table.php?id='
	url =url+id
	url += '&';
	url += 'type=';
	url =url+type;
	//alert(type+id)	
	javascript:void(0);
	new Ajax.Updater('shoppinginfo', url);
}

function updatecart()
{
//alert('update')
	javascript:void(0);
	new Ajax.Updater('main-full', 'ajax_update_cart.php');
}

function saveqty(ref,qty_name)
{
	//alert(qty_name)
	var qty=document.getElementById(qty_name).value

	url='ajax_update_http_item_qty.php?qty='
	url =url+qty
	url += '&';
	url += 'ref=';
	url =url+ref;
	
	//alert(url)

	javascript:void(0);
	new Ajax.Updater('', url);

}

function deleteitem(ref)
{
	
	url='ajax_delete_http_item.php?ref='
	url =url+ref;


	javascript:void(0);
	new Ajax.Updater('main-full', url);

}

function sortprice(form)
{
	var sort_by=form.sort_price.options[form.sort_price.selectedIndex].value
	//alert(sort_by);

	url='ajax_sort_file_by_price.php?sort_by='
	url =url+sort_by;


	javascript:void(0);
	new Ajax.Updater('show_file', url);

}

function firstselection(form)
{
	var first_selection=form.events_search.options[form.events_search.selectedIndex].value
	//alert(first_selection);

	url='ajax-search-events-form2.php?first_selection='
	url =url+first_selection;


	javascript:void(0);
	new Ajax.Updater('second_select', url);

}

function swsearch(form,first)
{
	//alert(form+'-'+first);

	if(first == 'Location' )
	{

		var second_selection=form.events_search2.options[form.events_search2.selectedIndex].value
		//alert(second_selection);

		url='ajax-search-events.php?second_selection='
		url =url+second_selection;
		url += '&';
		url += 'first=';
		url =url+first;
	}

	if( first == 'Type')
	{

		var second_selection=form.events_search2.options[form.events_search2.selectedIndex].value
		//alert(second_selection);

		url='ajax-search-events.php?second_selection='
		url =url+second_selection;
		url += '&';
		url += 'first=';
		url =url+first;
	}

	if( first == 'Reference')
	{

		var second_selection=document.getElementById(form).value;
		//alert(second_selection);

		url='ajax-search-events.php?second_selection='
		url =url+second_selection;
		url += '&';
		url += 'first=';
		url =url+first;
	}




	javascript:void(0);
	new Ajax.Updater('main-full', url);
}

function tranpagelinknews3(from,page,first,last,click,bot,search_vars)
{


	url='ajax-tran-page-event-link.php?page='
	url +=+page
	url += '&';
	url += 'first=';
	url +=+first;
	url += '&';
	url += 'last=';
	url +=+last;
	url += '&';
	url += 'click=';
	url +=+click;
	url += '&';
	url += 'from=';
	url =url+from;
	url += '&';
	url += 'bot=';
	url +=+bot;
	url += '&';
	url += 'search_vars=';
	url =url+search_vars;


	javascript:void(0);
	new Ajax.Updater('main-full',url );
}

function tranpagelinknews4(from,page,first,last,click,bot,search_vars)
{


	url='ajax-tran-page-download-link.php?page='
	url +=+page
	url += '&';
	url += 'first=';
	url +=+first;
	url += '&';
	url += 'last=';
	url +=+last;
	url += '&';
	url += 'click=';
	url +=+click;
	url += '&';
	url += 'from=';
	url =url+from;
	url += '&';
	url += 'bot=';
	url +=+bot;
	url += '&';
	url += 'search_vars=';
	url =url+search_vars;


	javascript:void(0);
	new Ajax.Updater('show_file',url );
}

function saveorder()
{
	//alert('pp');
	url='ajax_save_order.php';
	javascript:void(0);
	new Ajax.Updater('', url);

return true
}

function addpcode()
{
	var p_code=document.getElementById('p_code').value;
	//alert(p_code);
	javascript:void(0);
	new Ajax.Updater('main-full', 'ajax_update_cart.php?p_code='+p_code);

}
