function showDiv()
{
	//$('spinner_div').style.visibility='visible';	
	//$('spinner_div').style.display='block';	
}

function hideDiv()
{
	//$('spinner_div').style.visibility='hidden';	
	//$('spinner_div').style.display='none';	
}

function request_quote()
{

		alert('here');
		
		
		
		//alert(docuument.Form[0].value);
		
		
	
//		var params;
//		for(i=0; i<document.FormName.elements.length; i++)
//		{
//		   var fieldName = document.FormName.elements[i].name;
//		   var fieldValue = document.FormName.elements[i].value;
//		
//		   // use the fields, put them in a array, etc.
//		
//		   // or, add them to a key-value pair strings, 
//		   // as in regular POST
//		
//		   params += fieldName + '=' + fieldValue + '&';
//		}

		
		
		//alert(firstname)
//		formvalue.action = url;
//  		formvalue.submit();
	   // var pars ='rank='+rank+'&product_id='+product_id;
//	    var target = 'targetDiv';
//	   //alert(target);
//	    var myAjax = new Ajax.Updater(target, url, {evalScripts:'true',method: 'post'});
	   		
	
	
}

function show_products(val)
{

		
		
		
		var r = Math.random();
		
		var theForm=document.getElementById("frmedit_product");

		
		product_id=val;
		
		
		
		//var url = 'http://localhost:8080/golfpromo'+'/admin/edit_products/'+product_id; 
		var url = 'http://technical27:8080/golfpromo'+'/admin/edit_products/'+product_id; 
		//alert(url);
	  
	   
	    theForm.action = url;
  		theForm.submit();

	   
	   // var myAjax = new Ajax.Updater(target, url, {evalScripts:'true',method: 'post', parameters: pars});
	   		
	
	
}


function show_home_products(val)
{

		
		
		
		var r = Math.random();
		
		var theForm=document.getElementById("frmshow_product");

		
		product_id=val;
		
		
		//var url = 'http://localhost:8080/golfpromo'+'/admin/edit_products/'+product_id; 
		var url = 'http://technical27:8080/golfpromo'+'/site/show_products/'+product_id; 
		//alert(url);
	  
	   
	    theForm.action = url;
  		theForm.submit();

	   
	   // var myAjax = new Ajax.Updater(target, url, {evalScripts:'true',method: 'post', parameters: pars});
	   		
	
	
}




function move_products_up(application_name,rank, product_id)
{

		
		
		//alert(application_name);
		var r = Math.random();
		
		//product_id=id;
		//alert(product_id);
		///var url = $('root_path').value+'orders/validate_order'; 
		var url = application_name+'admin/move_product_up/'; 
		//alert(url);
	    var pars ='rank='+rank+'&product_id='+product_id;
	   
	    var target = 'productlisting';
	   //alert(target);
	    var myAjax = new Ajax.Updater(target, url, {evalScripts:'true',method: 'post', parameters: pars});
	   		
	
	
}
function hid_inc(j)
{
	//alert(j);
	$('hid').innerHTML='<input type="hidden" name="data[order][i]" value="'+j+'" id="i" >';
}

// Removes leading whitespaces
function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) {
	
	return LTrim(RTrim(value));
	
}
