function WindowPopUp(){
	window.open("","","");
}

function URLEncode(){
	escape('');
}

function URLDecode(){
	unescape('');
}
	
function formatT(secs){
   var times = new Array(3600, 60, 1);
   var time = '';
   var tmp;
   for(var i = 0; i < times.length; i++){
      tmp = Math.floor(secs / times[i]);
      if(tmp < 1){
         tmp = '00';
      }
      else if(tmp < 10){
         tmp = '0' + tmp;
      }
      time += tmp;
      if(i < 2){
         time += ':';
      }
      secs = secs % times[i];
   }
   return time;
}

function formatTime(sec){
	var time = '';
	secs = parseInt(sec);
	var hours = timeZero(Math.floor(secs/3600));
	var minutes = timeZero(Math.floor((secs%3600)/60));
	var seconds = timeZero((secs%3600)%60);
	
	if (hours > 0) {
		time = hours + ":" + minutes + ":" + seconds;
	}
	else if (hours < 1) {
		time = minutes + ":" + seconds;
	}
	return time;
}

function timeZero(num) {
	num = num + "";
	if(num.length==1) {
		num="0" + num;
   }
   return num;   
}

$(document).ready(function() {
	$(".validateForm").submit(function() {
		$('.validateForm select, .validateForm input').each(function() {
			if ($(this).val() == "" || $(this).val() == undefined || $(this).val() == "Keywords...") { 
				$(this).removeAttr('name');
				$(this).attr('disabled', 'disabled');
			}	
  		});
    	});
});
