var ids=new Array(1,2,3,4,5,6,7,8,9,10);
var show='block';

function switchid(id){	
	hideallids();
	showdiv(id);
	//document.images['title1'].src='parts/title1-'+id+'.gif';
	//document.images['title2'].src='parts/title2-'+id+'.gif';
}

function hideallids(){
	//nodzesham jebkuru iepriekshejo
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//dzeshana
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//paradam specifiski prasito
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
function showrow(id) {

var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("firefox") != -1) {show='table-row';}
if (agt.indexOf("opera") != -1) {show='table-row';}
if (agt.indexOf("netscape") != -1) {show='table-row';}

	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = show;
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = show;
		}
		else { // IE 4
			document.all.id.style.display = show;
		}
	}
}
function validate() {
	if(helpvalidate()) {document.forma.submit();}
}

function uvalidate() {
	if(uhelpvalidate()) {document.uforma.submit();}
}

function svalidate() {
	if(shelpvalidate()) {document.sforma.submit();}
}

function helpvalidate()

{
var value=new Array;
value[1]=document.getElementById("title").value;
value[2]=document.getElementById("nosaukums").value;
value[3]=document.getElementById("person").value;
value[4]=document.getElementById("country").selectedIndex;
value[5]=document.getElementById("phone").value;
value[6]=document.getElementById("e-mail").value;
value[7]=document.getElementById("phone2").value;
value[8]=document.getElementById("participation").selectedIndex;
value[9]=document.getElementById("time").selectedIndex;
value[10]=document.getElementById("y1").checked;
value[11]=document.getElementById("y2").checked;
value[12]=document.getElementById("y3").checked;
value[13]=document.getElementById("places").selectedIndex;
value[14]=document.getElementById("baltics").value;
value[15]=document.getElementById("globally").value;
value[16]=document.getElementById("numberofcountries").value;
value[17]=document.getElementById("office").value;
value[18]=document.getElementById("industry").value;
value[19]=document.getElementById("founded").value;
value[20]=document.getElementById("signing").value;
value[21]=document.getElementById("personstitle").value;
value[22]=document.getElementById("regnumber").value;
value[23]=document.getElementById("bankname").value;
value[24]=document.getElementById("IBAN").value;
value[25]=document.getElementById("address").value;
value[26]=document.getElementById("getinfo").selectedIndex;
value[27]=document.getElementById("otherinfo").value;

if(value[1]=="") {alert("Please specify the Name of the company (ENG)!"); return 0;}
if(value[2]=="") {alert("Please specify the Name of the company (Local)!"); return 0;}
if(value[3]=="") {alert("Please specify the Arriving person (Name Surname)!"); return 0;}
if(value[4]==0) {alert("Please specify the Country!"); return 0;}
if(value[5]=="") {alert("Please specify the Arriving person's phone number (mobile)!"); return 0;}
if(value[6]=="") {alert("Please specify the Arriving person's e-mail!"); return 0;}
if(value[7]=="") {alert("Please specify the Company's telephone number!"); return 0;}
if(value[8]==0) {alert("Please specify Type of participation!"); return 0;}
if(value[9]==0) {alert("Please specify Preferable day time for the presentation!"); return 0;}
if(value[10]!="1"&&value[11]!="1"&&value[12]!="1") {alert("Please specify for which year students your company provides intenrship places!"); return 0;}
if(value[13]==0) {alert("Please specify Number of internship places provided!!"); return 0;}
if(value[14]==""&&value[15]=="") {alert("Please specify How many employees do you have in Baltics and/or globally!"); return 0;}

if(value[16]=="") {alert("Please specify In how many countries does your company have activity!"); return 0;}
if(value[17]=="") {alert("Please specify Where the main office is situated!"); return 0;}
if(value[18]=="") {alert("Please specify Which industry/branch would you say you are in!"); return 0;}
if(value[19]=="") {alert("Please specify When was your company founded!"); return 0;}
if(value[20]=="") {alert("Please specify Signing person!"); return 0;}
if(value[21]=="") {alert("Please specify Responsible person's title!"); return 0;}
if(value[22]=="") {alert("Please specify Company registration number!"); return 0;}
if(value[23]=="") {alert("Please specify Bank name!"); return 0;}
if(value[24]=="") {alert("Please specify Bank account number (IBAN)!"); return 0;}
if(value[25]=="") {alert("Please specify Company's address!"); return 0;}
if(value[26]==0) {alert("Please specify how did you find out about the DoO 2008!"); return 0;}
if(value[27]=="Please specify..."&&value[26]==5) {alert("Please specify how did you find out about the DoO 2010!"); return 0;}
return 1;

}

function uhelpvalidate()

{
var uvalue=new Array;

uvalue[0]=document.getElementById("utitle").value;
uvalue[1]=document.getElementById("unosaukums").value;
uvalue[2]=document.getElementById("uperson").value;
uvalue[3]=document.getElementById("ucountry").value;
uvalue[4]=document.getElementById("uphone").value;
uvalue[5]=document.getElementById("ue-mail").value;
uvalue[6]=document.getElementById("uphone2").value;
uvalue[7]=document.getElementById("usigning").value;
uvalue[8]=document.getElementById("upersonstitle").value;
uvalue[9]=document.getElementById("uaddress").value;
//uvalue[11]=document.getElementById("uprezentation").value;

if(uvalue[0]=="") {alert("Please specify the Name of the University (ENG)!"); return 0;}
if(uvalue[1]=="") {alert("Please specify the Name of the University (Local)!"); return 0;}
if(uvalue[2]=="") {alert("Please specify the Contact person's (Name Surname)!"); return 0;}
if(uvalue[3]=="") {alert("Please specify the Country!"); return 0;}
if(uvalue[4]=="") {alert("Please specify the Contact person's phone number (mobile)!"); return 0;}
if(uvalue[5]=="") {alert("Please specify the Contact person's e-mail!"); return 0;}
if(uvalue[6]=="") {alert("Please specify the University's telephone number!"); return 0;}
if(uvalue[7]=="") {alert("Please specify Signing person's!"); return 0;}
if(uvalue[8]=="") {alert("Please specify Responsible person's title!"); return 0;}
if(uvalue[9]=="") {alert("Please specify University's address!"); return 0;}
//if(uvalue[11]=="") {alert("Please specify if You want to make a prezentation!"); return 0;}


//alert("Thank you for applying for DoO 2008! We will contact you within 3 days after submitting the application to the provided e-mail ");
//document.forma.reset();
return 1;
}

function shelpvalidate()

{
var svalue=new Array;

svalue[0]=document.getElementById("sname").value;
svalue[1]=document.getElementById("ssurname").value;
svalue[2]=document.getElementById("scountry").value;
svalue[3]=document.getElementById("swork").value;
svalue[4]=document.getElementById("sphone").value;
svalue[5]=document.getElementById("semail").value;
svalue[6]=document.getElementById("swhy").value;


if(svalue[0]=="") {alert("Please specify Your Name!"); return 0;}
if(svalue[1]=="") {alert("Please specify Your Surname!"); return 0;}
if(svalue[2]=="") {alert("Please specify Your Country!"); return 0;}
if(svalue[3]=="") {alert("Please specify Your University/Workplace!"); return 0;}
if(svalue[4]=="") {alert("Please specify Your Telephone number!"); return 0;}
if(svalue[5]=="") {alert("Please specify Your e-mail!"); return 0;}
if(svalue[6]=="") {alert("Please specify why You want to participate!"); return 0;}


//alert("Thank you for applying for DoO 2008! We will contact you within 3 days after submitting the application to the provided e-mail ");
//document.forma.reset();
return 1;
}