$(document).ready(function() {
 	checkurl();

 }
 );



 function checkurl(){
	var hash = parent.document.location.hash;

	if (hash != ''){
		projektjump(parent.document.location);
	}
}

function projektjump(link){

	var div = $("a[href='" + link + "']").parent();

         var langx;

        if(link.href.indexOf('lang=en')>-1)

                 {
         langx = 1;
         }
         else
         {
         langx = 0;
         }



	var idarr = div.attr('id').split('-');
         var idx = idarr[0];
	var id = idarr[1];

         if (idx == 'team')
         {
          showteam(id) ;

         }
         else if (idx == 'news')
         {
         shownews(id) ;
         }


         else
         {
	showprojekt(id,langx);
         }
}




function shownews(id)
{
elem = document.getElementById('news-'+id)

 $.scrollTo($(elem),800);








}



function showteam(id)
{
elem = document.getElementById('team-'+id)
if ($(elem).next().is(":hidden"))
{
$("div.team").show();
$(elem).hide();

$("div.contentdetail").hide();
$(elem).next().slideDown();
 $.scrollTo($(elem).next(),800);



}
else
{
 $.scrollTo(0,800);
$(elem).next().slideUp();

 $(elem).show("slow");
}



}


function showprojekt(id,langx)
{
elem = document.getElementById('projekt-'+id) ;
elemx = document.getElementById('projektxx-'+id);
if ($(elem).next().is(":hidden"))
{

$("div.projekt").show();

$(elem).hide();

$("div.contentdetail").hide();
$(elem).next().slideToggle();
 $.scrollTo($(elem).next(),800);

getproject(id,langx);


}
else
{
$(elemx).hide();

$(elem).next().slideUp("slow");

 $.scrollTo(0,800);
 $(elem).show("slow");
}



}







function showprojektdetail(file,id)
{
elem = document.getElementById('projektxx-'+id)
if ($(elem).is(":hidden"))
{

$(elem).slideToggle(1700);
getprojectdetail(file,id);

 //$.scrollTo($(elem).next(),800);



}
else
{

getprojectdetail(file,id);
}

}


function showflash(ytbpath,ytbpic, id )
{

                         var obj = document.getElementById('projektxx-'+id);

			var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);


			if (hasReqestedVersion) {

                          obj.innerHTML =  ytbpath;


			} else {  // flash is too old or we can't detect the plugin
			var alternateContent = "<img src='"+ytbpic+"'>";
			obj.innerHTML =alternateContent;  // insert non-flash content
			}

}







function showyoutube(ytbpath,ytbpic, id )
{


                         var obj = document.getElementById('projektxx-'+id);

			var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);


			if (hasReqestedVersion) {

                          obj.innerHTML =  ytbpath;


			} else {  // flash is too old or we can't detect the plugin
			var alternateContent = "<img src='"+ytbpic+"'>";
			obj.innerHTML =alternateContent;  // insert non-flash content
			}

}


function showpic(epic,id)
{



                        var obj = document.getElementById('projektxx-'+id);

			var picContent = "<img src='"+epic+"'>";
			obj.innerHTML =picContent;


}
