// JavaScript Document
function topmenus(a){
	window.location=a;
}

function newindow(a){
	window.open(a);
}

function resources(a){
	param = "id="+a;
	Ajax_Send("POST","resourceslist.php",param,show);	
}

function show(data){
	document.getElementById('down'+param).innerHTML = data;
	document.getElementById('down'+param).style.display=(document.getElementById('down'+param).style.display== 'block')?'none':'block';
}

function showvideo(a){
	param = "id="+a;
	Ajax_Send("POST","featuredvideoplay.php",param,play);
}

function play(data){
	document.getElementById('playvideo').innerHTML = data;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////
function prevnext(a){
	param = "limit="+a;
	Ajax_Send("POST","gallerylist.php",param,nextlist);
}

function nextlist(data){
	document.getElementById('down').innerHTML = data;
}

function gall(a){
	param = "img="+a;
	Ajax_Send("POST","gallerylist.php",param,bigp);
}

function bigp(data){
	document.getElementById('gal').innerHTML = data;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function formload(a){
	mywindow = window.open("downloadform.php?h="+a,"mywindow","location=1,status=1,scrollbars=1,width=570,height=350");
    mywindow.moveTo(300, 300);
}

function downloadform(a){
	nam = document.getElementById("name").value;
	emal = document.getElementById("email").value;
	phon = document.getElementById("phone").value;
	compname = document.getElementById("companyname").value;
	poction = document.getElementById("position").value;
	addres = document.getElementById("add").value;
	
	if(nam=="" || emal=="" || phon=="" || compname=="" ){
		alert('Fill up the important information (*).');
	}else{
		info = a+'|'+nam+'|'+emal+'|'+phon+'|'+compname+'|'+poction+'|'+addres;
		swoosh(info,'downloadform.php','downloadform');
	}
}

///////////////////////////////////////////////////////additional script///////////////////////////////////////////////////////////////
function twoonload(){
	initRotateText();
}

var rotatingTextElement;
var rotatingText = new Array();
var ctr = 0;
		
function initRotateText() {
	rotatingTextElement = document.getElementById("textToChange");
	total = document.getElementById("all").value;
	rotatingText[0] = rotatingTextElement.innerHTML; // store the content that's already on the page
	for (x=1;x<=total;x++){
	textlist = document.getElementById("feadlist"+x).value;
	rotatingText[x] = textlist;
	}
	setInterval(rotateText, 15000);
}

function rotateText() {
	ctr++;
		if(ctr >= rotatingText.length) {
			ctr = 1;
		}
	rotatingTextElement.innerHTML = rotatingText[ctr];
}
