// JavaScript Document
var kindofbranchVar = '';

var urlthistime = "http://www.b2reel.com/web/";


function deleteMediaVideo(na)
{
	
var al = confirm  ("Are you sure?")
if (al)
top.location.href="_script/deletevideo.php?todel="+ na ;
//top.location.href="mymedia.php?allesklar=ok";
else
top.location.href="mymedia.php";
	//_script/deletevideo.php?todel=".$code."
	
}


function regtobefound() {

	whichkindofuser();
	
}

function regtofind() {

	whichkindofuser();
	
}



function whichkindofuser() {
	


	
	
}


function del(createstamp,user)
{

	top.location.href="_script/deletemedia.php?todel="+createstamp+"&user="+user;
	
}



function showLogout(){
	

top.location.href="_script/logout.php";	
	
}

function settingsAppear(){
	

top.location.href="mysettings.php";	
	
}

function profileAppear(){
	

top.location.href="b2reel_profile.php";	
	
}


function uploadItNow(logged,createstamp){
	

top.location.href="b2reel_profile.php?precious=upload&user="+logged+"&createstamp="+createstamp;	
	
}



function homeButton()
{

top.location.href = 'index.php';

	
}


function howToUse() {

top.location.href = 'howtouse.php';
	
}


function hidebuttons(thediv)
{

var theShowDiv = 'delete_'+thediv;
document.getElementsByName(theShowDiv) [0].style.display = "none";	

var theShowDivAdd = 'add_'+thediv;
document.getElementsByName(theShowDivAdd) [0].style.display = "none";	

	
}


function showbuttons(thediv)
{

var theShowDiv = 'delete_'+thediv;
document.getElementsByName(theShowDiv) [0].style.display = "block";
	
var theShowDivAdd = 'add_'+thediv;
document.getElementsByName(theShowDivAdd) [0].style.display = "block";	

	
}


function pic()
{
	top.location.href = "upload_crop.php";	
}


function aboutOpen(opendiv)
{

//var aboutheight = 0;
//h = $('.'+ opendiv + '_x').height(); 
//g = h*7; 

$('.infoservices').height(0);
$('.infoservices_x').hide();
$('.infocontact').height(0);
$('.infocontact_x').hide();
$('.infotags').height(0);
$('.infotags_x').hide();
$('.infolinks').height(0);
$('.infolinks_x').hide();

//$('.'+ opendiv).animate({height: '100%', opacity: 100}, 600);
$('.'+ opendiv).height('100%');

//$('.'+ opendiv + '_u').animate({height: '100%', opacity: 100}, 600);

$('.'+ opendiv + '_x').width('100%');
$('.'+ opendiv + '_x').show();
	
	
}


function servicesOpen(opendiv)
{

$('.infoabout').height(0);
$('.infoabout_x').hide();
$('.infocontact').height(0);
$('.infocontact_x').hide();
$('.infotags').height(0);
$('.infotags_x').hide();
$('.infolinks').height(0);
$('.infolinks_x').hide();

//$('.'+ opendiv).animate({height: '100%', opacity: 100}, 600);
$('.'+ opendiv).height('100%');

//$('.'+ opendiv + '_u').animate({height: '100%', opacity: 100}, 600);

$('.'+ opendiv + '_x').width('100%');
$('.'+ opendiv + '_x').show();
	
	
}


function servicesOpenVisited(opendiv)
{

$('.infoabout').height(0);
$('.infoabout_x').hide();
$('.infocontact').height(0);
$('.infocontact_x').hide();
$('.infotags').height(0);
$('.infotags_x').hide();
$('.infolinks').height(0);
$('.infolinks_x').hide();

//$('.'+ opendiv).animate({height: '100%', opacity: 100}, 600);
$('.'+ opendiv).height('100%');

//$('.'+ opendiv + '_u').animate({height: '100%', opacity: 100}, 600);

$('.'+ opendiv + '_x').width('96%');
$('.'+ opendiv + '_x').show();
	
	
}



function contactOpen(opendiv)
{

//var aboutheight = 0;
//h = $('.'+ opendiv + '_x').height(); 
//g = h*7; 

$('.infoabout').height(0);
$('.infoabout_x').hide();
$('.infoservices').height(0);
$('.infoservices_x').hide();
$('.infotags').height(0);
$('.infotags_x').hide();
$('.infolinks').height(0);
$('.infolinks_x').hide();

//$('.'+ opendiv).animate({height: '100%', opacity: 100}, 600);
$('.'+ opendiv).height('100%');

//$('.'+ opendiv + '_u').animate({height: '100%', opacity: 100}, 600);

$('.'+ opendiv + '_x').width('116%');
$('.'+ opendiv + '_x').show();
	
	
}

