function validateCreateStream()
{
 
   if(document.createStream.title.value== null || document.createStream.title.value=='' )
   {
     alert(" Title Required ");
     return false;
   }else
     if(document.createStream.duration.value== null || document.createStream.duration.value=='' )
   {
     alert(" Duration Required ");
     return false;
   }else
     if(document.createStream.duration.value <5)
	   	{
	       document.createStream.duration.value="5";
	       alert('Minimum 5 minutes Allowed: ');
	       return false;
	   } 
	   else
	   if(document.createStream.duration.value >720)
	   	{
	       document.createStream.duration.value="720";
	       alert('Maximum 720 minutes Allowed: ');
	       return false;
	   } 
     
    document.createStream.submit();
 
  }

  

	
	function IsNumeric(cut){
	 
	  var sText=document.createStream.amount.value;
	     if(!valid(cut))
	   {
	      cut=0;
	    
	      }
	  
	   if(!valid(sText))
	   {
	       document.createStream.amount.value=0;
	       alert('Invalid value ');
	   }  else
	   {
	    document.createStream.total.value=Number(sText)+ ((Number(sText)*cut))/100;
	  
	   } 
   }
   
   
   	function isNumber()
	{
  	 var sText=document.createStream.duration.value;
	   	if(!valid(sText))
	   	{
	       document.createStream.duration.value="5";
	       alert('Integer Value is required: ');
	       return;
	   } 

	   
	  
   }
   
   function valid(sText)
   {
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
	     if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
    return IsNumber;
   
   }
  
  
  
  function changeValue(textfield,checkbox) {
	
	if (document.getElementById(checkbox).value == '1') {
	document.getElementById(textfield).style.display = 'none';
	document.getElementById(checkbox).value="0";
	}else
	if (document.getElementById(checkbox).value == '0') {
	document.getElementById(textfield).style.display = 'block';
	document.getElementById(checkbox).value="1";


	}

	}

  function toggleCheckBox(textfield,checkbox) {
	
	if (document.getElementById(checkbox).value == '0') {
	document.getElementById(textfield).style.display = 'none';
	document.getElementById(checkbox).checked=false;
	
	}else
	if (document.getElementById(checkbox).value == '1') {
	document.getElementById(textfield).style.display = 'block';
	document.getElementById(checkbox).checked=true;
 	}

}

  
  
  
  
