// JavaScript Document

function panellight(id){
	document.getElementById(id).style.backgroundColor='#d7e6fb';
	//document.getElementById(id).style.color='#ffffff';
}
function paneldark(id){
	document.getElementById(id).style.backgroundColor='#FFFFFF';
	//document.getElementById(id).style.color='#000000';
}

function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
}


function show(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} 
}
}

function hide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == ""){
obj.style.display = "none";
} 
}
}

function show1(object, btn)
{
	object = ref(object);
	btn = ref(btn);
	object.style.display = '';
	btn.checked = true;
	return true;
}

function hide1(object, btn) {
	object = ref(object);
	btn = ref(btn);
	object.style.display = 'none';
	btn.checked = false;
	return false;
}


var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


function showme(object, btn)
{
	object = ref(object);
	btn = ref(btn);
	object.style.display = '';
	btn.checked = true;
	return true;
}

function hideme(object, btn) {
	object = ref(object);
	btn = ref(btn);
	object.style.display = 'none';
	btn.checked = false;
	return false;
}

//==============================================================================ot icn.bg===============


function print_it()
{
	if (window.print)
	{
		window.print();
	}
	else
	{
		alert("       ,       !");
	}
}

function popup(url,winWidth,winHeight) 
{
	winTop = (screen.height - winHeight) / 2;
	winLeft = (screen.width - winWidth) / 2;
	window.open(url,"","width=" + winWidth + ",height=" + winHeight + ",top=" + winTop  + ",left=" + winLeft  + ",resizable=no,scrollbars=yes,toolbar=no");
}

function ref(object)
{
	if (document.getElementById)
	{
		return document.getElementById(object);
	}
	else if (document.all)
	{
		return eval('document.all.' + object);
	}
	else
	{
		return false;
	}
}



function radio_check(btn1)
{
	switch (btn1)
	{
		case "radio1": btn2="radio2"; btn3="radio3"; btn4="radio4"; break;
		case "radio2": btn2="radio1"; btn3="radio3"; btn4="radio4"; break;
		case "radio3": btn2="radio1"; btn3="radio2"; btn4="radio4"; break;	
		case "radio4": btn2="radio1"; btn3="radio2"; btn4="radio3"; break;	
	}
	btn1 = ref(btn1);
	btn1.checked = true;
	return true;
	btn2 = ref(btn2);
	btn2.checked = false;
	return false;
	btn3 = ref(btn3);
	btn3.checked = false;
	return false;
	btn4 = ref(btn4);
	btn4.checked = false;
	return false;
}

function checkconditions(){

	
	if(document.getElementById('conditions').checked==false){
		alert("Трябва да сте съгласни с условията за гаранционно и извънгаранционно обслужване"); return false;}
	
	return true;}
	
function checkreq(){
	
		obj= document.getElementById('zaqvitel');
			if(obj.value.length<1){
			alert("Моля въведете Заявител!")
			obj.focus();
			obj.select();
			return false;
			}
				obj= document.getElementById('eik');
			if(obj.value.length<1){
			alert("Моля въведете Булстат!")
			obj.focus();
			obj.select();
			return false;
			}
				obj= document.getElementById('adres');
			if(obj.value.length<1){
			alert("Моля въведете Адрес!")
			obj.focus();
			obj.select();
			return false;
			}
				
				obj= document.getElementById('telephone');
			if(obj.value.length<1){
			alert("Моля въведете Телефон!")
			obj.focus();
			obj.select();
			return false;
			}
				obj= document.getElementById('godinaproiz');
			if(obj.value.length<1){
			alert("Моля въведете Вид/Модел на апарата!")
			obj.focus();
			obj.select();
			return false;
			}
				obj= document.getElementById('fabrichenno');
			if(obj.value.length<1){
			alert("Моля въведете Фабричен номер!")
			obj.focus();
			obj.select();
			return false;
			}
				obj= document.getElementById('povredi');
			if(obj.value.length<1){
			alert("Моля въведете Повреди!")
			obj.focus();
			obj.select();
			return false;
			}
		
			
			if(document.getElementById('conditions').checked==false){
		alert("Трябва да сте съгласни с условията за гаранционно и извънгаранционно обслужване"); return false;}
		
		return true;
	
}



function checktech(){
	
		obj= document.getElementById('zaqvitel');
			if(obj.value.length<1){
			alert("Моля въведете Име!")
			obj.focus();
			obj.select();
			return false;
			}
				
				obj= document.getElementById('telephone');
			if(obj.value.length<1){
			alert("Моля въведете Телефон!")
			obj.focus();
			obj.select();
			return false;
			}

				obj= document.getElementById('message');
			if(obj.value.length<1){
			alert("Моля въведете Съобщение!")
			obj.focus();
			obj.select();
			return false;
			}
		
		
		return true;
	
}