function tagsOpen(opendiv)
{

//var aboutheight = 0;
//h = $('.'+ opendiv + '_x').height(); 
//g = h*7; 

$('.infoabout').height(0);
$('.infoabout_x').hide();
$('.infoservices').height(0);
$('.infoservices_x').hide();
$('.infocontact').height(0);
$('.infocontact_x').hide();
$('.infolinks').height(0);
$('.infolinks_x').hide();

//$('.'+ opendiv).animate({height: '100%', opacity: 100}, 600);
$('.'+ opendiv).height('100%');

//$('.'+ opendiv + '_u').animate({height: '100%', opacity: 100}, 600);

$('.'+ opendiv + '_x').width('120%');
$('.'+ opendiv + '_x').show();
	
	
}

function linksOpen(opendiv)
{

//var aboutheight = 0;
//h = $('.'+ opendiv + '_x').height(); 
//g = h*7; 

$('.infoabout').height(0);
$('.infoabout_x').hide();
$('.infoservices').height(0);
$('.infoservices_x').hide();
$('.infocontact').height(0);
$('.infocontact_x').hide();
$('.infotags').height(0);
$('.infotags_x').hide();

//$('.'+ opendiv).animate({height: '100%', opacity: 100}, 600);
$('.'+ opendiv).height('100%');

//$('.'+ opendiv + '_u').animate({height: '100%', opacity: 100}, 600);

$('.'+ opendiv + '_x').width('120%');
$('.'+ opendiv + '_x').show();

	
	
}


function hideresult(thediv) {
	


   $('div[name='+thediv+']').fadeOut("slow", function() {
      });
	  
	   
	  
	  


	
	
	//document.getElementsByName(thediv) [0].style.display = "none";
	//alert(document.getElementsByName("thediv")[0].id);
	
}





function onResOver() {
	
	var theinfodiv = 'infowish';
	
	
 $('div[class='+theinfodiv+']').fadeIn("fast", function() {
      });
	
	
}



function onResOut() {
	
	var theinfodiv = 'infowish';
	
	
 $('div[class='+theinfodiv+']').fadeOut("fast", function() {
      });
	
	
}









function forgotpassword() {
	

top.location.href="forgotpassword.php";
	
}



function fadeOutLogIn ()
{
	
	
$('.loginpanel').fadeOut('slow', function() {
      });
}



function setBranch(picname,picnew)
			{
			
				
				var thisnamereg = document.images[picname].src ;
				var partofitreg = thisnamereg.substring(thisnamereg.length-5, thisnamereg.length);
				
				//var partofitreg = 'n.jpg';
				
				if(partofitreg == 'n.jpg')
				{
				
				
				
				document.images[picname].src = 'assets/checkbox_a.jpg';
				
				//alert('war nicht aktiviert');
				
					  if(picname == 'branchcheckone')
					  {
						  kindofbranchVar = 'Agency';
						  document.getElementsByName("inInstitution")[0].innerHTML = kindofbranchVar;
						  document.images['branchchecktwo'].src = 'assets/checkbox_n.jpg';
						  document.images['branchcheckdrei'].src = 'assets/checkbox_n.jpg';
						 
					  }
					   if(picname == 'branchchecktwo')
					  {
						   var kindofbranchVar = 'Studio';
						  document.images['branchcheckone'].src = 'assets/checkbox_n.jpg';
						  document.images['branchcheckdrei'].src = 'assets/checkbox_n.jpg';
						  document.getElementsByName("inInstitution")[0].innerHTML = kindofbranchVar;
						  
					  }
					  if(picname == 'branchcheckdrei')
					  {
						   var kindofbranchVar = 'Freelancer';
						  document.images['branchcheckone'].src = 'assets/checkbox_n.jpg';
						  document.images['branchchecktwo'].src = 'assets/checkbox_n.jpg';
						  document.getElementsByName("inInstitution")[0].innerHTML = kindofbranchVar;
						 
					  }
					
				
				
				}
				
				
				
				
				if(partofitreg == 'a.jpg')
				{
				
				
				
				document.images[picname].src = 'assets/checkbox_n.jpg';
			
				
				
				}
				
				var divheight = document.getElementById('branchkinddiv').style.height;

				//alert(divheight);
				
					if( divheight == '211px')
					{
						
						//alert('HALLO!!');
						
						$('#branchkinddiv').animate({height: "+=65px", opacity: 100}, 300);
				  
				    $('.gobtnbranch').fadeIn("slow", function() {});
						
					}
					
					
					
					
				
			}


