function getPage(page){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object...
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = '/mpcs/precomment1.php?pageid='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + page, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
     //   alert(file + page);
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
        //alert(content);
                      document.getElementById('content').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}
function getPageComments(page){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object...
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = '/mpcs/text.php?pageid='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + page, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var nopages = xmlhttp.responseText; //The content data which has been retrieved ***
                if( nopages ){ //Make sure there is something in the content variable
                      document.getElementById('nopages').innerHTML = nopages; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
function saveComments(page){
  if (document.getElementById('name').value=="")
  {
  	alert("Please Enter a Name!");
  	document.getElementById('name').focus();
  	return true;
  }
  if (document.getElementById('email').value=="")
  {
  	alert("Please Enter an Email Address!");
  	document.getElementById('email').focus();
  	return true;
  }
  else
    	if (echeck(document.getElementById('email').value)==false)
        {
		document.getElementById('email').value="";
        document.getElementById('email').focus();
        return true;
	}

  if (document.getElementById('text_comment').value=="")
  {
  	alert("Please Enter a Comment!");
  	document.getElementById('text_comment').focus();
  	return true;
  }
  document.getElementById('Submit').value="Please Wait.";	
  
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object...
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = '/mpcs/test.php?pageid='; //This is the path to the file we just finished making *
  var data =  '&name=' + encodeURIComponent(document.getElementById('name').value)+'&email=' + encodeURIComponent(document.getElementById('email').value)+'&comment=' + encodeURIComponent(document.getElementById('text_comment').value);
 //alert(file+ page+data);
    xmlhttp.open('GET', file + page+data, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
 // alert(xmlhttp.readyState);
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
 //  alert(content);
               if( content ){ //Make sure there is something in the content variable
 //  alert(content);
//  document.getElementById('Submit').set("label", "<b>Thank You</b>");	
 // document.getElementById('Submit').value="<b>Thank You....</b>";	
                      document.getElementById('content').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}
function processIt(type,page){
 //alert("processIt type:"+ type+"page:"+ page);
 if (type==1)
 {
 if (document.getElementById('user').value=="")
  {
  	alert("Please Enter a Username!");
  	document.getElementById('user').focus();
  	return true;
  }
  if (document.getElementById('pass').value=="")
  {
  	alert("Please Enter a Password!");
  	document.getElementById('pass').focus();
  	return true;
  }
  document.getElementById('login').value="Please Wait.";	
}  
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object...
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
       if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = '/process1.php?'; //This is the path to the file we just finished making *
        var data='';
 //alert("type1:"+ type);

if ((type==1) &&  (document.getElementById('sublogin')!=null))
   data =  'user=' + encodeURIComponent(document.getElementById('user').value)+
   '&pass=' + encodeURIComponent(document.getElementById('pass').value)+
   '&remember=' + encodeURIComponent(document.getElementById('remember').value)+
   '&pageid=' + encodeURIComponent(page)+
   '&sublogin=' + encodeURIComponent(document.getElementById('sublogin').value);
 // alert("type2:"+ type);

 if ((type==3) &&  (document.getElementById('subjoin')!=null))
   data =  'user=' + encodeURIComponent(document.getElementById('user').value)+
   '&pass=' + encodeURIComponent(document.getElementById('pass').value)+
   '&email=' + encodeURIComponent(document.getElementById('email').value)+
   '&fname=' + encodeURIComponent(document.getElementById('fname').value)+
   '&lname=' + encodeURIComponent(document.getElementById('lname').value)+
   '&pageid=' + encodeURIComponent(page)+
   '&subjoin=' + encodeURIComponent(document.getElementById('subjoin').value);
 //alert("type3:"+ data);

if ((type==2) && (document.getElementById('subforgot')!=null))
   data =  'user=' + encodeURIComponent(document.getElementById('user').value)+
   '&pageid=' + encodeURIComponent(page)+
   '&subforgot=' + encodeURIComponent(document.getElementById('subforgot').value);
//  alert("type4:"+ type);
if ((type==4) &&  (document.getElementById('subedit')!=null))
   data =  'curpass=' + encodeURIComponent(document.getElementById('curpass').value)+
      '&user=' + encodeURIComponent(document.getElementById('user').value)+
  '&fname=' + encodeURIComponent(document.getElementById('fname').value)+
  '&lname=' + encodeURIComponent(document.getElementById('lname').value)+
  '&newpass=' + encodeURIComponent(document.getElementById('newpass').value)+
   '&email=' + encodeURIComponent(document.getElementById('email').value)+
   '&pageid=' + encodeURIComponent(page)+
   '&subedit=' + encodeURIComponent(document.getElementById('subedit').value);
   
if ((type==5) && (document.getElementById('submarine')!=null))
   data =  'user=' + encodeURIComponent(document.getElementById('user').value)+
     '&email=' + encodeURIComponent(document.getElementById('email').value)+
//'&subscribe=' + ((Dom.get('subscribe').checked) ? 'yes' : 'no')+
'&subscribe=' + encodeURIComponent((document.getElementById('subscribe').checked)? 'yes' : 'no')+
   '&pageid=' + encodeURIComponent(page)+
   '&gotone=' + encodeURIComponent(document.getElementById('gotone').value)+
     '&submarine=' + encodeURIComponent(document.getElementById('submarine').value);

//alert(file+ data);
    xmlhttp.open('GET', file + data, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
 // alert(xmlhttp.readyState);
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
 //  alert(content);
               if( content ){ //Make sure there is something in the content variable
  // alert(content);
//  document.getElementById('Submit').set("label", "<b>Thank You</b>");	
 // document.getElementById('Submit').value="<b>Thank You....</b>";	
                      document.getElementById('login').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}
function callFunction(file){
// alert("callFunction "+file);
 
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object...
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
       if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
//        var file = '/forgotpass1.php'; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file , true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
 // alert(xmlhttp.readyState);
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
 //  alert(content);
               if( content ){ //Make sure there is something in the content variable
   //alert(content);
//  document.getElementById('Submit').set("label", "<b>Thank You</b>");	
 // document.getElementById('Submit').value="<b>Thank You....</b>";	
                      document.getElementById('login').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function togglecomment() {
	var ele = document.getElementById("content");
	var text = document.getElementById("displayTextcomment");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "<a id='displayTextcomment' href='javascript:togglecomment();'>thisisUll Comments System Version 2.2</a>";
  	}
	else {
		ele.style.display = "block"; 
		text.innerHTML = "<b>Hide</b> <a id='displayTextcomment' href='javascript:togglecomment();'>thisisUll Comments System Version 2.2</a>";
	}
} 
function togglerate() {
	var ele = document.getElementById("ratebit");
	var text = document.getElementById("displayTextrate");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "show";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "hide";
	}
} 
function togglelogin() {
	var ele = document.getElementById("login");
	var text = document.getElementById("displayTextlogin");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "<b>Hide</b> <a id='displayTextlogin' href='javascript:togglelogin();'>thisisUll Login Notification</a>";
  	}
	else {
		ele.style.display = "block"; 
		text.innerHTML = "<a id='displayTextlogin' href='javascript:togglelogin();'>thisisUll Login Notification</a>";
	}
} 

function toggleintro() {
	var ele = document.getElementById("nopages");
	var text = document.getElementById("displayIntro");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "show";
  	}
	else {
		ele.style.display = "block"; 
		text.innerHTML = "hide";
	}
} 
function togglediscuscomment() {
	var ele = document.getElementById("disqus_thread");
	var text = document.getElementById("displaydiscus");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "<a id='displaydiscus' href='javascript:togglediscuscomment();'>Comment with one of your accounts<br/><IMG  border='0' src='http://mediacdn.disqus.com/1063/images/themes/narcissus/login-disqus.gif'/><IMG border='0' src='http://mediacdn.disqus.com/1063/images/themes/narcissus/login-facebook.gif'/><IMG  border='0' src='http://mediacdn.disqus.com/1063/images/themes/narcissus/login-twitter.gif'/></a>";
  	}
	else {
		ele.style.display = "block"; 
		text.innerHTML = "<b>Hide</b> <a id='displaydiscus' href='javascript:togglediscuscomment();'>Comment with one of your accounts<br/><IMG  border='0' src='http://mediacdn.disqus.com/1063/images/themes/narcissus/login-disqus.gif'/><IMG border='0' src='http://mediacdn.disqus.com/1063/images/themes/narcissus/login-facebook.gif'/><IMG  border='0' src='http://mediacdn.disqus.com/1063/images/themes/narcissus/login-twitter.gif'/></a>";
	}
} 


function doComments(page){
      if (page!=-1)
      {
	document.write ('<b>Comments</b>');
	}
document.write ('<div id="fb-root"></div>')
//<script>
  window.fbAsyncInit = function() {
    FB.init({appId: '134371963271794', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
//</script>
//	document.write ('<fb:comments numposts="4" width="500"></fb:comments>');
//	document.write (document.URL)
//	document.write ('" url="');
//	document.write (document.URL)
//	document.write ('" numposts="4" width="500"></fb:comments>');


//document.write ('<div style="width:500px; height:330px; margin:auto; margin-top:0em; margin-bottom:0em; border:1px solid #d8dfea; line-height:0; padding:0px">')
//document.write ('<iframe src="http://www.facebook.com/plugins/like.php?href=')
//document.write (document.URL)
//document.write ('&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>')
//document.write ('<iframe src="http://www.facebook.com/plugins/activity.php?site=http%3A%2F%2Fwww.thisisull.com&amp;width=500&amp;height=250&amp;header=true&amp;colorscheme=light&amp;font=arial&amp;border_color=white&amp;recommendations=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:250px;" allowTransparency="true"></iframe>')
//document.write ('</div>')
//	document.write ('<iframe src="http://www.facebook.com/widgets/like.php?href=')
//	document.write (document.URL)
//	document.write ('" scrolling="no" frameborder="0" style="border:10; width:450px; height:80px"></iframe>')
      if (page!=-1)
      {
	document.write ('<TABLE cellSpacing=0 cellPadding=6 width=100%>');
//	document.write ('<TR> <TD class="largebodyText" valign="top"><b>Add a Comment</b></TD></TR>');
	document.write ('<TR> <TD class="bodyText" valign="top"><a id="displayTextcomment" href="javascript:togglecomment();">thisisUll Comments System Version 2.2</a><br/> ');
getPageComments(page);

	document.write ('<div id="content" style="display: block;width:500px;height:340px;overflow:auto;scrollbar-face-color: #cccccc;scrollbar-shadow-color: #333333;scrollbar-highlight-color: #ffffff;scrollbar-3dlight-color: #ffffff;scrollbar-darkshadow-color: #cccccc;scrollbar-track-color: #ffffff;scrollbar-arrow-color: #ffffff">');
getPage(page);
document.write ('</div></div>');

document.write ('<a id="displayTextlogin" href="javascript:togglelogin();">thisisUll Login Notification</a>');
	document.write ('<br/>');
	document.write ('<div id="login" style="display: none;width:500px;height:200px;overflow:auto;scrollbar-face-color: #cccccc;scrollbar-shadow-color: #333333;scrollbar-highlight-color: #ffffff;scrollbar-3dlight-color: #ffffff;scrollbar-darkshadow-color: #cccccc;scrollbar-track-color: #ffffff;scrollbar-arrow-color: #ffffff">');
	document.write ('Register your details and login below to be notified by email when new comments are posted.  <br/>');

callFunction('/loginmain.php?pageid='+page);

document.write ('</div></div></TD></TR></TABLE>');
	document.write ('<fb:comments numposts="4" width="500"></fb:comments>');
document.write ('<iframe src="http://www.facebook.com/plugins/activity.php?site=http%3A%2F%2Fwww.thisisull.com&amp;width=500&amp;height=250&amp;header=true&amp;colorscheme=light&amp;font=arial&amp;border_color=white&amp;recommendations=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:250px;" allowTransparency="true"></iframe>')


}

//document.write ('<fb:comments numposts="7" width="500"></fb:comments>')
// NO DISCUS
//document.write ('<TABLE cellSpacing=0 cellPadding=6 width=100%>');
 //     if (page!=-1)
//      	{
//		document.write ('<TR> <TD class="largebodyText" valign="top"><b>Alternatively... <FONT color="red">NEW</FONT></b></TD></TR>');
//		document.write ('<TR> <TD class="bodyText" valign="top"><a id="displaydiscus" href="javascript:togglediscuscomment();">Comment with one of your accounts<br/><IMG  border="0" src="http://mediacdn.disqus.com/1063/images/themes/narcissus/login-disqus.gif"/><IMG border="0" src="http://mediacdn.disqus.com/1063/images/themes/narcissus/login-facebook.gif"/><IMG  border="0" src="http://mediacdn.disqus.com/1063/images/themes/narcissus/login-twitter.gif"/></a>');
//		document.write ('<div id="disqus_thread" style="display: none;width:100%;height:420px;overflow:auto;scrollbar-face-color: #cccccc;scrollbar-shadow-color: #333333;scrollbar-highlight-color: #ffffff;scrollbar-3dlight-color: #ffffff;scrollbar-darkshadow-color: #cccccc;scrollbar-track-color: #ffffff;scrollbar-arrow-color: #ffffff">');
//		}
//		else
 //     	{
//		document.write ('<TR> <TD class="largebodyText" valign="top"><b>Alternatively... <FONT color="red">NEW</FONT></b></TD></TR>');
//		document.write ('<TR> <TD class="bodyText" valign="top"><a id="displaydiscus" href="javascript:togglediscuscomment();">Comment with one of your accounts<br/><IMG  border="0" src="http://mediacdn.disqus.com/1063/images/themes/narcissus/login-disqus.gif"/><IMG border="0" src="http://mediacdn.disqus.com/1063/images/themes/narcissus/login-facebook.gif"/><IMG  border="0" src="http://mediacdn.disqus.com/1063/images/themes/narcissus/login-twitter.gif"/></a>');
//		document.write ('<div id="disqus_thread" style="display: block;width:100%;height:420px;overflow:auto;scrollbar-face-color: #cccccc;scrollbar-shadow-color: #333333;scrollbar-highlight-color: #ffffff;scrollbar-3dlight-color: #ffffff;scrollbar-darkshadow-color: #cccccc;scrollbar-track-color: #ffffff;scrollbar-arrow-color: #ffffff">');
//		}
		
  /**
    * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] 
    */
//  (function() {
//   var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
//   dsq.src = 'http://thisisull.disqus.com/embed.js';
 //  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
 // })();

//document.write ('</div></TD></TR></TABLE>');


return;
}
var disqus_shortname = 'thisisull';
(function () {
  var s = document.createElement('script'); s.async = true;
  s.src = 'http://disqus.com/forums/thisisull/count.js';
  (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());

