// JavaScript Document//clear text box on click
function clearText(field){

if (field.defaultValue == field.value) field.value = '';
else if (field.value == '') field.value = field.defaultValue;

}


// FULL BG
$(document).ready(function() {
          $("#triquibackimg").load(function(){
               resize_bg();
          })
          $(window).resize(function(){
               resize_bg();
          })
          function resize_bg(){
               $("#triquibackimg").css("left","0");
               var doc_width = $(window).width();
               var doc_height = $(window).height();
               var image_width = $("#triquibackimg").width();
               var image_height = $("#triquibackimg").height();
               var image_ratio = image_width/image_height;      
               var new_width = doc_width;
               var new_height = Math.round(new_width/image_ratio);
			   var width_offset = Math.round((new_width-doc_width)/2);
			   var height_offset = Math.round((new_height-doc_height)/2);
               if(new_width<1024 || new_height<768){
                    new_height = 768;
					new_width = 1024;
					width_offset = Math.round((new_width-doc_width)/2);
			        height_offset = Math.round((new_height-doc_height)/2);
				   if (doc_height>new_height) {
					   new_height = doc_height;
					   new_width = Math.round(new_height*image_ratio);
				   };
               }

               $("#triquibackimg").width(new_width);
               $("#triquibackimg").height(new_height);
			   //alert("height_offset = " + height_offset);
			   $("#triquibackimg").css("left","-"+width_offset+"px");
			   $("#triquibackimg").css("top","-"+height_offset+"px");
          }
		  resize_bg();
     });  