function clearTextShowNextOne(whichnext)
		{
			
			
				
				    $('div[name='+whichnext+']').fadeIn("slow", function() {
      });
			
		}


function clearTextShowNextOne(whichnext,textfeld)
		{
			
			
					
					 if (document.getElementsByName(textfeld) [0].value == "" || document.getElementsByName(textfeld) [0].value == " " 
					 || document.getElementsByName(textfeld) [0].value == "  " 
					 || document.getElementsByName(textfeld) [0].value == "   " 
					 || document.getElementsByName(textfeld) [0].value == "    " 
					 || document.getElementsByName(textfeld) [0].value == "     " 
					 || document.getElementsByName(textfeld) [0].value == "      " 
					 || document.getElementsByName(textfeld) [0].value == "       " 
					 || document.getElementsByName(textfeld) [0].value == "        " 
					 || document.getElementsByName(textfeld) [0].value == "         " 
					 || document.getElementsByName(textfeld) [0].value == "          " 
					 || document.getElementsByName(textfeld) [0].value == "           " 
					 || document.getElementsByName(textfeld) [0].value == "            " 
					 || document.getElementsByName(textfeld) [0].value == "             " 
					 || document.getElementsByName(textfeld) [0].value == "              " 
					 || document.getElementsByName(textfeld) [0].value == "               " 
					 || document.getElementsByName(textfeld) [0].value == "                                          " 
					 )
		  
					{
							$('div[name='+whichnext+']').fadeOut("slow", function() {
			  					});
					}
					
					
					else if(document.getElementsByName(textfeld) [0].value != "")
		  
					{
							$('div[name='+whichnext+']').fadeIn("slow", function() {
			  					});
					}
					
					 
					
			
				
				
			
		}











function deleteMediaStill(nas)
{
	
var als = confirm  ("Are you sure?")
if (als)
top.location.href="_script/deletestill.php?todel="+ nas ;
//top.location.href="mymedia.php?allesklar=ok";
else
top.location.href="mymediastill.php?nas="+ nas;
	//_script/deletevideo.php?todel=".$code."
	
}



function deleteMediaAudio(naa)
{
	//alert("hallo");
var als = confirm  ("Are you sure?")
if (als)
top.location.href="_script/deletestaudio.php?todel="+ naa ;
//top.location.href="mymedia.php?allesklar=ok";
else
top.location.href="mymediaaudio.php?naa="+ naa;
	//_script/deletevideo.php?todel=".$code."
	
}






function getFavVideo(share)
{
	
	
		top.location.href="index.php?preciousreel_id=" + share;
		
		
		
	//var vid = "<object width='580' height='327'><param name='allowfullscreen' value='true' /><param name='allowscriptaccess' value='always' /><param name='movie' value='mediareel_advanced.swf?preciousreel_id=" + share +"'" + "/><embed src='mediareel_advanced.swf?preciousreel_id=" + share + "'" + " type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always'width='380' height='327'></embed></object>" ;

//var test = document.getElementsByName("movie")[0].value ;
//alert(vid);
//document.span2.span1.value = vid;
	
}



function hideTable(registertablename) 
{
	//alert(registertablename);
				var nameFirma = document.getElementById('companyname').value;
				document.getElementsByName("inNameFirma")[0].innerHTML = nameFirma;

				 $('div[class='+registertablename+']').animate({marginTop: "-=70px", opacity: 0}, 500);
				  $('.registerpointtwo').animate({marginTop: "-=601px", opacity: 100}, 500);
				  
				    $('.registerpointtwo').fadeIn("slow", function() {
      });
	
	
	
	

};



function hideTabletofind(registertablename) 
{
	//alert(registertablename);
				var nameFirma = document.getElementById('companyname').value;
				document.getElementsByName("inNameFirma")[0].innerHTML = nameFirma;

				 $('div[class='+registertablename+']').animate({marginTop: "-=70px", opacity: 0}, 500);
				  $('.registerpointtwo').animate({marginTop: "-=601px", opacity: 100}, 500);
				  
				    $('.registerpointtwo').fadeIn("slow", function() {
      });
	
	
	
	

};


function hideTableTwo(registertablename) 
{
	//alert(registertablename);
	var Mailvar = document.getElementById('mailinput').value;
	document.getElementsByName("inMail")[0].innerHTML = Mailvar;

				 $('div[class='+registertablename+']').animate({marginTop: "-=75px", opacity: 0}, 500);
				  $('.registerpointthree').animate({marginTop: "-=201px", opacity: 100}, 500);
				  
				   $('.registerpointthree').fadeIn("slow", function() {
      });
	
	
	
	

};


