
function blinkit(prod_id)
{
	intrvl=200;
	for(nTimes=0; nTimes<5; nTimes++)
	{
		intrvl += 200;
		setTimeout("document.getElementById('cart_row_" + prod_id + "').bgColor='#e4bfc0';",intrvl);
		intrvl += 150;
		setTimeout("document.getElementById('cart_row_" + prod_id + "').bgColor='#eeeeee';",intrvl);
  }
}


function hide_popup(obj)
{
	document.getElementById('popup_' + obj).style.display = 'none';
}

function confirm_msg(msg, url)
{
	if (confirm(msg))
	{
		if (url != null)
			window.location = url;
		return true;
	}
	return false;
}

function check_cycle(f1, f2, myobj)
{
	if (document.all) // IE4+
		var currcolor = myobj;
	else // Mozilla, etc
	{
		var color = new RGBColor(myobj);
		var currcolor = color.toHex();
	}
	
	if (currcolor == f1)
		return f2;
	return f1;
}

function check_selected_unhide_div(currval, checkval, mydiv, setfocus)
{
	var mydiv = document.getElementById(mydiv);
	
	if (currval == checkval)
	{
		mydiv.style.visibility = "visible";
		
		if (setfocus)
			document.getElementById(setfocus).focus()
	}
	else
 		mydiv.style.visibility = "hidden";
}

function unset_ulimages_session(url)
{
	parent.ulimages.location.href = url + "min-sida/fotoalbum/ladda-upp/ny/";
}

function reload_ulimages(url)
{
	parent.ulimages.location.href = url + "min-sida/fotoalbum/visa-uppladdade/";
}

function CreateControl(flash_file, flash_w, flash_h, flash_vars, id)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + flash_w + '" height="' + flash_h + '" id="' + id + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + flash_file + '" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="FlashVars" value="' + flash_vars + '" />');
	document.write('<embed src="' + flash_file + '" FlashVars="' + flash_vars + '" quality="high" bgcolor="#ffffff" wmode="transparent" width="' + flash_w + '" height="' + flash_h + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function stop_event(e)
{
	if(document.all) // IE4+
		e.cancelBubble = true;
	else // Mozilla, etc
		e.stopPropagation();
}

function hide_unhide_div(mydiv)
{
  var mydiv = document.getElementById(mydiv);
  
  // check div state
  if (mydiv.style.visibility == "hidden")
  	mydiv.style.visibility = "visible";
  else if (mydiv.style.visibility == "visible")
	 	mydiv.style.visibility = "hidden";
}

function reload_fs(target)
{
	if (target)
		top.location.href = target;
}

function form_submit_shop_show_cat_prods(formid,reset_start)
{
	if (reset_start == true)
		document.getElementById(formid).start.value = 0;
	
	document.getElementById(formid).submit();
}

function form_submit_order_op(formid, new_val, new_action, anchor_link)
{
	document.getElementById(formid).op.value = new_val;
	
	if (anchor_link)
		document.getElementById(formid).action = new_action + '#' + anchor_link;
	else
		document.getElementById(formid).action = new_action;
	
	document.getElementById(formid).submit();
}

function win_pop_up(inURL, inWinName, inWidth, inHeight, scroller)
{
	var winWidth = (screen.width - inWidth) / 2;
	var winHeight = (screen.height - inHeight) / 2;
	//var winHeight = 150;
	winProperties = 'height='+inHeight+',width='+inWidth+',top='+winHeight+',left='+winWidth+',resizable=1'+',scrollbars='+scroller;
	window.open(inURL, inWinName, winProperties)
}

function check_boxes(master_checker, group)
{ 
	// count how many boxes we've got
	var num_boxes = group.length;
	if (num_boxes > 1)
	{
  	for (i=0; i < num_boxes; i++)
  	{
  		if (master_checker.checked == true)
  			group[i].checked = true;
  		else
  			group[i].checked = false;
  	}
  }
  else
  {
  	if (master_checker.checked == true)
  		group.checked = true;
  	else
  		group.checked = false;
	}
}


function check_has_flash_player(curr_version, url)
{
	document.write("<div id=\"flashversion\">");
	document.write("Du har inte Flash player installerat, eller så stöder inte din webläsare Javascript. För att den här sidan ska fungera måste du ha JavaScript aktiverat.");
	document.write("</div>");
	
	var version = deconcept.SWFObjectUtil.getPlayerVersion();
	
	if (document.getElementById && version["major"] < curr_version)
	{
		document.location.href = url;
	}
	
	if (document.getElementById && version["major"] > 0)
	{
		document.getElementById('flashversion').innerHTML = "";
	}
}