<!--
/**
 * Performs a simple 'AJAX' style request to the local HTTP server
 * 
 * @param string method The HTTP method to use for the remote call (POST|GET)
 * @param string resource The resource URL relative to the webroot
 * @param function callback The callback method to execute, passing in response from the HTTP server
 * @return void 
 */
 
function SimpleAjaxGET( url, callback ) {

	     var xmlHttp;
         try {
               xmlHttp = new XMLHttpRequest();
         }
         catch( e ) {

                try {
                      xmlHttp = new ActiveXObject( 'Msxml2.XMLHTTP' );
                }
                catch( e ) {

		 		       try {
                             xmlHttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
                       }
                       catch( e ) {

						       alert( 'Your browser is not AJAX enabled and this site will not function properly without it.' );
                               return false;
                       }
                }
         }

         xmlHttp.onreadystatechange = function() {

 			         if( xmlHttp.readyState == 4 ) {

 			             var func;
	                     if( callback == undefined ) {
	
	                         alert( 'Must define callback method for SimpleAjaxGET request.' );
	                         return false;   
	                     }
	
	                     if( callback !== undefined )
	                         func = eval( callback );

  			         	 func( xmlHttp.responseText );
  			        }
		 }

         xmlHttp.open( 'GET', url );
         xmlHttp.send( null );
}
function getTestimonials() {

	          var url = 'index.php?c=Testimonial/getRecords&nocache=' + Math.floor( Math.random() * 9, true );
	          SimpleAjaxGET( url, getTestimonialsHandler );
}
function getTestimonialsHandler( result ) {

              document.getElementById( 'testimonials' ).innerHTML = result;
}
function jumpToCity() {

			  var view = document.getElementById( 'cities' ).value;
			  location.href = 'index.php?c=Index/getView&v=' + view;
}
function getView( view ) {

			  location.href = 'index.php?c=Index/getView&v=' + view;
}
function sizeWindow() {

			  var height = (((window.innerHeight) ? window.innerHeight : document.body.clientHeight ) -133 );
			  document.getElementById( 'content' ).style.minHeight = height + 'px';
}

function deleteConfirmation( url ) {

		  var desision = confirm( "Are you sure you want to delete this record?" );
		  
		  if( desision )
			  location.href = url;	  
} 
//-->