function hideTableTwotofind(registertablename) 
{
	//alert(registertablename);
	var Mailvar = document.getElementById('mailinput').value;
	document.getElementsByName("inMail")[0].innerHTML = Mailvar;

				  $('div[class='+registertablename+']').animate({marginTop: "-=0px", opacity: 0}, 500);
				  $('.registerpointcomplete').animate({marginTop: "-=171px", opacity: 100}, 500);
				  
				   $('.registerpointcomplete').fadeIn("slow", function() {
      });
	
	
	
	

};





function hideTableThree(registertablename) 
{
	
	

				 $('div[class='+registertablename+']').animate({marginTop: "-=0px", opacity: 0}, 500);
				  $('.registerpointcomplete').animate({marginTop: "-=196px", opacity: 100}, 500);
				  
				   $('.registerpointcomplete').fadeIn("slow", function() {
      });
	
	
	
	

};



function hideLast(registertablename, idxxx) 
{
	var pek = document.getElementById('companyname').value;
	
	alert(pek);
	

				 $('div[class='+registertablename+']').animate({marginTop: "-=75px", opacity: 0}, 500);
				  $('.allcomplete').animate({marginTop: "-=550px", opacity: 100}, 500);
				  
				   $('.allcomplete').fadeIn("slow", function() {
      });
	
	
	
	top.location.href = 'storesession.php?pek='+pek+'&id='+idxxx;
	

};


function savePass(registertablename, idxxx) 
{
	
	
	var pek = document.getElementById('resetpassword').value;
	alert(pek);
	
			
	
	
	top.location.href = 'storesessionpass.php?pek='+pek+'&id='+idxxx;
	

};


function showLogin()
{
	
	
 $('.loginpanel').fadeIn("slow", function() {
      });

}

function changeType() {

document.login.password.value = '';
document.login.password.type = 'password';

}

function passwordLooseFocus() {

document.login.password.value = 'password';
document.login.password.type = 'text';

}




function changeTypeUsername() {

document.login.username.value = '';

}

function looseFocusUsername() {

document.login.username.value = 'username/email';
	
}



function edit_links()
{
	linksOpen('infolinks');
	
	 $('#addlink').fadeIn("slow", function() {
      });
	   $('#pluslink').fadeIn("slow", function() {
      });
	  $('#linkcapid').fadeIn("slow", function() {
      });
	  
	  $('#addlink2').fadeIn("slow", function() {
      });
	  $('#linkcapid2').fadeIn("slow", function() {
      });
	
}





function edit_tags()
{
	
		tagsOpen('infotags');
	 $('#addtag').fadeIn("slow", function() {
      });
	   $('#plustag').fadeIn("slow", function() {
      });
	  $('#tagcapid').fadeIn("slow", function() {
      });
	
}




	
function edit_about()

{
	aboutOpen('infoabout');
	var getabheight = $('#getaboutheight').height();
	//alert(getabheight);
	var textabout = document.getElementById('paragraph_1').innerHTML;
	
	var tag_textabout = "<textarea id='about_edit' name='tabed' style='width: 95%; border:solid; margin-bottom:0px; padding: 4px 0 4px 4px; text-align:justify;'>" + textabout + "</textarea><br><br><div id='tag_btn' class='blue_button_save' style='width: 100%;' onclick='saveChangesAbout();'></div>";
	
	var avoid = "<div class='link_bar_btn_x' onclick=close_edit_about();></div>";
	document.getElementById('avoidabout').innerHTML = avoid;
	
	
	document.getElementById('paragraph_1').innerHTML = tag_textabout;
	$('#about_edit').height(getabheight+50);
	$('#about_edit').show();
	
}


function saveChangesAbout()
{
	
	
	var aboutchanged = document.getElementById('about_edit').value;
	var uservar = document.getElementById('addtag').name;
	//alert(aboutchanged + "   " + uservar);
	aboutChanges(uservar,aboutchanged);
	close_edit_about();
	
	
}




///// SERVICES



function edit_services()

{
	servicesOpen('infoservices');
	var getseheight = $('#getservicesheight').height();
	//alert(getseheight);
	var textservices = document.getElementById('paragraph_2').innerHTML;
	
	var tag_textservices = "<textarea id='services_edit' name='srtabed' style='width: 95%; border:solid; margin-bottom:0px; padding: 4px 0 4px 4px; text-align:justify;'>" + textservices + "</textarea><br><br><div id='tag_btn' class='blue_button_save' style='width: 100%;' onclick='saveChangesServices();'></div>";
	
	var avoid = "<div class='link_bar_btn_x' onclick=close_edit_services();></div>";
	document.getElementById('avoidservices').innerHTML = avoid;
	
	document.getElementById('paragraph_2').innerHTML = tag_textservices;
	$('#services_edit').height(getseheight+50);
	$('#services_edit').show();
	
}

