function printDetail(obj,prodid,baseurl){
	var ajaxRequest; // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	}catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
	try{
		ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}catch (e){
		// Something went wrong
		alert("Your browser broke!");
	return false;
	}
	}
}


// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('ajaxdiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;



}
}

//if(document.userform.username)
//var datevent = document.getElementById('dp-normal-1').value;
//var queryString = "fetchevents.php?date=" + datevent;
//my_window=window.open (queryString,"mywindow1","status=0,scrollbars=1,resizable=1,toolbar =0,menubar=0,width=500,height=400");
var aantal=obj.value;
var prodid = prodid;

//alert(aantal);
var queryString = baseurl+"helloworld?aantal=" +aantal + "&prodid=" + prodid;

ajaxRequest.open("GET",queryString, true);
ajaxRequest.send(null);
//alert(queryString);
}

//-->


function printDetailNoncust(prodId,container){

	var ajaxRequest; // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	}catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
	try{
		ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}catch (e){
		// Something went wrong
		alert("Your browser broke!");
	return false;
	}
	}
}


// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
//alert(ajaxRequest.responseText);
var ajaxDisplay = document.getElementById('ajaxDiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;



}
}

//if(document.userform.username)
//var datevent = document.getElementById('dp-normal-1').value;
//var queryString = "fetchevents.php?date=" + datevent;
//my_window=window.open (queryString,"mywindow1","status=0,scrollbars=1,resizable=1,toolbar =0,menubar=0,width=500,height=400");
var prodId=prodId;
var container=container;
//alert(aantal);
var queryString = "http://localhost/cmagento/sportsatwork/index.php/event_eng/helloworld?prodId=" + prodId + "&container=" + container;

ajaxRequest.open("GET",queryString, true);
ajaxRequest.send(null);
//alert(queryString);
}

//-->





function change_option_yes(urlbase,prodid){

	var ajaxRequest; // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	}catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
	try{
		ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}catch (e){
		// Something went wrong
		alert("Your browser broke!");
	return false;
	}
	}
}


// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('dropDiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;



}
}

//if(document.userform.username)
//var datevent = document.getElementById('dp-normal-1').value;
//var queryString = "fetchevents.php?date=" + datevent;
//my_window=window.open (queryString,"mywindow1","status=0,scrollbars=1,resizable=1,toolbar =0,menubar=0,width=500,height=400");
var urlbase=urlbase;
var prodid=prodid;

//alert(minqty);
var queryString = urlbase+"helloworld?minqty=5"+"&prodid=" + prodid;

ajaxRequest.open("GET",queryString, true);
ajaxRequest.send(null);
//alert(queryString);
}

/* Sirvash Sharma: number validation start here */

function isInteger(elemId)
{
      var count = 2;
      
      var currentId = 'number_'+elemId;
      
      var tex = document.getElementById(currentId).value
      
      var len = tex.length;
      
      if(len > count){
            
                  tex = tex.substring(0,count);
                  document.getElementById(currentId).value =tex;
      }
      
      var i;
      s = tex.toString();
            
      for (i = 0; i < s.length; i++)
      {
      	  var c = s.charAt(i);
      	  if (isNaN(c)) 
      	  {
      		document.getElementById(currentId).value ='00';
      	  }
      		   
      }
}

function limiter(elemId){

	var count = 15;

	var currentId = 'userfont_'+elemId;
	
	var tex = document.getElementById(currentId).value

	var len = tex.length;
	
	if(len > count){

			tex = tex.substring(0,count);
			document.getElementById(currentId).value =tex;

	}

}

/*
function validation(aantal){
	
	var i;
	for (i = 0; i < aantal; i++){
	    var number = document.getElementById('number_'+i).value;
	    if(number == ''){
	       	document.getElementById('hiddenMsg').style.display = 'block';
	    	return false;
	    }
	
	
	}
	return true;
}
*/

function validation(aantal){
	
	var i;
	for (i = 0; i < aantal; i++){
	    var number = document.getElementById('number_'+i).value;
	    var namm = document.getElementById('userfont_'+i).value;
	    var count = i+1;
	    if(number == '' && namm == ''){
	       	document.getElementById('hiddenMsg').style.display = 'block';
	       	document.getElementById('hiddenMsg').innerHTML = 'ten minste een veld is vereist op lijn nr.' + count;
	    	return false;
	    }
	}
	return true;
}


/* Sirvash Sharma: number validation end here */
//-->


function dropdown_display()
{document.getElementById('qty').style.display='';
document.getElementById('options_no').style.display='none';
}
function dropdown_display_none()
{document.getElementById('qty').style.display='none';document.getElementById('options_no').style.display='';
var e = document.getElementById("qty");
var strUser = e.options[e.selectedIndex].text;
var ev = document.getElementById("options_no");
 ev.options[0].text=strUser;
//document.myform.options_no.options[0].text=strUser;
//document.getElementById("qty_value").innerHTML=strUser;
}
/*
function dropdown_display()
{
document.getElementById('options').style.display='';
document.getElementById('options_no').style.display='none';
}
function dropdown_display_none()
{
document.getElementById('options').style.display='none';
document.getElementById('options_no').style.display='';
var e = document.getElementById("options");
var strUser = e.options[e.selectedIndex].text;
document.myform.options_no.options[0].text=strUser;
 //document.getElementById("options_no").options[0].text=strUser;
}
*/
