/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/

// C:\TripedioApplication\trunk\Application\tripedio\TripedioArchitekt\scripts\tripedio\tripedio-overview.js

function ShowMorePics(ortID,actualPage)
{TripedioOverView.GetLocationPictures(ortID,actualPage,OnSuccessShowMorePics,OnErrorShowMorePics);}
function OnSuccessShowMorePics(data)
{jQuery("#pics").html(data);jQuery('a[rel*=lightbox]').lightBox();}
function OnErrorShowMorePics()
{}
function ShowMoreSecrets(ortID,actualPage)
{TripedioOverView.GetLocationSecrets(ortID,actualPage,OnSuccessShowMoreSecrets,OnErrorShowMoreSecrets);}
function OnSuccessShowMoreSecrets(data)
{jQuery("#geheimtipp").html(data);jQuery('a[rel*=lightbox]').lightBox();}
function OnErrorShowMoreSecrets()
{}
function ShowMoreRatings(ortID,actualPage)
{TripedioOverView.GetLocationRatings(ortID,actualPage,OnSuccessShowMoreRatings,OnErrorShowMoreRatings);}
function OnSuccessShowMoreRatings(data)
{jQuery("#rating-single-body").html(data);jQuery('a[rel*=lightbox]').lightBox();}
function OnErrorShowMoreRatings()
{}
function OnSuccessIWasHere(data)
{jQuery("#iwashere").attr("src","img/icon/youwerehere.gif");}
function OnErrorIWasHere(data)
{alert(data);}
function iWasHere(OrtID)
{TripedioOverView.SetDestination(OrtID,OnSuccessIWasHere,OnErrorIWasHere);}
function OnSuccessQuestion(data)
{jQuery("#askexpert-form").html(data);}
function OnErrorQuestion(data)
{jQuery("#askexpert-form").html(data);}
function SendQuestion(OrtID)
{txt=jQuery("#txtQuestion").val();TripedioOverView.SendQuestion(OrtID,txt,OnSuccessQuestion,OnErrorQuestion);TripedioOverView.LoadResponses(OrtID,OnSuccessLoad,OnErrorLoad);}
function OnSuccessLoad(data)
{jQuery("#responses").html(data);}
function OnErrorLoad(data)
{jQuery("#responses").html(data);}
function LoadResponse(OrtID)
{TripedioOverView.LoadResponses(OrtID,OnSuccessLoad,OnErrorLoad);}
var lastItem="";var lastID="";function OnSuccessLoadForm(data)
{respLength=jQuery("#new-question-"+lastID).length;jQuery("#question-"+lastID).after(data);}
function OnErrorLoadForm(data)
{alert(data);}
function LoadResponseForm(ID,ClickElement)
{lastItem="question-"+ID;lastID=ID;TripedioOverView.GetReponseForm(ID,OnSuccessLoadForm,OnErrorLoadForm)}
var RespID="";function OnSuccessExpResp(data)
{LoadResponse(ortID);}
function OnErrorExpResp(data)
{alert(data.get_message());}
function SendExpResponse(ID)
{RespID=ID;txtResponse=jQuery("#txtResponse-"+ID).val();if(txtResponse.length>10)
{TripedioOverView.SendResponse(ID,txtResponse,OnSuccessExpResp,OnErrorExpResp);}
else
{alert("Das Antwortfeld darf nicht leer sein und muss mindesten 10 Zeichen beinhalten");}}
var tips="";var baseIcon=new GIcon();baseIcon.shadow="http://www.google.com/mapfiles/shadow50.png";baseIcon.iconSize=new GSize(20,34);baseIcon.shadowSize=new GSize(37,34);baseIcon.iconAnchor=new GPoint(9,34);baseIcon.infoWindowAnchor=new GPoint(9,2);baseIcon.infoShadowAnchor=new GPoint(18,25);function OnSuccessLoadSecrets(data)
{tips=data;}
function ShowInMap(glat,glong,title,index)
{var startPoints=new GLatLng(glat,glong);map.addOverlay(createMarker(startPoints,index,title));map.panTo(startPoints);}
function TestJson()
{jQuery.each(tips,function(i,state){ShowInMap(state.Longitude,state.Latitude,state.Title,state.ID);});}
function OnErrorLoadSecrets(data)
{alert(data.get_message());}
function ShowSecretTips()
{TripedioOverView.GetSecrets(ortID,OnSuccessLoadSecrets,OnErrorLoadSecrets);}
function RateTheRating(top,id,rate_type)
{if(isLoggedIn)
{TripedioRatingService.RateTheRatings(top,id,rate_type,onILikeitSuccess,onILikeItError);}
else
{jQuery('<p>Für diese Funktion musst du eingelogged sein</p>').dialog({modal:true,title:'Login erforderlich'});}}
function createMarker(point,index,title){index=index*1+65*1;var letter=String.fromCharCode(index);var letteredIcon=new GIcon(baseIcon);letteredIcon.image="http://www.google.com/mapfiles/marker"+letter+".png";markerOptions={icon:letteredIcon};var marker=new GMarker(point,markerOptions);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml("<h2>"+title+"</h2>");});return marker;}
function LoadBookingFrame(frameType,ortName)
{var hotelFrame="http://comfort22.traffics-switch.de/tibet.php?ixp=hotel&amp;typ=H&amp;cfg=0080010130000000&amp;ref=A-22458-0&amp;hmask=1&amp;refresh=session&amp;switched=1259269386&amp;rmask=1&amp;hon="+ortName.toString()+"&amp;stp=2"
var pauschalFrame="http://comfort22.traffics-switch.de/tibet.php?ixp=pauschal&amp;typ=P&amp;cfg=0190010100000000&amp;stp=2&amp;epc=2&amp;vnd=7&amp;bsd=21&amp;tdc=&amp;mmc=0&amp;hmi=ALLE&amp;dsi=ALLE&amp;rmask=1&amp;hon="+ortName.toString()+"&amp;stc=*&amp;zac=*&amp;vpc=*&amp;ref=701550&amp;refresh=session&amp;switched=1257619299";switch(frameType){case"Hotel":callIframe(hotelFrame);break;case"Pauschal":callIframe(pauschalFrame);break;case"3":alert("Sie haben ein Dreirad gewonnen");break;case"4":alert("Gehen Sie auf allen Vieren und werden Sie bescheidener");break;default:alert("Sie bleiben leider dumm");break;}}
function callIframe(url,callback){jQuery("#testFrame").html('<iframe align="right" id="myId" width="615px" height="3540px" name="booker" marginwidth=0 marginheight=0 border="0" frameborder="0" scrolling="no">');jQuery('iframe#myId').attr('src',url);jQuery('iframe#myId').load(function()
{callback(this);});}
function callback(elem)
{}
