img = new Image(32,16);
img.src="images/ax.gif";


 function getRequestBody(oForm) {
    var aParams = new Array();
    for (var i=0 ; i < oForm.elements.length; i++) {
        var sParam = encodeURIComponent(oForm.elements[i].name);
        sParam += "=";
        sParam += encodeURIComponent(oForm.elements[i].value);
        aParams.push(sParam);
    }
    return aParams.join("&");
}

function openz(lnk){
//alert("Called");
//alert();
var x = "/Full"+lnk.src.substring(lnk.src.lastIndexOf('/Reminiscence/'));
//alert(x);
	newwindow=window.open(x,'Image','height=400,width=650');
	if (window.focus) {newwindow.focus()}
	return ;

}


function sendRequest(oForm)
{  

   	var sBody = getRequestBody(oForm);
    var oXmlHttp = getObj();
    oXmlHttp.open("post", oForm.action, true);
    oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   
    oXmlHttp.onreadystatechange=function f2()
	{
        if (oXmlHttp.readyState == 4) 
		{       
                
                document.getElementById("target").innerHTML=oXmlHttp.responseText;
				 }else{

document.getElementById("target").innerHTML = "<br><br>Please Wait <img src=\"images/loading.gif\" alt=\"Submitting\"><br><br>";
}
        
    }
    oXmlHttp.send(sBody);
	
}


function validate(){

var xy = document.getElementById("err");
if(document.forms.blg.name.value == ""){

xy.innerHTML = 'Please Provide your full name';
xy.style.display='';
document.forms.blg.name.focus();
return false;
}
if(document.forms.blg.batch.value == ""){
xy.innerHTML = 'Please Provide your batch before you submit';
xy.style.display='';
document.forms.blg.batch.focus();
return false;
}
if(document.forms.blg.blog.value == ""){
xy.innerHTML = 'Please Provide your blog text';
xy.style.display='';
document.forms.blg.blog.focus();
return false;
}

sendRequest(document.forms.blg);
}

function startMinAjax(url,locid){

//alert("Step 1");
//document.getElementById("js").style.display='';
//document.getElementById(locid).style.display='none';

document.getElementById(locid).innerHTML ='Please Wait, Fetching data .. <img src="images/ax.gif">' ;
var xmlHttp = getObj();
//alert("Step 2");
  xmlHttp.onreadystatechange=function()
    {
  // callMe(xmlHttp.readyState);
     if(xmlHttp.readyState==4){
//	 alert(xmlHttp.responseText);
document.getElementById(locid).innerHTML = xmlHttp.responseText;
//document.getElementById("js").style.display='none';
//document.getElementById(locid).style.display='';
}
 }
	
	//alert(url);
   xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}


function startAjax(url,locid){
//window.location = "#"+url;
if(url.indexOf('.php') == -1){
	url = url+".php";
	}

//alert("Step 1");
document.getElementById("js").style.display='';
//document.getElementById(locid).style.display='none';

document.getElementById(locid).innerHTML ='&nbsp;' ;
var xmlHttp = getObj();
//alert("Step 2");
  xmlHttp.onreadystatechange=function()
    {
   callMe(xmlHttp.readyState);
     if(xmlHttp.readyState==4){
//	 alert(xmlHttp.responseText);
document.getElementById(locid).innerHTML = xmlHttp.responseText;
document.getElementById("js").style.display='none';
try{
	document.title = xmlHttp.responseText.substring(xmlHttp.responseText.indexOf('<title>')+7,xmlHttp.responseText.indexOf('</title>'));
	}catch(ex){}
	for(var k=1;k<5;k++){
document.getElementById('img'+k).src="images/wrking.gif";
}
//document.getElementById(locid).style.display='';
}

    }
	
	//alert(url);
   xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function callMe(ar){


document.getElementById('img'+ar).src="images/tick.gif";
}



//var current = 'Home';
function func(ths){
ths.style.backgroundImage='url(images/light-green-tab.gif)';
ths.style.color='#993300';

//document.getElementById('notify').innerHTML = ths.title;
//alert('Done');

}

function funct(ths){
ths.style.backgroundImage='url(images/_green.gif)';
ths.style.color='#00000e';
}
//document.getElementById('notify').innerHTML = "Current Selection : "+current;
//alert('Done');


function change(ths,url){
//document.title = "IIFM Bhopal "+ths.title;


//current = ths.title;
//ocument.getElementById('notify').innerHTML = "Current Selection : "+current;
if("#"+url == document.location.hash){
	startAjax(url,'target');
	return;
	}
if(url == 'url'){
hashListener.setHash('base.php?rnd='+Math.random(9));
}else{
hashListener.setHash(url);
}
}
function disp(lk){
if(lk == 1){
document.getElementById('uniblock').style.display='';
//$("#uniblock").fadeIn("slow");
document.getElementById('blg').style.display='';
//current = 'Blogs';
//document.getElementById('notify').innerHTML = "Current Selection : "+current;
}else{
document.getElementById('uniblock').style.display='none';
//$("#uniblock").fadeOut("slow");
document.getElementById('blg').style.display='none';
}
}
function disp1(lk){
if(lk == 1){
document.getElementById('uniblock').style.display='';
//$("#uniblock").fadeIn("slow");
//current = 'Alumni Pictures';
//document.getElementById('notify').innerHTML = "Current Selection : "+current;
document.getElementById('pics').style.display='';
}else{
document.getElementById('uniblock').style.display='none';
//$("#uniblock").fadeOut("slow");
document.getElementById('pics').style.display='none';
}
}

function doFeedback(){
if(document.forms.feedback.name.value == ""){
document.getElementById("errz").innerHTML = 'Please provide full Name<br><br>';
document.getElementById("errz").style.visibility = '';
document.forms.feedback.name.focus();
return false;
}
if(document.forms.feedback.cmmnt.value == ""){
document.getElementById("errz").innerHTML = 'Please provide your comment<br><br>';
document.getElementById("errz").style.visibility = '';
document.forms.feedback.cmmnt.focus();
return false;
}
//alert("Step 1");
sendRequest(document.forms.feedback);
return false;
}