function close_edit_services()

{
	var textservices = document.getElementById('services_edit').innerHTML;

	var altesdivherstellen = "<div class='link_bar_btn' onclick=edit_services();></div>";
	document.getElementById('avoidservices').innerHTML = altesdivherstellen;
	
	document.getElementById('paragraph_2').innerHTML = textservices;

	
}


function close_edit_about()

{
	var textservices = document.getElementById('about_edit').innerHTML;

	var altesdivherstellen = "<div class='link_bar_btn' onclick=edit_about();></div>";
	document.getElementById('avoidabout').innerHTML = altesdivherstellen;
	
	document.getElementById('paragraph_1').innerHTML = textservices;

	
}


function saveChangesServices()
{
	
	
	var serviceschanged = document.getElementById('services_edit').value;
	var uservar = document.getElementById('addtag').name;
	//alert(serviceschanged + "   " + uservar);
	servicesChanges(uservar,serviceschanged);
	close_edit_services();
	
}

////////////////



function watchlink(num)
{
	
	if(num == '13')
	{
		add_link();
	}
	
}


function add_link()
{

var name = document.getElementById('addlink').name;
var urlname = document.getElementById('addlink2').name;
	//alert(name);
   var value = $('#addlink').val();
   var value_two = $('#addlink2').val();
  //alert(name + "   " + value);
  // nun ist die user-id und der tag übergeben. Es folgt AJAX funktion
	ajaxNewLink(name, value + "_:_" + value_two);
}	





function watchtag(num)
{
	
	if(num == '13')
	{
		add_tag();
	}
	
}


