/**********************************************************************************************************************
**********************************************************************************************************************

function 	: 	Nyiombo
parameter	:	NO parameter
date		:	16 July 2009
Objective	:	display Nyiombo Detail Information

**********************************************************************************************************************
**********************************************************************************************************************/

pubdetail = function(id)
{ 	
	var formstr = '<table width="100%"><tr><td valign="top"><div id = "another"></div></td></tr></table>';
		
		var url = "guru-pub-details.php?id="+id;
		var xmlHttp;
        if(window.XMLHttpRequest)
        { 
              // Firefox, Opera 8.0+, Safari
               xmlHttp=new XMLHttpRequest(); 
        }
        else if(window.ActiveXObject)
        {
               // Internet Explorer
               xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");     
        }
        else
        {
              alert("Your browser does not support AJAX!");
              return false; 
        }
        xmlHttp.onreadystatechange=function()
        {

              if(xmlHttp.readyState==4)
              {
					if(xmlHttp.status == 200)
					{
						document.getElementById("another").innerHTML=  xmlHttp.responseText ;
					}
			  }
		}
        xmlHttp.open("Get",url,true);
        xmlHttp.send(null);   

		jqistates = {
				state0: {
				html: formstr,
				focus: 1,				
				buttons: { Close: false },
				submit: function(v, m, f){
					var e = "";
					m.find('.errorBlock').hide('fast',function(){ jQuery(this).remove(); });
				}
			},
			state1: {
				html: 'Monthly Payment: $<span id="intmonthlypayment"></span>',
				focus: 1,
				buttons: { Back: false, Done: true },
				submit: function(v,m,f){
					if(v)
						return true;
					jQuery.ImpromptuGoToState('state0');
					return false;
				}
			}
		};
		
		$.prompt(jqistates);
}


validate = function(id) {
	var eid = "e" + id;
	var val = document.getElementById(id).value;
	
	document.getElementById(eid).style.display = "block";
	if(id != "txtFromEmail") {
		if(val == "")
			document.getElementById(eid).src = "images/no.gif";
		else
			document.getElementById(eid).src = "images/yes.gif";
	} else {
				if(document.getElementById(id).value.indexOf("@")==-1 ||document.getElementById(id).value.indexOf(".")==-1 || document.getElementById(id).value.indexOf("")==-1 ) {
					document.getElementById(eid).src = "images/no.gif";
					document.getElementById(id).focus();
			    }
				else 
					document.getElementById(eid).src = "images/yes.gif";
	}
}

auditdetail = function(id)
{ 	

	var formstr = '<table width="100%"><tr><td valign="top"><div id = "another"></div></td></tr></table>';
		
		var url = "guru-auditform.php?keepThis=true&TB_iframe=true&height=490&width=500";
		var xmlHttp;
        if(window.XMLHttpRequest)
        { 
              // Firefox, Opera 8.0+, Safari
               xmlHttp=new XMLHttpRequest(); 
        }
        else if(window.ActiveXObject)
        {
               // Internet Explorer
               xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");     
        }
        else
        {
              alert("Your browser does not support AJAX!");
              return false; 
        }
        xmlHttp.onreadystatechange=function()
        {

              if(xmlHttp.readyState==4)
              {
					if(xmlHttp.status == 200)
					{
						document.getElementById("another").innerHTML=  xmlHttp.responseText ;
					}
			  }
		}
        xmlHttp.open("Get",url,true);
        xmlHttp.send(null);   

		jqistates = {
				state0: {
				html: formstr,
				focus: 1,				
				buttons: { Close: false },
				submit: function(v, m, f){
					var e = "";
					m.find('.errorBlock').hide('fast',function(){ jQuery(this).remove(); });
				}
			},
			state1: {
				html: 'Monthly Payment: $<span id="intmonthlypayment"></span>',
				focus: 1,
				buttons: { Back: false, Done: true },
				submit: function(v,m,f){
					if(v)
						return true;
					jQuery.ImpromptuGoToState('state0');
					return false;
				}
			}
		};
		
		$.prompt(jqistates);
}


