/* Copyright (C) 2007 - 2011 YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

(function(d){var a=function(){};d.extend(a.prototype,{name:"ElementVideo",options:{file:".file",url:".url"},initialize:function(a,b){this.options=d.extend({},this.options,b);var c=this;this.element=a;this.file=a.find(this.options.file+":first");this.url=a.find(this.options.url+":first");this.file_button=a.find("div.trigger div.file");this.url_button=a.find("div.trigger div.url");this.url.parent().css("margin-top","0");this.file.val()?this.showFile():this.showUrl();this.file_button.bind("click",function(){c.showFile()});
this.url_button.bind("click",function(){c.showUrl()})},showFile:function(){this.file.parent().show();this.url.parent().hide();this.file_button.hide();this.url_button.show()},showUrl:function(){this.file.parent().hide();this.url.parent().show();this.file_button.show();this.url_button.hide()}});d.fn[a.prototype.name]=function(){var e=arguments,b=e[0]?e[0]:null;return this.each(function(){var c=d(this);if(a.prototype[b]&&c.data(a.prototype.name)&&b!="initialize")c.data(a.prototype.name)[b].apply(c.data(a.prototype.name),
Array.prototype.slice.call(e,1));else if(!b||d.isPlainObject(b)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,d.merge([c],e));c.data(a.prototype.name,f)}else d.error("Method "+b+" does not exist on jQuery."+a.name)})}})(jQuery);