function add_tag()
{

var name = document.getElementById('addtag').name;
	//alert(name);
   var value = $('#addtag').val();
  //alert(name + "   " + value);
  // nun ist die user-id und der tag übergeben. Es folgt AJAX funktion
	ajaxNewTag(name, value);
}	
	


   
   //// INFO FÜR DIE EINZELNEN STILLS HOLEN:



  <!--    
              var req = null;
              
             function handleTranslationNewTag(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                            
                            //antwort des servers
                            xml = req.responseXML;
							 //alert('hallo'+xml);
							 
                            resp = xml.getElementsByTagName('stringx')[0];
							//alert('hallo'+xml+'   '+resp);
							
                            //schreiben des ergebnisses
                            inf = resp.firstChild.nodeValue;
							
							
							
								
								String.prototype.replaceAll = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									
									String.prototype.replaceAllfinal = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};



								


								
								var ausgabex = inf.replaceAll ('[', '<');
								var ausgabefinalx = ausgabex.replaceAllfinal (']', '>');
								
						// WICHTIG ---alert(ausgabefinal);
								
								document.getElementsByName("tagdiv")[0].innerHTML = ausgabefinalx;
								document.getElementById('addtag').focus();
								
								
						 }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function ajaxNewTag(userid,wert){         
                 //erstellen des requests
				
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = '_script/loadnewtag.php?userid='+ userid +'&wert='+ wert;
				
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationNewTag;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->



		/////////// LINK
		
		
		
		
		
  <!--    
              var req = null;
              
             function handleTranslationNewLink(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                            
                            //antwort des servers
                            xml = req.responseXML;
							 //alert('hallo'+xml);
							 
                            resp = xml.getElementsByTagName('stringx')[0];
							//alert('hallo'+xml+'   '+resp);
							
                            //schreiben des ergebnisses
                            inf = resp.firstChild.nodeValue;
							
							
							
								
								String.prototype.replaceAll = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									
									String.prototype.replaceAllfinal = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};



								


								
								var ausgabex = inf.replaceAll ('[', '<');
								var ausgabefinalx = ausgabex.replaceAllfinal (']', '>');
								
						// WICHTIG ---alert(ausgabefinal);
								
								document.getElementsByName("linkdiv")[0].innerHTML = ausgabefinalx;
								document.getElementById('addtag').focus();
								
								
						 }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function ajaxNewLink(userid,wert){         
                 //erstellen des requests
				
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = '_script/loadnewlink.php?userid='+ userid +'&wert='+ wert;
				
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationNewLink;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->


		
		
		
		
		
		
		
		
		//////////////// AJAX LINK ENDE





    //// ABOUT CHANGES SPEICHERN:



  <!--    
              var req = null;
              
             function handleTranslationAboutChanges(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                            
                            //antwort des servers
                            xml = req.responseXML;
							/// alert('hallo');
							 
                            resp = xml.getElementsByTagName('stringx')[0];
							//alert('hallo'+xml+'   '+resp);
							
                            //schreiben des ergebnisses
                            inf = resp.firstChild.nodeValue;
							
							//alert(inf);
							
							
							/*
								
								String.prototype.replaceAll = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									
									String.prototype.replaceAllfinal = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};



								


								
								var ausgabex = inf.replaceAll ('[', '<');
								var ausgabefinalx = ausgabex.replaceAllfinal (']', '>');*/
								
						// WICHTIG ---alert(ausgabefinal);
								//alert(ausgabefinalx);
								//document.getElementById("getaboutheight")[0].value = inf;
								document.getElementById("getaboutheight").innerHTML = inf;
								
								
								
						 }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function aboutChanges(userid,wert){         
                 //erstellen des requests
				//alert("TEST OB ES ANKOMMT  "+wert);
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = '_script/saveaboutchanges.php?userid='+ userid +'&wert='+ wert;
				
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationAboutChanges;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->
   
   
   
   
    //// SERVICES CHANGES SPEICHERN:



  <!--    
              var req = null;
              
             function handleTranslationServicesChanges(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                            
                            //antwort des servers
                            xml = req.responseXML;
							//alert('hallo');
							 
                            resp = xml.getElementsByTagName('stringx')[0];
							//alert('hallo'+xml+'   '+resp);
							
                            //schreiben des ergebnisses
                            inf = resp.firstChild.nodeValue;
							
							//alert(inf);
							
							
							/*
								
								String.prototype.replaceAll = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									
									String.prototype.replaceAllfinal = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};



								


								
								var ausgabex = inf.replaceAll ('[', '<');
								var ausgabefinalx = ausgabex.replaceAllfinal (']', '>');*/
								
						// WICHTIG ---alert(ausgabefinal);
								//alert(ausgabefinalx);
								//document.getElementById("getaboutheight")[0].value = inf;
								document.getElementById("getservicesheight").innerHTML = inf;
								
								
								
						 }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function servicesChanges(userid,wert){         
                 //erstellen des requests
				//alert("TEST OB ES ANKOMMT  "+wert);
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = '_script/saveserviceschanges.php?userid='+ userid +'&wert='+ wert;
				
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationServicesChanges;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->
   
   
   
   
   
   
   
   
   
   

//// LINK LÖSCHEN: ANFANG  ////////////////////// ////////////////////// ////////////////////// ////////////////////// ////////////////////// ////////////////////// //////////////////////



  <!--    
              var req = null;
              
             function handleTranslationDeleteLink(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                           
						
								$($('#'+ulblock)).fadeOut("slow", function() {
      							});
								//alert('#'+ulblock);
								
									
								
						
                        }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function deletelink(vary){         
                 //erstellen des requests
				
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = '_script/deletelink.php?id='+ vary;
					ulblock = vary;
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationDeleteLink;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->
		 
		 
		 //// LINK LÖSCHEN: ENDE ////////////////////// ////////////////////// ////////////////////// ////////////////////// ////////////////////// //////////////////////
   
   
   
   

//// TAG LÖSCHEN: ANFANG  ////////////////////// ////////////////////// ////////////////////// ////////////////////// ////////////////////// ////////////////////// //////////////////////



  <!--    
              var req = null;
              
             function handleTranslationDeleteTag(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                           
						
								$($('#'+ulblock)).fadeOut("slow", function() {
      							});
								//alert('#'+ulblock);
								
									
								
						
                        }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function deletetag(vary){         
                 //erstellen des requests
				
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = '_script/deletetag.php?id='+ vary;
					ulblock = vary;
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationDeleteTag;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->
		 
		 
		 //// TAG LÖSCHEN: ENDE ////////////////////// ////////////////////// ////////////////////// ////////////////////// ////////////////////// //////////////////////









































function getProfileVideo(overgabe)
{
	
	
		var ausgabe = overgabe.split("aspect")
		var share = ausgabe[0];
		var height = ausgabe[1];
		var heightnew = parseInt(height) + parseInt(3);
		//alert(heightnew);
		
		
		
	var vid = " <div class='videowallleft' style= height:"+heightnew+" value='test'><object width='580' height='"+height+"'><param name='allowfullscreen' value='true' /><param name='allowscriptaccess' value='always' /><param name='movie' value='mediareel_advanced.swf?preciousreel_id=" + share + "/><embed src='mediareel_advanced.swf?preciousreel_id=" + share  + " type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always' width='580' height='"+height+"'></embed></object><div>" ;

//var test = document.getElementsByName("movie")[0].value ;
//alert(document.getElementsByName("vidcode")[0].innerHTML);
//alert(share);
document.getElementsByName("vidcode")[0].innerHTML = vid;
	
videoInfo(share);
	
	
	
}




function getProfileAudio(share)
{
	
	
	
		
		
		
		
	var vid = " <div class='audiowallleft'><object width='454' height='100'><param name='allowfullscreen' value='true' /><param name='allowscriptaccess' value='always' /><param name='movie' value='B2Reel_audioplayer_single.swf?preciousreel_id=" + share +"'" + "/><embed src='B2Reel_audioplayer_single.swf?preciousreel_id=" + share + " type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always'width='454' height='100'></embed></object><div>" ;

//var test = document.getElementsByName("movie")[0].value ;
//alert(document.getElementsByName("vidcode")[0].innerHTML);
//alert(share);
document.getElementsByName("vidcode")[0].innerHTML = vid;
	

	audioInfo(share);
	
	
}



function getProfileStill(share)
{
	
	var ausgabe = share.split("x-plo-de")
		var src = ausgabe[0];
		var user = ausgabe[1];
		
		
		String.prototype.replaceAll = function(pcFrom, pcTo){
    	var c = this;
    	while (c.indexOf(pcFrom) > -1)
        c = c.replace(pcFrom, pcTo); 
    	return c;
};




	var newstring = src.replaceAll ('b2reelfantasticcode', ' '); 
		
		
		
		
	var vid = " <div class='stillwallleft'> <img src='b2reelusers/"+user+"/videos/"+newstring+"' width ='590'/> <div>" ;

//var test = document.getElementsByName("movie")[0].value ;
//alert(document.getElementsByName("vidcode")[0].innerHTML);
//alert(share);
document.getElementsByName("vidcode")[0].innerHTML = vid;

stillInfo(newstring, user);
	

	
	
	
}








function akthome()
{
	
	
		top.location.href='../web/index.php?preciousreel_id=b4efb36c8b1d956291228ab0a9c8e1dc';
		
		
		
	
	
	
	
}








/*

//// INFO FÜR DIE EINZELNEN VIDEO HOLEN:



  <!--    
              var req = null;
              
             function handleTranslationvideo(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                            //felder des formulars
                            german_fieldx = document.getElementById("infocovideo");
							commfield = document.getElementById("commdiv");
							linkfield = document.getElementById("linkdiv");
                            //-----french_field = document.getElementById("french");
                        
                            //antwort des servers
                            xml = req.responseXML;
							//alert(xml);
                            german_respx = xml.getElementsByTagName("english")[0];
							comm_respx = xml.getElementsByTagName("comm")[0];
								link_respx = xml.getElementsByTagName("link")[0];
                            //-----french_resp = xml.getElementsByTagName("french")[0];
                           
                            //schreiben des ergebnisses
                            inf = german_respx.firstChild.nodeValue;
							comminf = comm_respx.firstChild.nodeValue;
							linkinf = link_respx.firstChild.nodeValue;
							//alert(german_resp.firstChild.nodeValue);
                            //-----french_field.value = french_resp.firstChild.nodeValue;
							// WICHTIG --- alert(comm_respx.firstChild.nodeValue);
								
								
								document.getElementsByName("infoloadvideo")[0].innerHTML = german_respx.firstChild.nodeValue;
								
								
								String.prototype.replaceAll = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									
									String.prototype.replaceAllfinal = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									




								var ausgabe = comminf.replaceAll ('[', '<');
								var ausgabefinal = ausgabe.replaceAllfinal (']', '>');
								
								
								var linkrep = linkinf.replaceAll ('[', '<');
								var linkrepfinal = linkrep.replaceAllfinal (']', '>');
								
								
								
						// WICHTIG ---alert(ausgabefinal);
								
								document.getElementsByName("commnamediv")[0].innerHTML = ausgabefinal;
								document.getElementsByName("linkcommdiv")[0].innerHTML = linkrepfinal;
						
							
                        }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function videoInfo(vary){         
                 //erstellen des requests
				
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = urlthistime+'_script/getinfovideo.php?plot='+ vary;
				
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationvideo;
  					
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->







//// INFO FÜR DIE EINZELNEN AUDIO HOLEN:



  <!--    
              var req = null;
              
             function handleTranslationaudio(){            
                switch(req.readyState) {
                    case 4:
                        if(req.status!=200) {
                            alert("Fehler:"+req.status); 
                        }else{    
                            //felder des formulars
                            german_field = document.getElementById("infocoaudio");
							commfield = document.getElementById("commdiv");
							linkfield = document.getElementById("linkdiv");
							
                            //-----french_field = document.getElementById("french");
                         
                            //antwort des servers
                            xml = req.responseXML;
							//alert(xml);
                            german_resp = xml.getElementsByTagName("english")[0];
							link_respx = xml.getElementsByTagName("link")[0];
                            //-----french_resp = xml.getElementsByTagName("french")[0];
                           comm_respx = xml.getElementsByTagName("comm")[0];
                            //schreiben des ergebnisses
                            inf = german_resp.firstChild.nodeValue;
							comminf = comm_respx.firstChild.nodeValue;
							linkinf = link_respx.firstChild.nodeValue;
							//alert(german_resp.firstChild.nodeValue);
                            //-----french_field.value = french_resp.firstChild.nodeValue;
							
								
								
								document.getElementsByName("infoloadaudio")[0].innerHTML = german_resp.firstChild.nodeValue;
								
								
								
								
								String.prototype.replaceAll = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};
									
									
									String.prototype.replaceAllfinal = function(pcFrom, pcTo){
											var yy = this;
											while (yy.indexOf(pcFrom) > -1)
											yy = yy.replace(pcFrom, pcTo); 
											return yy;
									};




								var ausgabe = comminf.replaceAll ('[', '<');
								var ausgabefinal = ausgabe.replaceAllfinal (']', '>');
								
								
								var linkrep = linkinf.replaceAll ('[', '<');
								var linkrepfinal = linkrep.replaceAllfinal (']', '>');
								
								
						// WICHTIG ---alert(ausgabefinal);
								
								document.getElementsByName("commnamediv")[0].innerHTML = ausgabefinal;
								document.getElementsByName("linkcommdiv")[0].innerHTML = linkrepfinal;
						
							
                        }
                    break;
            
                    default:
                        return false;
                    break;     
                }
            }
            
             function audioInfo(vary){         
                 //erstellen des requests
				
                 
                try{
                    req = new XMLHttpRequest();
					
                }
                catch (e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (failed){
                            req = null;
                        }
                    }  
                }

                if (req == null){
                      alert("Error creating request object!");
				}
				else{
					
				
				
                  
                  //anfrage erstellen (GET, url ist localhost,
                  //request ist asynchron      
                  var url = urlthistime+'_script/getinfoaudio.php?plot='+ vary;
				
                  req.open("GET", url, true);
}
                //Beim abschliessen des request wird diese Funktion ausgeführt
                req.onreadystatechange = handleTranslationaudio;
  
                  req.setRequestHeader("Content-Type",
                                      "application/x-www-form-urlencoded");
                req.send(null);
            }
         //-->


*/

//window.onload=recBrow; 




//function recBrow(){
	
	
	
	//alert(navigator.userAgent);
	
	
	// WENN iPhone
						// if (navigator.userAgent.indexOf('iPhone') != -1) 
						 //	{
					       //  document.location = "http://www.b2reel.com/web/_iphone_b2reel/login.php";
							//}	
							
							
										  
	
//}
	// WENN IE

/*	
if (navigator.appName.indexOf("Internet Explorer") != -1)

{
	
	
	// WENN unterschiedliche Version
	
	
				  if (navigator.appVersion.indexOf("6") != -1)
			  {
				  window.location = "http://www.b2reel.com/web/404.html";
				  }
				  
				  if (navigator.appVersion.indexOf("7") != -1)
			  {
				  window.location = "http://www.b2reel.com/web/404.html";
				  }
				  if (navigator.appVersion.indexOf("8") != -1)
			  {
				  window.location = "http://www.b2reel.com/web/404.html";
				  }
				  
				   if (navigator.appVersion.indexOf("8") != -1)
			  {
				  window.location = "http://www.b2reel.com/web/404.html";
				  }
				 


				 
}*/
	
	

	
	
/*else if (navigator.userAgent.indexOf("Netscape") != -1)
{
   refer = "netscapelink.html";
   document.write('Netscape Navigator');
}
else if (navigator.appName.indexOf("Internet Explorer") != -1)
{
   refer = "msielink.html";
   document.write('Internet Explorer');
}
else if (navigator.userAgent.indexOf("Firefox") != -1)
{
   refer = "firefox.html";
   document.write('Mozilla Firefox');
}
else
{
   refer = "unbekannt.html";
   document.write('Unbekannter Browser');
}*/
//an dieser Stelle könnte entsprechend umgeleitet werden:
//window.location = refer;
//}


