function changeClass(myId,myClass) {
document.getElementById(myId).className = myClass;
}

function checkBloggComForm() {
var check = true;

	if (document.bloggComForm.bloggComName.value == "") 
	{
		check = false;
		document.getElementById('bloggComAlert').className='show';
		changeClass('bloggComName','blogComInputAlert');
	}
	else 
	{
		changeClass('bloggComName','blogComInput');
	}
	
	if (document.bloggComForm.bloggComEmail.value == "") {
		check = false;
		document.getElementById('bloggComAlert').className='show';
		changeClass('bloggComEmail','blogComInputAlert');
	}
	else 
	{
		changeClass('bloggComEmail','blogComInput');
	}
	
	if (document.bloggComForm.bloggComMess.value == "") 
	{
		check = false;
		document.getElementById('bloggComAlert').className='show';
		changeClass('bloggComMess','blogComInputAlert');
	}
	else 
	{
		changeClass('bloggComMess','blogComInput');
	}
	
	return check;
	
	if (check == true) 
	{
		document.getElementById('bloggComAlert').className='hide';
	}
}

function checkGeneralContactForm() {
var check = true;

	if (document.generalContactForm.generalContactName.value == "") 
	{
		check = false;
		document.getElementById('generalContactAlert').className='show';
		changeClass('generalContactName','generalContactInputAlert');
	}
	else 
	{
		changeClass('generalContactName','generalContactInput');
	}
	
	if (document.generalContactForm.generalContactLastName.value == "") 
	{
		check = false;
		document.getElementById('generalContactAlert').className='show';
		changeClass('generalContactLastName','generalContactInputAlert');
	}
	else 
	{
		changeClass('generalContactLastName','generalContactInput');
	}
	
	if (document.generalContactForm.generalContactEmail.value == "") {
		check = false;
		document.getElementById('generalContactAlert').className='show';
		changeClass('generalContactEmail','generalContactInputAlert');
	}
	else 
	{
		changeClass('generalContactEmail','generalContactInput');
	}
	
	if (document.generalContactForm.generalContactMess.value == "") 
	{
		check = false;
		document.getElementById('generalContactAlert').className='show';
		changeClass('generalContactMess','generalContactInputAlert');
	}
	else 
	{
		changeClass('generalContactMess','generalContactInput');
	}
	
	return check;
	
	if (check == true) 
	{
		document.getElementById('generalContactAlert').className='hide';
	}
}

function goToStoreTemp(whatValue)
{
	var cityName = document.getElementById(whatValue).value;
	window.location.href = "http://www.dialect.se/m4n?oid=stores&amp;city=" + cityName;
}

function goToSearch1()
{
	window.location.href = "http://webbshop.dialect.se/m4n?oid=etailer-products&amp;ecom-query=" + document.getElementById('searchFormTop').value;
}

function goToSearch2()
{
	window.location.href = "http://webbshop.dialect.se/m4n?oid=etailer-products&amp;ecom-query=" + document.getElementById('searchFormBottom').value;
}

function getStoresUrl()
{
	window.location.href = "http://webbshop.dialect.se" + document.getElementById('storesForm').value;
}

var previous = false;

function showService(what,style) {
	if (previous == true) {
	hideService(previousId);
	}
document.getElementById(what).className=style;
previousId = what;
previous = true;
}

function hideService(what) {
document.getElementById(what).className='hide';
}

function preLoadImages() {
preload_image_object = new Image();
// set image url
image_url = new Array();
image_url[0] = "/images/services/plattan_bg2.jpg";
image_url[1] = "/images/services/plattan_bg1.jpg";
image_url[2] = "/images/services/plattan_botten.jpg";

var i = 0;
for(i=0; i<=3; i++) 
preload_image_object.src = image_url[i];
}

function showLan(lanId)
{
	document.getElementById(lanId).className='showLan';
}

function hideLan(lanId)
{
	document.getElementById(lanId).className='hideLan';
}

function generateShareUrls() {
	jQuery('.themeShare a').each(function() {
		jQuery(this).attr('href',jQuery(this).attr('href').replace('http://dialect.se',window.location.href));
	})
}
jQuery.noConflict();
jQuery(document).ready(function() {
	generateShareUrls();
	jQuery('#themeNavMenu').css('display','block').hide();
	jQuery('#themeNavLink').click(function(){
		jQuery('#themeNavMenu').fadeIn();
		return false;
	});
});