function bookmarkjsold() {
   	var txt = 'Bookmark Us!'
	var url = 'http://192.10.10.216/certexpress';
	var who = 'Recognition clicks';

	var ver = navigator.appName
	var num = parseInt(navigator.appVersion)
	if ((ver == 'Microsoft Internet Explorer')&&(num >= 4)) {
   		window.external.AddFavorite(url,who);

	}else{
   		txt += '  (Ctrl+D)'
        	alert(txt);
	}
    }

function bookmarkjs(){
if (document.all) {
   var url=document.location.toString();
   var title=document.title;
   window.external.AddFavorite(url,title)
} else if (window.sidebar){
  var url=document.location.toString();
    var title=document.title;
    window.sidebar.addPanel(title, url, "")
 }
}

function update_status(mode,fid,path) {
	var url='';
	if(path)path=path+'/';

	url = path+'dynamic.php?mode=' +mode+'&formid='+fid+ '&rand=' + Math.random();



					// code for Mozilla, etc.
					if (window.XMLHttpRequest){
						xmlhttp = new XMLHttpRequest();
						xmlhttp.open("GET",url,true)
						if(mode=='bookmark') xmlhttp.onreadystatechange=book;
						xmlhttp.send(null);
					}
				// code for IE
					else if (window.ActiveXObject){
						xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
						if (xmlhttp){
							xmlhttp.open("GET",url,true)
							if(mode=='bookmark') xmlhttp.onreadystatechange=book;
							xmlhttp.send();
						}
					}

			}

function bookmark(id,path){

	update_status('bookmark',id,path);


}

function book() {
	if (xmlhttp.readyState == 4) {
	//var response = xmlhttp.responseText;alert(response);
	//alert('reached here');
		bookmarkjs();

	}
}

function trim(s) {

  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}

/**
* open normal window
*/
function openUrl(url, name, w, h, scroll) {

	LeftPosition	= (screen.width)?(screen.width-w)/2:100;
	TopPosition		= (screen.height)?(screen.height-h)/2:100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	window.open(url, name, settings);
}

function validateEmail(frm)
	{
	var email=frm.txtEmail.value;

	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))){
			alert("Please enter a valid email address") ;
			return false ;
	}


 }


