﻿// JavaScript Document
$(document).ready(function () {			
//header navigation	
//fade msg
setTimeout(function() { $('.systemMsg').fadeOut(2000); }, 3000);

$('#categories div ul li').each(function(){
	
		$(this).mouseover(function(){$(this).css({background:'#FFFFFF'})
					.mouseout(function(){$(this).css({background:'#E8E8E8'});	
					});		
				});	
	});
//over navi			
$(function(){
$('#navi ul li')
.bind('mouseover',function(e) {
						   
		$(this).css({background:'#FF6633',cursor:'pointer'});
})
.bind('mouseout',function(e) {

		$(this).css({background:'#78A4ED'});
		
})
.bind('click',function(e) {
					   
})
});
//over table
$('.rTable tr,.aTable tr').each(function(){
	
		$(this).mouseover(function(){$(this).css({background:'#E8E8E8'})
					.mouseout(function(){$(this).css({background:'#FFFFFF'});	
					});
				});	
	});
////////////////////////////////////////input functions//////////////////////////////////////////////////////
	$('.iButton').each(function(){
	
		$(this).mouseover(function(){$(this).css({background:'#F3F3F3',cursor:'pointer'})
					.mouseout(function(){$(this).css({background:'#E6E6E6'});	
					});		
				});	
	});
	//radio
	$('.iRadio').each(function(){
	
		$(this).mouseover(function(){$(this).css({cursor:'pointer'});	
						
		});	
	});
	//text textarea
	$('.iText, .iTextarea,.iPass').each(function(){
	
		$(this).mouseover(function(){$(this).css({border:'1px solid #666666'})
					.mouseout(function(){$(this).css({border:'1px solid #BCBCBC'});	
					});			
		});	
	});
	
	//focus and blurr
	$('.iText, .iTextarea,.iPass').focus(function(){
					$(this).css({background:'#FFFFFF'});	
					}).blur(function(){
								$(this).css({background:'#E6E6E6'});
							
						});
////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////Advertisments FUnctions 					  
$(function(){
		   $('.stepContainer h4')
		   .bind('mouseover',function(e) {
			$(this).css({
						cursor:'pointer',background:'#F7854F'
						});
	})
	.bind('mouseout',function(e) {
		$(this).css({
					background:'#FF6633'
				 });	
	})
	.bind('click',function(e) {
		var Pid=$(this).parent().attr('id');
		var status=Pid.toString().slice(14,17);
		/*alert(status);*/
		
		switch(status)
		{
			case 'L_1':
			$('#description_L_1').fadeIn(1000);
			$('#description_L_2').hide();
			$('#description_L_3').hide();
			break;
			
			case 'L_2':
			$('#description_L_1').hide();
			$('#description_L_2').fadeIn(1000);
			$('#description_L_3').hide();
			break;
			
			case 'L_3':
			$('#description_L_1').hide();
			$('#description_L_2').hide();
			$('#description_L_3').fadeIn(1000);
			break;
			//right
			case 'R_1':
			$('#description_R_1').fadeIn(1000);
			$('#description_R_2').hide();
			$('#description_R_3').hide();
			break;
			
			case 'R_2':
			$('#description_R_1').hide();
			$('#description_R_2').fadeIn(1000);
			$('#description_R_3').hide();
			break;
			
			case 'R_3':
			$('#description_R_1').hide();
			$('#description_R_2').hide();
			$('#description_R_3').fadeIn(1000);
			break;
			
			default:
			break;
		}
		
		
	})
	
});					  
//disable, enable company
$('#CYes, #CNo').bind('click',function(e){
			var reg=document.registert;
								if(this.id=='CYes')
								{
									
									 reg.companyname.disabled = false;
									 reg.companyname.style.background = '#E8E8E8';
									 reg.tradingas.disabled = false;
									 reg.tradingas.style.background = '#E8E8E8';
									 reg.dfirstname.disabled = false;
									 reg.dfirstname.style.background = '#E8E8E8';
									 reg.dlastname.disabled = false;
									 reg.dlastname.style.background = '#E8E8E8';
									 reg.vatnumber.disabled = false;
									 reg.vatnumber.style.background = '#E8E8E8';
									 reg.foundationyear.disabled = false;
									 reg.foundationyear.style.background = '#E8E8E8';
									 reg.employeesnumber.disabled = false;
									 reg.employeesnumber.style.background = '#E8E8E8';
									
								}
								else if(this.id=='CNo')
								{
									
									 reg.companyname.disabled = true;
									 reg.companyname.style.background = '#999999';
									 reg.tradingas.disabled = true;
									 reg.tradingas.style.background = '#999999';
									 reg.dfirstname.disabled = true;
									 reg.dfirstname.style.background = '#999999';
									 reg.dlastname.disabled = true;
									 reg.dlastname.style.background = '#999999';
									 reg.vatnumber.disabled = true;
									 reg.vatnumber.style.background = '#999999';
									 reg.foundationyear.disabled = true;
									 reg.foundationyear.style.background = '#999999';
									 reg.employeesnumber.disabled = true;
									 reg.employeesnumber.style.background = '#999999';
								}
								
						});
//disable, enable qualifications
$('#QYes, #QNo').bind('click',function(e){
var reg=document.registert;
	if(this.id=='QYes')
	{
	
		reg.qualificationdescription.disabled = false;
		reg.qualificationdescription.style.background = '#E8E8E8';
	   
	}  
	else if(this.id=='QNo')
	{
		reg.qualificationdescription.disabled = true;
		reg.qualificationdescription.style.background = '#999999';
	 
	}
});
//opacity
$(function(){
		   $('.rTable tr th img,#email')
		   .bind('mouseover',function(e) {
			$(this).css({
						filter:'alpha(opacity=100)',
						opacity:'1.0'
						});
	})
	.bind('mouseout',function(e) {
		$(this).css({
					filter:'alpha(opacity=70)',
					opacity:'0.70'
				 });	
	})

	});
$(function(){
		   $('#photos a,.priceRow a img,.stepContainer div a')
		   .bind('mouseover',function(e) {
			$(this).css({
						filter:'alpha(opacity=100)',
						opacity:'1.0'
						});
	})
	.bind('mouseout',function(e) {
		$(this).css({
					filter:'alpha(opacity=85)',
					opacity:'0.85'
				 });	
	})

	});

///////////////////////////////////////////language/////////////////////////////////////////////////////////////////
//stop GET onclick
$('.languageNotSelected, .languageSelected').bind('click', function(e){return false;});
// language opacity
$(function(){
		   $('.languageNotSelected')
		   .bind('mouseover',function(e) {
			$(this).css({
						filter:'alpha(opacity=100)',
						opacity:'1.0'
						});
	})
	.bind('mouseout',function(e) {
		$(this).css({
					filter:'alpha(opacity=65)',
					opacity:'0.65'
				 });	
	}).bind('click',function(e) {
			document.getElementById('hiddenLang').value=this.id;
			document.getElementById('chooseLanguage').submit();
			return false;
	})

	});

/////////////////////////round///////////////////////////////////
///
/*$('td.priceRow a').corner('5px');*/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//top and all categories
$('.trigger').each(function(){
		
		$(this).click(function(){
							   
					var index=this.id;
					var status=index.toString().slice(0,2);
					var visibility=$('#'+status).css('display');
						if(status=='sD'&&visibility=='none')
						{
								$('#sD_trigger').css({background:'#E8E8E8',
													 color:'#333333'/*,
													 'border-top':'1px solid #666666',
													 'border-right':'1px solid #666666',
													 'border-left':'1px solid #666666',
													 'border-bottom':'1px solid #E8E8E8'*/
													 });
								$('#lD_trigger').css({background:'#ffffff',
													 color:'#999999'/*,
													 'border-top':'1px solid #999999',
													 'border-right':'1px solid #999999',
													 'border-left':'1px solid #999999',
													 'border-bottom':'1px solid #666666'*/});
								$('#sD').show();
								$('#lD').hide();
						}
						else if(status=='lD'&&visibility=='none')
						{
								$('#sD_trigger').css({background:'#ffffff',
													  color:'#999999'/*,
													 'border-top':'1px solid #999999',
													 'border-right':'1px solid #999999',
													 'border-left':'1px solid #999999',
													 'border-bottom':'1px solid #666666'*/});
								$('#lD_trigger').css({background:'#E8E8E8',
													  color:'#333333'/*,
													 'border-top':'1px solid #666666',
													 'border-right':'1px solid #666666',
													 'border-left':'1px solid #666666',
													 'border-bottom':'1px solid #E8E8E8'*/});
								$('#lD').show();
								$('#sD').hide();
						}
					});		
				});
		return false;
});