

// Toggle DIV layer visibility. Id word meegegeven van de DIV layer.
function toggleVisibility(id)
{
	if (document.getElementById(id).style.visibility == "hidden")
	{
		document.getElementById(id).style.visibility = "visible";
		document.getElementById(id).style.display = "inline";
	}
	else
	{
		document.getElementById(id).style.visibility = "hidden";
		document.getElementById(id).style.display = "none";
	}
}

// switch class
function switchClass(id,newClass)
{
	var inp = document.getElementById (id);
	inp.className = newClass; 
}


// Toggle DIV layer visibility. Id word meegegeven van de DIV layer.
function toggleText(id)
{
	if (document.getElementById(id).style.visibility == "hidden")
	{
		document.getElementById(id).style.visibility = "visible";
	}
	else
	{
		document.getElementById(id).style.visibility = "hidden";
	}
}

function CheckCookie (CookieName)
{
	var lf = "\n";
	var CookieString = document.cookie;
	var CookieSet = CookieString.split (';');
	var SetSize = CookieSet.length;
	var CookiePieces
	var ReturnValue = "";
	var x = 0;

	for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++)
	{
		CookiePieces = CookieSet[x].split ('=');

		if (CookiePieces[0].substring (0,1) == ' ')
		{
			CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
		}
		if (CookiePieces[0] == CookieName)
		{
			ReturnValue = CookiePieces[1];
		}
	}

	return(ReturnValue);
}

// orderform checks & launch payment wizard
function order(productid, isowncontent)
{
	var errmsg = "";

//	doSharewire( productid, 881, 'vibrafoon12345', '', 1, 1, 416, 498 );
}




var movieName = "mobile";

function thisMovie(theMovie)
{
	if (navigator.appName.indexOf ("Microsoft") !=-1)
	{
		return window.document[theMovie]
	}
	else
	{
		return document[theMovie]
	}
}

function movieIsLoaded (theMovie)
{
	if (typeof(theMovie) != "undefined")
	{
		return theMovie.PercentLoaded() == 100;
	}
	else
	{
		return false;
	}
}


function mobSettings(shake,shakeTime,buz,buzTime,move) {
	
	if (movieIsLoaded(thisMovie(movieName)))
	{

		if (shake == 1) {
			thisMovie(movieName).SetVariable("/:shake", "1");
			thisMovie(movieName).SetVariable("/:shakeTime", shakeTime);
			thisMovie(movieName).TPlay("/mobShake");
		}

		if (buz == 1) {
			thisMovie(movieName).SetVariable("/:buz", "1");
			thisMovie(movieName).SetVariable("/:buzTime", buzTime);
			thisMovie(movieName).TPlay("/mobBuz");
		}

		if (move == 1) {
			thisMovie(movieName).TCallFrame("/", 4);
		}
		
	}
}



function loadVib(id,shake,shakeTime,buz,buzTime,move)
{
	if (movieIsLoaded(thisMovie(movieName)))
	{
		mobSettings(shake,shakeTime,buz,buzTime,move);
		thisMovie(movieName).SetVariable("/:vibrafonic", "/thumb.php?id="+id);//"thumbs/flashanims/88cc2959d5e747f29ef324515b279c86.swf");
		thisMovie(movieName).TPlay("/loadVib");
	}
}

function loadJPG(id,shake,shakeTime,buz,buzTime,move)
{
	if(id != '')
	{
		if (movieIsLoaded(thisMovie(movieName)))
		{
			mobSettings(shake,shakeTime,buz,buzTime,move);
			thisMovie(movieName).SetVariable("/:id", id);
			thisMovie(movieName).TPlay("/loadJPG");
		}
	}
}

function loadRingtone(id,repeat,viznum,shake,shakeTime,buz,buzTime,move)
{
	// repeat : 0/1
	// viznum : 1/2 (/3)  visualisatie bij ringtone
	//alert("ik doe wat");
	
	
	if (movieIsLoaded(thisMovie(movieName)))
	{
		
		thisMovie(movieName).SetVariable("/:viznum", viznum);
		thisMovie(movieName).SetVariable("/:id", id);
		thisMovie(movieName).SetVariable("/:repeat", repeat);
		thisMovie(movieName).TPlay("/mobRingtone");
		mobSettings(shake,shakeTime,buz,buzTime,move);
	}
	else
	{
		//alert("notloaded");
	}
thisMovie(movieName).TCallFrame("/", 4);
	
}

function mobReset()
{
	if (movieIsLoaded(thisMovie(movieName)))
	{
		thisMovie(movieName).TPlay("MobReset");
	}
}


	function start()
	{
		//initjsDOMenu();
	}
