jQuery(document).ready(function($) {
/* var language = 'en'; */
/** Set Image-CSS for Languages **/
/*
jQuery('a#getButton').css({backgroundImage: 'url(img/'+language+'/button.gif)'});
jQuery('#exampleBg').css({backgroundImage: 'url(img/'+language+'/integration.gif)'});
*/
/** Get and set multi-lingual Pagecontent from /content **/
/*
var source = 'contents/'+language+'.html';
jQuery.getJSON(source, {}, function(page) {
jQuery('#elements').html(page.content);
});
*/
var scriptTag = '';
var button = imgTag+txtTag+scriptTag;
/* var button = '\n
\n\n'; */
jQuery('#getButton').click(function() {
jQuery(this).animate({opacity: 0}, 250, false, function() { jQuery(this).hide() });
jQuery('#exampleBg').animate({opacity: 0}, 250, false,function() {
jQuery(this).hide();
jQuery('#centerBody').animate({width: 590}, 1000, false, function() {
jQuery('#createForm, #codeField').show().animate({opacity: 1});
return false;
});
return false;
}).hide();
return false;
});
jQuery('#source_language').change(function() {
var lang_short = jQuery(this).val();
var lang_long = jQuery(this).children('option:selected').text();
if(lang_short == 'de' || lang_short == 'en' || lang_short == 'es' || lang_short == 'fr' || lang_short == 'it' || lang_short == 'pl' || lang_short == 'ru') {
lang_spez = lang_short;
} else {
lang_spez = 'es';
}
var userButton = str_replace(button, '%user_lang_short%', lang_short);
var userButton = str_replace(userButton, '%user_lang_long%', lang_long);
var userButton = str_replace(userButton, '%user_lang_spez%', lang_spez);
jQuery('textarea#code').val(userButton).focus();
});
jQuery('#code').focus(function() {
jQuery(this).select().addClass('focused');
});
jQuery('#code').blur(function() {
jQuery(this).removeClass('focused');
});
jQuery('#code').click(function() {
jQuery(this).select();
});
$('#website').focus(function() {
if($(this).val() == 'http://example.com') {
$(this).val('').css({ color: '#000' });
}
}).blur(function() {
if($(this).val() == '') {
$(this).val('http://example.com').css({ color: '#777' });
}
});
$('.submit').click(function() {
$(this).parents('form').submit();
return false;
});
window.setTimeout(function() {
$('#cursor').animate({
width: 60,
height: 76
}, function() {
$(this).animate({
top: 70,
right: 80
}, function() {
$('#getButton').addClass('hover');
$(this).animate({
right: 150
}, function() {
$('#getButton').trigger('click');
$(this).animate({
height: 60
}, 100, function() {
window.setTimeout(function(self) {
$(self).animate({
opacity: 0
}, 200);
}, 100, this);
});
});
});
});
}, 3000);
})
function str_replace(haystack, needle, replacement) {
var temp = haystack.split(needle);
return temp.join(replacement);
}