function Ghost_Popup(objName) {
this._objName = objName;
this._obj = '';
}
Ghost_Popup.prototype._objName;
Ghost_Popup.prototype._obj;
Ghost_Popup.prototype._opacity;
Ghost_Popup.prototype._opacityDiff;
Ghost_Popup.prototype._hold;
Ghost_Popup.prototype.show = function(text, fontsize, x, y, width, seconds, parent) {
// create a div dynamically
if (this._obj == '') {
var thetext = document.createTextNode(text);
var thediv = document.createElement('div');
if (width > 0) thediv.style.width = width+'px';
thediv.style.background = '#fef893';
thediv.style.color = 'black';
thediv.style.font = fontsize+'px arial';
thediv.style.top = y+'px';
thediv.style.left = x+'px';
thediv.style.position = 'absolute';
thediv.style.padding = '3px';
thediv.style.border = '1px solid #d0b160';
thediv.style.filter = 'alpha(opacity=0)';
thediv.style.opacity = '0';
thediv.style.MozOpacity = '0';
thediv.style.textAlign = 'center';
thediv.appendChild(thetext);
if (parent == '') {
var body = document.getElementsByTagName('body');
body[0].appendChild(thediv);
} else {
var parentdiv = document.getElementById(parent);
if (parentdiv) parentdiv.appendChild(thediv);
}
this._obj = thediv;
} else {
this._obj.style.font = fontsize+'px arial';
this._obj.style.top = y+'px';
this._obj.style.left = x+'px';
if (width > 0) this._obj.style.width = width+'px';
this._obj.innerHTML = text;
}
this._opacity = 0;
this._opacityDiff = 10;
this._hold = seconds*1000;
setTimeout(this._objName+'.animate();', 500);
}
Ghost_Popup.prototype.animate = function() {
// reduce the opacity
// if not zero, setTimeout again
if (this._opacityDiff > 0) {
if (this._opacity < 100) {
this._opacity += this._opacityDiff;
setTimeout(this._objName+'.animate();', 50);
} else {
this._opacity == 100;
this._opacityDiff = -10;
setTimeout(this._objName+'.animate();', this._hold);
}
} else {
if (this._opacity > 0) {
this._opacity += this._opacityDiff;
setTimeout(this._objName+'.animate();', 50);
} else {
// stop - do nothing
this._obj.style.width = '0px';
this._obj.style.left = '-10000px';
}
}
this._obj.style.filter = 'alpha(opacity='+this._opacity+')';
this._obj.style.opacity = this._opacity/100.0;
this._obj.style.MozOpacity = this._opacity/100.0;
}
// AJAX.JS
// Contains simple ajax functions.
function simple_ajax_call(url, callback_function_done) {
var xmlHttpReq = false;
var self = this;
var result = "";
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('GET', url, true);
self.xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
self.xmlHttpReq.onreadystatechange =
function () {
if (self.xmlHttpReq.readyState == 4) {
if (callback_function_done) {
callback_function_done(self.xmlHttpReq.responseText);
}
}
}
self.xmlHttpReq.send(null);
}
function simple_ajax_post(url, callback_function_loading, callback_function_done ) {
var xmlHttpReq = false;
var self = this;
var result = "";
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', url, true);
self.xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
self.xmlHttpReq.onreadystatechange =
function () {
if (self.xmlHttpReq.readyState == 1) {
if (callback_function_loading) {
callback_function_loading(self.xmlHttpReq.responseText);
}
}
if (self.xmlHttpReq.readyState == 4) {
if (callback_function_done) {
callback_function_done(self.xmlHttpReq.responseText);
}
}
}
self.xmlHttpReq.send(null);
}
function ajax_post_john(url, parameters, callback_function_loading, callback_function_done)
{
var http_request = false;
var self = this;
if (window.XMLHttpRequest)
{
self.http_request = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
try
{
self.http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
self.http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {}
}
}
if (!self.http_request)
{
alert('Cannot create XMLHTTP instance');
return false;
}
self.http_request.onreadystatechange =
function () {
if (self.http_request.readyState == 1) {
if (callback_function_loading) {
callback_function_loading(self.http_request.responseText);
}
}
if (self.http_request.readyState == 4) {
if (callback_function_done) {
callback_function_done(self.http_request.responseText);
}
}
}
self.http_request.open('POST', url, true);
self.http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
self.http_request.setRequestHeader("Content-length", parameters.length);
self.http_request.setRequestHeader("Connection", "close");
self.http_request.send(parameters);
}
function appEmbed(instanceid)
{
this.instanceid = instanceid;
this.stagewidth = 341;
this.stageheight = 256;
this.defwidth = 341;
this.defheight = 256;
this.link_logo = 'http://www.rockyou.com?type=slideshow&refid='+this.instanceid;
this.link_create = 'http://www.rockyou.com/slideshow_create.php?source=cyo&refid='+this.instanceid;
this.link_view = 'http://www.rockyou.com/show_my_gallery.php?instanceid='+this.instanceid;
this.img_logo = 'http://apps.rockyou.com/images/tail_logo.gif';
this.noSound = false;
this.noShare = false;
this.playlist_link = "";
this.type = "sl1";
this.xmlpathprefix = "";
this.ctid = "";
this.approottail = "";
this.islocal = false;
this.sizelocked = false;
this.isScale = true;
this.frengo_id = 0;
this.publish_type = 'default';
this.overridesize = function()
{
if (this.sizelocked && !this.isTvRatio())
{
if (this.stagewidth == this.defwidth)
return false;
else
return true;
}
else
return false;
}
this.appurlroot = function () {
switch (this.type)
{
case "sl2": case "sl1": default:
var frengo_param = '';
if (this.frengo_id > 0) frengo_param = '&username='+this.frengo_id;
return 'http://apps.rockyou.com/rockyou.swf?instanceid='+this.instanceid+frengo_param+'&ver=102906';
break;
case "sc1":
return 'http://apps.rockyou.com/scratch.swf?instanceid='+this.instanceid+'&ver=102906';
break;
case "fx1":
return 'http://apps.rockyou.com/text-viewer.swf?instanceid='+this.instanceid+'&'+this.approottail+'&ver=102906';
break;
case "ct1":
return 'http://apps.rockyou.com/countdown.swf?ID='+this.instanceid+'&ver=102906';
break;
}
}
this.appurlpreview = function () {return this.appurlroot()+((this.islocal)? '&xmlpath='+this.xmlpathprefix+'xmllocal':'')+'&nopanel=true'+((this.noSound)? '&nosound=true&noclick=yes':'')+((this.noShare)? '&noshare=true':'&noshare=false');}
this.appurlpublic = function () {return this.appurlroot();}
this.urltail = function () {
switch (this.type)
{
case "sl2": case "sl1": default:
return '
'+this.ctid+''+' | '+' ';
break;
}
}
this.urltail_mini = function () {
switch (this.type)
{
case "sl2": case "sl1": default:
return ' '+this.ctid+''+' '+' ';
break;
case "sc1":
return ' '+this.ctid+''+' '+' ';
break;
case "fx1":
return ' '+this.ctid+' | Create Your Own';
break;
case "ct1":
return ' '+this.ctid+''+' '+' ';
break;
}
}
this.flashvars = function () {
return (!this.isTvRatio()?' scale="noscale" ':'')+' salign="lt" '+(this.overridesize()?' flashvars="&appWidth='+this.stagewidth+'&appHeight='+this.stageheight+'" ':"");
}
this.set_playlist_link = function(url, bool)
{
if(bool) {
this.playlist_link = ''+' ';
}
}
this.setType = function(type)
{
switch (type)
{
case "slideshow":
this.link_logo = 'http://www.rockyou.com?type=slideshow&refid='+this.instanceid;;
this.link_create = 'http://www.rockyou.com/slideshow_create.php?source=cyo&refid='+this.instanceid;
this.link_view = 'http://www.rockyou.com/show_my_gallery.php?instanceid='+this.instanceid;
this.img_logo = 'http://apps.rockyou.com/images/tail_logo.gif';
this.type = "sl1";
break;
case "slider":
this.link_logo = 'http://www.rockyou.com?type=slideshow&refid='+this.instanceid;;
this.link_create = 'http://www.rockyou.com/slideshow_create.php?source=cyo&refid='+this.instanceid;
this.type = "sl2";
break;
case "scratcher":
this.link_logo = 'http://www.rockyou.com?type=scratcher&refid='+this.instanceid;;
this.link_create = 'http://www.rockyou.com/scratch-create.php?refid='+this.instanceid;
this.type = "sc1";
break;
case "fxtext":
this.link_logo = 'http://www.rockyou.com?type=fxtext&refid='+this.instanceid;;
this.link_create = 'http://www.rockyou.com/fxtext/fxtext-create.php?refid='+this.instanceid;
this.type = "fx1";
break;
case "ctimer":
this.link_logo = 'http://www.rockyou.com?type=ctimer&refid='+this.instanceid;;
this.link_create = 'http://www.rockyou.com/ctimer/create.php?refid='+this.instanceid;
this.type = "ct1";
break;
default:
this.link_logo = 'http://www.rockyou.com?type=slideshow&refid='+this.instanceid;;
this.link_create = 'http://www.rockyou.com/slideshow_create.php?source=cyo&refid='+this.instanceid;
this.type = "sl1";
break;
}
}
this.setLocal = function (local)
{
this.islocal = local;
}
this.getRatio = function ()
{
return this.stagewidth / this.stageheight;
}
this.isTvRatio = function()
{
val = this.getRatio();
if (val > 1.2 && val < 1.4)
{
return true;
}
return false;
}
this.setPixelSize = function(wd,ht)
{
this.stagewidth = wd;
this.stageheight = ht;
}
this.setBasePixelSize = function(wd,ht)
{
this.defwidth = wd;
this.defheight = ht;
this.setPixelSize(wd,ht);
this.isScale = true;
}
this.scale = function (scale)
{
this.stagewidth = Math.round(this.defwidth*scale);
this.stageheight = Math.round(this.defheight*scale);
this.isScale = true;
}
this.embedURL = function ()
{
return ( '');
}
this.embedWordPressCode = function ()
{
return ( '[rockyou id=' + this.instanceid + '&w='+this.stagewidth+'&h='+this.stageheight+']' );
}
this.embedWordPressOrgCode = function ()
{
return ( '[rockyou ' + this.instanceid + ']' );
}
/* getUBBEmbed will generate this particular type of embedding code for the slideshow. */
this.getUBBEmbed = function () {
return '[flash]'+this.appurlpublic()+'[/flash]';
}
this.getShortEmbed = function () {
return ('');
}
this.onSiteEmbedURL = function ()
{
return ( '');
}
this.insertEmbed = function (id)
{
val = this.onSiteEmbedURL();
//alert(val);
document.getElementById(id).innerHTML = val;
}
this.insertCode = function (id)
{
switch(this.publish_type) {
case "default":
val = this.embedURL();
document.getElementById(id).value = val;
break;
case "mini":
this.insertMiniCode(id);
break;
default:
val = this.embedURL();
document.getElementById(id).value = val;
break;
}
}
this.insertWordPressCode = function (id)
{
val = this.embedWordPressCode();
document.getElementById(id).value = val;
}
this.insertWordPressOrgCode = function (id)
{
val = this.embedWordPressOrgCode();
document.getElementById(id).value = val;
}
/* insertUBBCode will put the particular type of embedding code in the specific object in the page */
this.insertUBBCode = function (id)
{
val = this.getUBBEmbed();
document.getElementById(id).value = val;
}
this.insertShortCode = function (id) {
val = this.embedURL();
document.getElementById(id).value = val;
}
this.insertMiniCode = function (id) {
val = this.getShortEmbed()+this.urltail_mini();
document.getElementById(id).value = val;
}
this.getCode = function ()
{
switch(this.publish_type) {
case "default":
return this.embedURL();
break;
case "mini":
return this.getShortEmbed()+this.urltail_mini();
break;
case "old":
return this.embedURL();
break;
default:
return this.embedURL();
break;
}
}
this.insertClosedCode = function (id) {
val = this.getClosedEmbed();
document.getElementById(id).value = val;
}
this.getClosedEmbed = function () {
return ( '');
}
this.setXmlPathPrefix = function (prefix) {
this.xmlpathprefix = prefix;
}
}
function musicEmbed(instanceid)
{
this.instanceid=instanceid;
this.startSong=0;
this.songUrl="";
this.stop=false;
this.getSongUrl = function()
{
if (this.songUrl != "")
return '&songUrl='+this.songUrl;
else
return '';
}
this.getOnsiteEmbed = function () {
return '';
}
this.insertEmbed = function (id)
{
if (this.stop)
{
document.getElementById(id).innerHTML = " ";
}
else
{
val = this.getOnsiteEmbed();
document.getElementById(id).innerHTML = val;
}
//alert (val);
}
}
var ToolMan = {
events : function() {
if (!ToolMan._eventsFactory) throw "ToolMan Events module isn't loaded";
return ToolMan._eventsFactory
},
css : function() {
if (!ToolMan._cssFactory) throw "ToolMan CSS module isn't loaded";
return ToolMan._cssFactory
},
coordinates : function() {
if (!ToolMan._coordinatesFactory) throw "ToolMan Coordinates module isn't loaded";
return ToolMan._coordinatesFactory
},
drag : function() {
if (!ToolMan._dragFactory) throw "ToolMan Drag module isn't loaded";
return ToolMan._dragFactory
},
dragsort : function() {
if (!ToolMan._dragsortFactory) throw "ToolMan DragSort module isn't loaded";
return ToolMan._dragsortFactory
},
helpers : function() {
return ToolMan._helpers
},
cookies : function() {
if (!ToolMan._cookieOven) throw "ToolMan Cookie module isn't loaded";
return ToolMan._cookieOven
},
junkdrawer : function() {
return ToolMan._junkdrawer
}
}
ToolMan._helpers = {
map : function(array, func) {
for (var i = 0, n = array.length; i < n; i++) func(array[i])
},
nextItem : function(item, nodeName) {
if (item == null) return
var next = item.nextSibling
while (next != null) {
if (next.nodeName == nodeName) return next
next = next.nextSibling
}
return null
},
previousItem : function(item, nodeName) {
var previous = item.previousSibling
while (previous != null) {
if (previous.nodeName == nodeName) return previous
previous = previous.previousSibling
}
return null
},
moveBefore : function(item1, item2) {
var parent = item1.parentNode
parent.removeChild(item1)
parent.insertBefore(item1, item2)
//alert("Move Before");
},
moveAfter : function(item1, item2) {
var parent = item1.parentNode
parent.removeChild(item1)
parent.insertBefore(item1, item2 ? item2.nextSibling : null)
//alert("Move After");
}
}
/**
* scripts without a proper home
*
* stuff here is subject to change unapologetically and without warning
*/
ToolMan._junkdrawer = {
serializeList : function(list) {
var items = list.getElementsByTagName("li");
var img_array = new Array()
var comment_array = new Array()
var rating_array = new Array()
var maxrating_array = new Array()
for (var i = 0, n = items.length; i < n; i++) {
var item = items[i]
var divs = item.getElementsByTagName("div");
for (var j = 0, o = divs.length; j < o; j++) {
var div = divs[j];
if (div.className == "view")
{
if (div.hasChildNodes() && div.firstChild.nodeValue != lang_empty_caption)
comment = div.firstChild.nodeValue;
else
comment = "";
}
if (div.className == "thumb")
{
if (div.hasChildNodes())
{
img = div.firstChild.getAttribute("src");
}
else
{
img = "";
alert("Image is Blank!! Don't Save");
}
}
if (div.className == "rating") {
rating = div.innerHTML;
}
if (div.className == "maxrating") {
maxrating = div.innerHTML;
}
}
rating_array.push(rating);
maxrating_array.push(maxrating);
comment_array.push(encodeURIComponent(comment));
img_array.push(img);
}
return (n+"######"+img_array.join('||')+"######"+comment_array.join('||')+"######"+rating_array.join('||')+"######"+maxrating_array.join('||'))
},
inspectListOrder : function(id) {
return ToolMan.junkdrawer().serializeList(document.getElementById(id));
},
restoreListOrder : function(listID) {
var list = document.getElementById(listID)
if (list == null) return
var cookie = ToolMan.cookies().get("list-" + listID)
if (!cookie) return;
var IDs = cookie.split('|')
var items = ToolMan.junkdrawer()._itemsByID(list)
alert(IDs.length);
for (var i = 0, n = IDs.length; i < n; i++) {
var itemID = IDs[i]
if (itemID in items) {
var item = items[itemID]
list.removeChild(item)
list.insertBefore(item, null)
}
}
},
_identifier : function(item) {
var trim = ToolMan.junkdrawer().trim
var identifier
identifier = trim(item.getAttribute("id"))
if (identifier != null && identifier.length > 0) return identifier;
identifier = trim(item.getAttribute("itemID"))
if (identifier != null && identifier.length > 0) return identifier;
// FIXME: strip out special chars or make this an MD5 hash or something
//alert (item.innerHTML);
return trim(item.innerHTML)
},
_itemsByID : function(list) {
var array = new Array()
var items = list.getElementsByTagName('li')
for (var i = 0, n = items.length; i < n; i++) {
var item = items[i]
array[ToolMan.junkdrawer()._identifier(item)] = item
}
return array
},
trim : function(text) {
if (text == null) return null
return text.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2')
}
}
ToolMan._dragFactory = {
createSimpleGroup : function(element, handle) {
handle = handle ? handle : element
var group = this.createGroup(element)
group.setHandle(handle)
group.transparentDrag()
group.onTopWhileDragging()
return group
},
createGroup : function(element) {
var group = new _ToolManDragGroup(this, element)
var position = ToolMan.css().readStyle(element, 'position')
if (position == 'static') {
element.style["position"] = 'relative'
} else if (position == 'absolute') {
/* for Safari 1.2 */
ToolMan.coordinates().topLeftOffset(element).reposition(element)
}
// TODO: only if ToolMan.isDebugging()
group.register('draginit', this._showDragEventStatus)
group.register('dragmove', this._showDragEventStatus)
group.register('dragend', this._showDragEventStatus)
return group
},
_showDragEventStatus : function(dragEvent) {
window.status = dragEvent.toString()
},
constraints : function() {
return this._constraintFactory
},
_createEvent : function(type, event, group) {
return new _ToolManDragEvent(type, event, group)
}
}
function _ToolManDragGroup(factory, element) {
this.factory = factory
this.element = element
this._handle = null
this._thresholdDistance = 0
this._transforms = new Array()
// TODO: refactor into a helper object, move into events.js
this._listeners = new Array()
this._listeners['draginit'] = new Array()
this._listeners['dragstart'] = new Array()
this._listeners['dragmove'] = new Array()
this._listeners['dragend'] = new Array()
}
_ToolManDragGroup.prototype = {
/*
* TODO:
* - unregister(type, func)
* - move custom event listener stuff into Event library
* - keyboard nudging of "selected" group
*/
setHandle : function(handle) {
var events = ToolMan.events()
handle.toolManDragGroup = this
events.register(handle, 'mousedown', this._dragInit)
handle.onmousedown = function() { return false }
if (this.element != handle)
events.unregister(this.element, 'mousedown', this._dragInit)
},
register : function(type, func) {
this._listeners[type].push(func)
},
addTransform : function(transformFunc) {
this._transforms.push(transformFunc)
},
verticalOnly : function() {
this.addTransform(this.factory.constraints().vertical())
},
horizontalOnly : function() {
this.addTransform(this.factory.constraints().horizontal())
},
setThreshold : function(thresholdDistance) {
this._thresholdDistance = thresholdDistance
},
transparentDrag : function(opacity) {
var opacity = typeof(opacity) != "undefined" ? opacity : 0.75;
var originalOpacity = ToolMan.css().readStyle(this.element, "opacity")
this.register('dragstart', function(dragEvent) {
var element = dragEvent.group.element
element.style.opacity = opacity
element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')'
})
this.register('dragend', function(dragEvent) {
var element = dragEvent.group.element
element.style.opacity = originalOpacity
element.style.filter = 'alpha(opacity=100)'
})
},
onTopWhileDragging : function(zIndex) {
var zIndex = typeof(zIndex) != "undefined" ? zIndex : 100000;
var originalZIndex = ToolMan.css().readStyle(this.element, "z-index")
this.register('dragstart', function(dragEvent) {
dragEvent.group.element.style.zIndex = zIndex
})
this.register('dragend', function(dragEvent) {
dragEvent.group.element.style.zIndex = originalZIndex
})
},
_dragInit : function(event) {
event = ToolMan.events().fix(event)
var group = document.toolManDragGroup = this.toolManDragGroup
var dragEvent = group.factory._createEvent('draginit', event, group)
group._isThresholdExceeded = false
group._initialMouseOffset = dragEvent.mouseOffset
group._grabOffset = dragEvent.mouseOffset.minus(dragEvent.topLeftOffset)
ToolMan.events().register(document, 'mousemove', group._drag)
document.onmousemove = function() { return false }
ToolMan.events().register(document, 'mouseup', group._dragEnd)
group._notifyListeners(dragEvent)
},
_drag : function(event) {
event = ToolMan.events().fix(event)
var coordinates = ToolMan.coordinates()
var group = this.toolManDragGroup
if (!group) return
var dragEvent = group.factory._createEvent('dragmove', event, group)
var newTopLeftOffset = dragEvent.mouseOffset.minus(group._grabOffset)
// TODO: replace with DragThreshold object
if (!group._isThresholdExceeded) {
var distance =
dragEvent.mouseOffset.distance(group._initialMouseOffset)
if (distance < group._thresholdDistance) return
group._isThresholdExceeded = true
group._notifyListeners(
group.factory._createEvent('dragstart', event, group))
}
for (i in group._transforms) {
var transform = group._transforms[i]
newTopLeftOffset = transform(newTopLeftOffset, dragEvent)
}
var dragDelta = newTopLeftOffset.minus(dragEvent.topLeftOffset)
var newTopLeftPosition = dragEvent.topLeftPosition.plus(dragDelta)
newTopLeftPosition.reposition(group.element)
dragEvent.transformedMouseOffset = newTopLeftOffset.plus(group._grabOffset)
group._notifyListeners(dragEvent)
var errorDelta = newTopLeftOffset.minus(coordinates.topLeftOffset(group.element))
if (errorDelta.x != 0 || errorDelta.y != 0) {
coordinates.topLeftPosition(group.element).plus(errorDelta).reposition(group.element)
}
},
_dragEnd : function(event) {
event = ToolMan.events().fix(event)
var group = this.toolManDragGroup
try {
var dragEvent = group.factory._createEvent('dragend', event, group)
group._notifyListeners(dragEvent)
this.toolManDragGroup = null
ToolMan.events().unregister(document, 'mousemove', group._drag)
document.onmousemove = null
ToolMan.events().unregister(document, 'mouseup', group._dragEnd)
}
catch(e)
{}
},
_notifyListeners : function(dragEvent) {
var listeners = this._listeners[dragEvent.type]
for (i in listeners) {
listeners[i](dragEvent)
}
}
}
function _ToolManDragEvent(type, event, group) {
this.type = type
this.group = group
this.mousePosition = ToolMan.coordinates().mousePosition(event)
this.mouseOffset = ToolMan.coordinates().mouseOffset(event)
this.transformedMouseOffset = this.mouseOffset
this.topLeftPosition = ToolMan.coordinates().topLeftPosition(group.element)
this.topLeftOffset = ToolMan.coordinates().topLeftOffset(group.element)
}
_ToolManDragEvent.prototype = {
toString : function() {
return "mouse: " + this.mousePosition + this.mouseOffset + " " +
"xmouse: " + this.transformedMouseOffset + " " +
"left,top: " + this.topLeftPosition + this.topLeftOffset
}
}
ToolMan._dragFactory._constraintFactory = {
vertical : function() {
return function(coordinate, dragEvent) {
var x = dragEvent.topLeftOffset.x
return coordinate.x != x
? coordinate.factory.create(x, coordinate.y)
: coordinate
}
},
horizontal : function() {
return function(coordinate, dragEvent) {
var y = dragEvent.topLeftOffset.y
return coordinate.y != y
? coordinate.factory.create(coordinate.x, y)
: coordinate
}
}
}
ToolMan._dragsortFactory = {
makeSortable : function(item) {
var group = ToolMan.drag().createSimpleGroup(item)
group.register('dragstart', this._onDragStart)
group.register('dragmove', this._onDragMove)
group.register('dragend', this._onDragEnd)
return group
},
/**
* Iterates over a list's items, making them sortable, applying
* optional functions to each item.
*
* example: makeListSortable(myList, myFunc1, myFunc2, ... , myFuncN)
*/
makeListSortable : function(list) {
var helpers = ToolMan.helpers()
var coordinates = ToolMan.coordinates()
var items = list.getElementsByTagName("li")
helpers.map(items, function(item) {
var dragGroup = dragsort.makeSortable(item)
dragGroup.setThreshold(4)
var min, max
dragGroup.addTransform(function(coordinate, dragEvent) {
return coordinate.constrainTo(min, max)
})
dragGroup.register('dragstart', function() {
var items = list.getElementsByTagName("li")
min = max = coordinates.topLeftOffset(items[0])
for (var i = 1, n = items.length; i < n; i++) {
var offset = coordinates.topLeftOffset(items[i])
min = min.min(offset)
max = max.max(offset)
}
})
})
for (var i = 1, n = arguments.length; i < n; i++)
helpers.map(items, arguments[i])
},
_onDragStart : function(dragEvent) {
},
_onDragMove : function(dragEvent) {
var helpers = ToolMan.helpers()
var coordinates = ToolMan.coordinates()
var item = dragEvent.group.element
var xmouse = dragEvent.transformedMouseOffset
var moveTo = null
var previous = helpers.previousItem(item, item.nodeName)
while (previous != null) {
var bottomRight = coordinates.bottomRightOffset(previous)
if (xmouse.y <= bottomRight.y && xmouse.x <= bottomRight.x) {
moveTo = previous
}
previous = helpers.previousItem(previous, item.nodeName)
}
if (moveTo != null) {
helpers.moveBefore(item, moveTo)
var list=junkdrawer.inspectListOrder('slideshow');
updateList(list);
return
}
var next = helpers.nextItem(item, item.nodeName)
while (next != null) {
var topLeft = coordinates.topLeftOffset(next)
if (topLeft.y <= xmouse.y && topLeft.x <= xmouse.x) {
moveTo = next
}
next = helpers.nextItem(next, item.nodeName)
}
if (moveTo != null) {
helpers.moveBefore(item, helpers.nextItem(moveTo, item.nodeName))
var list=junkdrawer.inspectListOrder('slideshow');
updateList(list);
return
}
},
_onDragEnd : function(dragEvent) {
ToolMan.coordinates().create(0, 0).reposition(dragEvent.group.element);
}
}
ToolMan._coordinatesFactory = {
create : function(x, y) {
// FIXME: Safari won't parse 'throw' and aborts trying to do anything with this file
//if (isNaN(x) || isNaN(y)) throw "invalid x,y: " + x + "," + y
return new _ToolManCoordinate(this, x, y)
},
origin : function() {
return this.create(0, 0)
},
/*
* FIXME: Safari 1.2, returns (0,0) on absolutely positioned elements
*/
topLeftPosition : function(element) {
var left = parseInt(ToolMan.css().readStyle(element, "left"))
var left = isNaN(left) ? 0 : left
var top = parseInt(ToolMan.css().readStyle(element, "top"))
var top = isNaN(top) ? 0 : top
return this.create(left, top)
},
bottomRightPosition : function(element) {
return this.topLeftPosition(element).plus(this._size(element))
},
topLeftOffset : function(element) {
var offset = this._offset(element)
var parent = element.offsetParent
while (parent) {
offset = offset.plus(this._offset(parent))
parent = parent.offsetParent
}
return offset
},
bottomRightOffset : function(element) {
return this.topLeftOffset(element).plus(
this.create(element.offsetWidth, element.offsetHeight))
},
scrollOffset : function() {
if (window.pageXOffset) {
return this.create(window.pageXOffset, window.pageYOffset)
} else if (document.documentElement) {
return this.create(
document.body.scrollLeft + document.documentElement.scrollLeft,
document.body.scrollTop + document.documentElement.scrollTop)
} else if (document.body.scrollLeft >= 0) {
return this.create(document.body.scrollLeft, document.body.scrollTop)
} else {
return this.create(0, 0)
}
},
clientSize : function() {
if (window.innerHeight >= 0) {
return this.create(window.innerWidth, window.innerHeight)
} else if (document.documentElement) {
return this.create(document.documentElement.clientWidth,
document.documentElement.clientHeight)
} else if (document.body.clientHeight >= 0) {
return this.create(document.body.clientWidth,
document.body.clientHeight)
} else {
return this.create(0, 0)
}
},
/**
* mouse coordinate relative to the window (technically the
* browser client area) i.e. the part showing your page
*
* NOTE: in Safari the coordinate is relative to the document
*/
mousePosition : function(event) {
event = ToolMan.events().fix(event)
return this.create(event.clientX, event.clientY)
},
/**
* mouse coordinate relative to the document
*/
mouseOffset : function(event) {
event = ToolMan.events().fix(event)
if (event.pageX >= 0 || event.pageX < 0) {
return this.create(event.pageX, event.pageY)
} else if (event.clientX >= 0 || event.clientX < 0) {
return this.mousePosition(event).plus(this.scrollOffset())
}
},
_size : function(element) {
/* TODO: move to a Dimension class */
return this.create(element.offsetWidth, element.offsetHeight)
},
_offset : function(element) {
return this.create(element.offsetLeft, element.offsetTop)
}
}
function _ToolManCoordinate(factory, x, y) {
this.factory = factory
this.x = isNaN(x) ? 0 : x
this.y = isNaN(y) ? 0 : y
}
_ToolManCoordinate.prototype = {
toString : function() {
return "(" + this.x + "," + this.y + ")"
},
plus : function(that) {
return this.factory.create(this.x + that.x, this.y + that.y)
},
minus : function(that) {
return this.factory.create(this.x - that.x, this.y - that.y)
},
min : function(that) {
return this.factory.create(
Math.min(this.x , that.x), Math.min(this.y , that.y))
},
max : function(that) {
return this.factory.create(
Math.max(this.x , that.x), Math.max(this.y , that.y))
},
constrainTo : function (one, two) {
var min = one.min(two)
var max = one.max(two)
return this.max(min).min(max)
},
distance : function (that) {
return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2))
},
reposition : function(element) {
element.style["top"] = this.y + "px"
element.style["left"] = this.x + "px"
}
}
ToolMan._cookieOven = {
set : function(name, value, expirationInDays) {
if (expirationInDays) {
var date = new Date()
date.setTime(date.getTime() + (expirationInDays * 24 * 60 * 60 * 1000))
var expires = "; expires=" + date.toGMTString()
} else {
var expires = ""
}
document.cookie = name + "=" + value + expires + "; path=/"
},
get : function(name) {
var namePattern = name + "="
var cookies = document.cookie.split(';')
for(var i = 0, n = cookies.length; i < n; i++) {
var c = cookies[i]
while (c.charAt(0) == ' ') c = c.substring(1, c.length)
if (c.indexOf(namePattern) == 0)
return c.substring(namePattern.length, c.length)
}
return null
},
eraseCookie : function(name) {
createCookie(name, "", -1)
}
}
ToolMan._eventsFactory = {
fix : function(event) {
if (!event) event = window.event
if (event.target) {
if (event.target.nodeType == 3) event.target = event.target.parentNode
} else if (event.srcElement) {
event.target = event.srcElement
}
return event
},
register : function(element, type, func) {
if (element.addEventListener) {
element.addEventListener(type, func, false)
} else if (element.attachEvent) {
if (!element._listeners) element._listeners = new Array()
if (!element._listeners[type]) element._listeners[type] = new Array()
var workaroundFunc = function() {
func.apply(element, new Array())
}
element._listeners[type][func] = workaroundFunc
element.attachEvent('on' + type, workaroundFunc)
}
},
unregister : function(element, type, func) {
if (element.removeEventListener) {
element.removeEventListener(type, func, false)
} else if (element.detachEvent) {
if (element._listeners
&& element._listeners[type]
&& element._listeners[type][func]) {
element.detachEvent('on' + type,
element._listeners[type][func])
}
}
}
}
ToolMan._cssFactory = {
readStyle : function(element, property) {
if (element.style[property]) {
return element.style[property]
} else if (element.currentStyle) {
return element.currentStyle[property]
} else if (document.defaultView && document.defaultView.getComputedStyle) {
var style = document.defaultView.getComputedStyle(element, null)
return style.getPropertyValue(property)
} else {
return null
}
}
}
var ESCAPE = 27
var ENTER = 13
var TAB = 9
var tabMode = 0;
var coordinates = ToolMan.coordinates()
var dragsort = ToolMan.dragsort()
var junkdrawer = ToolMan.junkdrawer()
function setHandle(item) {
item.toolManDragGroup.setHandle(findHandle(item))
}
function setHandle(item) {
item.toolManDragGroup.setHandle(findHandle(item))
}
function findHandle(item) {
var children = item.getElementsByTagName("div")
for (var i = 0; i < children.length; i++) {
var child = children[i]
if (child.getAttribute("class") == null) continue
if (child.getAttribute("class").indexOf("handle") >= 0)
return child
}
return item
}
function join(name, isDoubleClick) {
var view = document.getElementById(name + "View")
view.editor = document.getElementById(name + "Edit")
var showEditor = function(event) {
event = fixEvent(event)
var view = this
var editor = view.editor
if (!editor) return true
if (editor.currentView != null) {
editor.blur()
}
editor.currentView = view
var topLeft = coordinates.topLeftOffset(view)
topLeft.reposition(editor)
if (editor.nodeName == 'TEXTAREA') {
alert("width");
editor.style['width'] = view.offsetWidth + "px"
editor.style['height'] = view.offsetHeight + "px"
}
if (view.hasChildNodes())
{
if (view.firstChild.nodeValue != lang_empty_caption)
editor.value = view.firstChild.nodeValue;
else
editor.value = "";
}
else
{
editor.value = "";
}
editor.style['visibility'] = 'visible'
view.style['visibility'] = 'hidden'
editor.focus()
return false
}
if (isDoubleClick) {
view.ondblclick = showEditor
} else {
view.onclick = showEditor
}
view.onmouseover = function(event)
{
try {
var view = event.target;
view.style.background="#FFFFCC";
} catch(e) {}
}
view.onmouseout = function(event)
{
try {
var view = event.target;
view.style.background="#EEEEEE";
} catch(e) {}
}
view.editor.onblur = function(event) {
event = fixEvent(event)
var editor = event.target
var view = editor.currentView
var viewText = view.innerHTML;
if (viewText == "[Click to Add a Caption]") viewText = "";
var textChanged = (viewText != editor.value);
if (!editor.abandonChanges && textChanged)
{
if (view.hasChildNodes())
view.removeChild(view.firstChild);
var captionIn = editor.value;
if (captionIn == "")
captionIn = lang_empty_caption;
view.appendChild(document.createTextNode(captionIn));
//view.innerHTML = editor.value;
}
editor.style['visibility'] = 'hidden'
editor.value = '' // fixes firefox 1.0 bug
view.style['visibility'] = 'visible'
var list=junkdrawer.inspectListOrder('slideshow');
if (!editor.abandonChanges && textChanged) {
updateList(list);
}
editor.currentView = null;
editor.abandonChanges = false;
return true;
}
view.editor.onkeydown = function(event) {
event = fixEvent(event)
var editor = event.target
if (event.keyCode == TAB || event.keyCode == ENTER) {
editor.blur();
// find the next slide
var editorId = parseInt(this.id);
var viewObj = document.getElementById(editorId+"View");
if (viewObj) {
var slideGroup = document.getElementById("slideshow");
if (slideGroup) {
var slides = slideGroup.getElementsByTagName("div");
var start = 0;
for (i = 0; i < slides.length; i++) {
if (start == 1 && slides[i].className == "view") {
slides[i].onclick(event);
break;
}
if (slides[i].id == editorId+"View") start = 1;
}
}
}
return false
}
}
view.editor.onkeyup = function(event) {
event = fixEvent(event)
var editor = event.target
if (event.keyCode == ESCAPE) {
editor.abandonChanges = true
editor.blur()
return false
} else if (event.keyCode == TAB) {
return false
} else {
return true
}
}
// TODO: this method is duplicated elsewhere
function fixEvent(event) {
if (!event) event = window.event
if (event.target) {
if (event.target.nodeType == 3) event.target = event.target.parentNode
} else if (event.srcElement) {
event.target = event.srcElement
}
return event
}
}
function updateTransition(id) {
currentTransition = id;
xmlhttpPost("transition_id", id);
if (currentSkin == 'http://apps.rockyou.com/skins/iphone.swf') {
if (id == "slide2" || id == "slide" || id == "photostack" || id == "photostack2") {
// do nothing, should be compatible
} else {
updateSkin('', '');
setRatio(1);
}
} else {
if (id == "slide2" || id == "slide") {
if (currentSkin != 'http://apps.rockyou.com/skins/tropicana.swf') {
updateSkin('', '');
}
setRatio(3);
} else {
//force ratio
if (!embed.isTvRatio()) {
setRatio(1);
}
}
}
setAspectRatioControls();
if (id == "photostack" || id == "photostack2") {
updateTimer(1);
}
}
function updateTheme(id) {
currentTheme = id;
setAspectRatioControls();
xmlhttpPost("theme_id", id);
}
function updateSkin(id, bg_url) {
currentSkin = id;
xmlhttpPost("skin_url", id);
if (bg_url != '') {
if (bg_url == '#000000' || bg_url == '#ffffff') {
updateBG_color(bg_url);
updateBackground('');
} else {
updateBackground(bg_url);
updateBG_color('');
}
} else {
updateBackground('');
updateBG_color('');
}
currentBackground = ''; // ignore the background added by skin, pretend it's not there.
setAspectRatioControls();
setBackgroundControls();
}
function updateBackground(id) {
if (currentSkin != '') {
currentBackground = '';
} else {
currentBackground = id;
}
if (bgColorManualSet == 0) {
xmlhttpPost("bg_color", 0);
}
setSkinControls();
setAspectRatioControls();
xmlhttpPost("background_id", id);
}
function setRatio(ratio)
{
if (!ratio) ratio = 1;
currentRatio = ratio;
skinConfig = ratio;
var new_width = embed.stagewidth;
var new_height = embed.stagewidth;
// calculate the right height
if (ratio == 1)
{
new_height = new_width * 3 /4;
}
if (ratio == 2)
{
new_height = new_width / 2;
}
if (ratio == 3)
{
new_height = new_width / 3;
}
embed.setBasePixelSize(new_width, new_height);
xmlhttpPost("set_default_publish_size", new_width+' '+new_height);
setScale(1);
setDefaultPublishSize(sizeLevel);
setShowSizeDisplay();
setSkinControls();
setBackgroundControls();
}
function setSkinControls() {
if (currentBackground != '') {
document.getElementById('skindisabled').style.display = "";
document.getElementById('skinlist').style.display = "none";
} else {
document.getElementById('skindisabled').style.display = "none";
document.getElementById('skinlist').style.display = "";
}
}
function setBackgroundControls() {
if (currentSkin == '' && currentRatio == 1)
{
document.getElementById('backgrounddisabled').style.display = "none";
document.getElementById('backgroundlist').style.display = "";
} else {
document.getElementById('backgrounddisabled').style.display = "";
document.getElementById('backgroundlist').style.display = "none";
}
}
function setSizeControls() {
document.getElementById('sizedisabled').style.display = "none";
document.getElementById('sizelist').style.display = "";
}
function setAspectRatioControls() {
if (currentTransition == "slide" || currentTransition == "slide2" || currentTransition == "photostack" || currentTransition == "photostack2") {
// aspect ratio enabled
document.getElementById('promothemes').style.display = "none";
var ratiocontrols = "";
if (currentSkin != 'http://apps.rockyou.com/skins/iphone.swf') ratiocontrols += ""+lang_slideshow_aspect_43+" | ";
if (currentBackground == '' && currentSkin != 'http://apps.rockyou.com/skins/plasma.swf' && currentSkin != 'http://apps.rockyou.com/skins/sexonthebeach.swf' && currentSkin != 'http://apps.rockyou.com/skins/theatre.swf' && currentSkin != 'http://apps.rockyou.com/theme-diamonds1.swf' && currentSkin != 'http://apps.rockyou.com/theme-diamonds4.swf') ratiocontrols += ""+lang_slideshow_aspect_21+" | ";
if (currentBackground == '' && currentSkin != 'http://apps.rockyou.com/skins/iphone.swf' && currentSkin != 'http://apps.rockyou.com/skins/plasma.swf' && currentSkin != 'http://apps.rockyou.com/skins/sexonthebeach.swf' && currentSkin != 'http://apps.rockyou.com/skins/theatre.swf' && currentSkin != 'http://apps.rockyou.com/theme-diamonds1.swf' && currentSkin != 'http://apps.rockyou.com/theme-diamonds4.swf') ratiocontrols += ""+lang_slideshow_aspect_31+" | ";
ratiocontrols += " ";
document.getElementById('ratiocontrols').innerHTML = ratiocontrols;
}
else
{
// aspect ratio disabled
document.getElementById('ratiocontrols').innerHTML = lang_slideshow_aspect_43_only;
document.getElementById('promothemes').style.display = "";
}
}
/*--------------------------------
Display Functions
---------------------------------*/
function showSections()
{
document.getElementById('slidessection').style.display="";
}
function showSliderSections()
{
document.getElementById('slidessection').style.display="";
}
function startover(source)
{
if (confirm(lang_abandon_slideshow)) {
ajax_post_john('/events/include/ajaxtrackevent.php','name=rockyou-slideshow-scratch',null,null);
window.location = "/slideshow-create.php?source="+source;
}
}
function backtomystuff()
{
if (confirm("Abandon changes and GO TO MY STUFF?")) {
beforeUnloadStatus = 0;
window.location = "/my_stuff.php";
}
}
function slidedone(usertrace)
{
// check if we indeed has at least 1 slide
var slideshow = document.getElementById('slideshow');
if (slideshow) {
if (slideshow.innerHTML.replace(' ', '') != '') {
if (slideshow.innerHTML.indexOf('http://apps.rockyou.com/images/slides/preview-1.jpg') != -1) {
alert('You can\'t save a slideshow with the default picture!');
return;
}
//doneform.action="saveshow.php?source="+source+"&instanceid="+thisinstanceid+"&usertrace="+usertrace;
doneform.action=doneform.action+"?source="+source+"&instanceid="+thisinstanceid+"&usertrace="+usertrace;
doneform.instanceid.value=thisinstanceid;
if (document.getElementById('peopleformdiv').style.display == "")
{
doneform.age.value=tagform.age.value;
doneform.sex.value=tagform.sex.value;
doneform.country.value=tagform.country.value;
doneform.postal.value=tagform.postal.value;
doneform.peoplecat.value='t';
}
doneform.tags.value=genTagList("");//tagform.category.value;
// check the learn more checkboxes
var learn_more_bebo_bands_div = document.getElementById("learn_more_bebo_bands_div");
if (learn_more_bebo_bands_div.style.display != "none") {
var learn_more_bebo_bands = document.getElementById("learn_more_bebo_bands");
if (learn_more_bebo_bands.checked) {
Set_Cookie("learn_more_bebo_bands", 1, 1);
rockyouTracker(1);
} else {
rockyouTracker(2);
}
}
if (document.getElementById("learn_more_flixster").checked) {
Set_Cookie("learn_more_flixster", 1, 1);
}
if (openWithCreateMode == 1) {
openWithCreateMode = 0;
simple_ajax_post('email/ajax_email_tracking.php?message=5&widget=slideshow&instanceid='+thisinstanceid, false, slidedone_submit);
} else {
ajax_post_john('/events/include/ajaxtrackevent.php','name=rockyou-slideshow-save',null,null);
slidedone_submit();
}
} else {
alert('Your slideshow must contain at least 1 picture!');
}
}
}
function slidedone_submit() {
// disable the button
var saveButton = document.getElementById("save_button");
var saveButton2 = document.getElementById("save_button2");
var saveButton3 = document.getElementById("save_button3");
if (saveButton) {
saveButton.style.background = "#ff6b01";
saveButton.value = "Saving...";
saveButton.disabled = true;
}
if (saveButton2) {
saveButton2.style.background = "#ff6b01";
saveButton2.value = "Saving...";
saveButton2.disabled = true;
}
if (saveButton3) {
saveButton3.style.background = "#ff6b01";
saveButton3.value = "Saving...";
saveButton3.disabled = true;
}
doneform.submit();
}
function showPeopleForm(container, cattype)
{
var peopleForm = document.getElementById('peopleformdiv');
if (cattype.indexOf('ppl') > -1)
{
peopleForm.parentNode.removeChild(peopleForm);
container.parentNode.insertBefore(peopleForm,container.nextSibling);
peopleForm.style.display="";
if (cattype.length==5)
selectThis(cattype.charAt(4), tagform.sex);
}
else
peopleForm.style.display="none";
}
/*--------------------------------
AJAX Functions
---------------------------------*/
function refreshList()
{
xmlhttpPost("refreshlist", "");
}
function getProgress(jobid)
{
xmlhttpPostURL("getProgress", "","/upload/progress.cgi?jobid="+jobid);
}
function updateTimer(id)
{
xmlhttpPost("timer", id);
document.getElementById("transition_speed").selectedIndex = parseInt(id)-1;
}
function updateList(list)
{
//alert (list);
xmlhttpPost("newlist",list);
//alert ("Update List");
}
function updateCaption(id)
{
xmlhttpPost("caption_id", id);
}
function updateSharep(id)
{
if (id)
{
id = "1";
}
else
{
id = "0";
}
doneform.sharep.value=id;
xmlhttpPost("sharep", id);
}
function updatePin(id)
{
xmlhttpPost("pin_id", id);
}
function updateEffect(id)
{
xmlhttpPost("effect_id", id);
}
function updateOrder(id)
{
if (id)
{
xmlhttpPost("order", "random");
}
else
{
xmlhttpPost("order", "sequential");
}
}
function setVideoURL(id)
{
xmlhttpPost("intro_url", id);
}
function updateSekret(id)
{
xmlhttpPost("theme_sekret", id);
}
function updateText_color(color)
{
xmlhttpPost("text_color", color);
}
function updatePanel_color(color)
{
xmlhttpPost("panel_color", color);
}
function updateBG_color(color)
{
bgColorManualSet = 1;
xmlhttpPost("bg_color", color);
}
function updateBgVideo(id)
{
xmlhttpPost("bgvid_url", id);
}
function updateTransparency(amount)
{
xmlhttpPost("panel_transparency", amount);
}
function updateFontsize(size)
{
xmlhttpPost("text-size", size);
}
function addSong(id, powered, artist)
{
// check if we should offer the learn more options for bebo bands
if (pitchLearnMoreBeboBands && powered.indexOf("Bebo") == 0) {
var learn_more_bebo_bands_div = document.getElementById("learn_more_bebo_bands_div");
artist_name = artist.replace(/\+/g, ' ');
// if yes, show the check box and preset to checked.
if (learn_more_bebo_bands_div.style.display == "none") {
learn_more_bebo_bands_div.style.display = "block";
learn_more_bebo_bands_div.innerHTML = ' Hear more from '+artist_name+'';
} else {
if (learn_more_bebo_bands_div.innerHTML.indexOf(artist_name) < 0) {
learn_more_bebo_bands_div.innerHTML += ', ' + artist_name + '';
}
}
}
statusAddingSong = true;
membed.songUrl = "";
xmlhttpPost("add_song", id);
beforeUnloadStatus = 0;
beforeUnloadStatusEnabled = 0;
}
function getcookie(cookiename) {
var cookiestring = ""+document.cookie;
var index1 = cookiestring.indexOf(cookiename);
if (index1 == -1 || cookiename == "") return "";
var index2 = cookiestring.indexOf(';', index1);
if (index2 == -1) index2 = cookiestring.length;
return unescape(cookiestring.substring(index1+cookiename.length+1, index2));
}
// Note on adding presets: When there is no skin, you must still call updateSkin('',''); so that the previous skin is removed.
// If setting a background url, use updateSkin('',bg_url); and omit the call to updateBackground.
function setQuickStyle(style)
{
showSTab('themes');
xmlBatchModeOn();
switch(style)
{
case 'festive':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-festive.swf');
updateTheme('theme-festive');
showSTab('music');
updateText_color('#a4071e');
updatePanel_color('#FFFFFF');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("", "", "");
updateTimer(1);
break;
case 'holiday':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-christmas.swf');
updateTheme('theme-snowflake');
showSTab('transitions');
updateText_color('#2321A3');
updatePanel_color('#FFFFFF');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("", "", "");
updateTimer(1);
break;
case 'snowboard':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-snowboard.swf');
updateTheme('theme-snowboard');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#AEE5F2');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("", "", "");
updateTimer(1);
break;
case 'leaves':
setRatio(1);
updateTransition('circles');
updateSkin('', 'http://apps.rockyou.com/bg-leaves.swf');
updateTheme('theme-leaves');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#F0340A');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("", "", "");
updateTimer(1);
break;
case 'mattwertz':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-mattwertz.swf');
updateTheme('theme-mattwertz');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('dropIn');
addSong("648", "", "Matt+Wertz");
updateTimer(1);
break;
case 'fangs':
setRatio(1);
updateTransition('gallery');
updateSkin('', 'http://apps.rockyou.com/bg-fangs.swf');
updateTheme('theme-fangs');
showSTab('music');
updateText_color('#FA0213');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('dropIn');
addSong("643", "", "Musicshake");
updateTimer(1);
break;
case 'halloween':
setRatio(1);
updateTransition('photostack2');
updateSkin('http://apps.rockyou.com/skins/halloween3.swf', 'http://apps.rockyou.com/bg-halloween.swf');
updateTheme('');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#FAED00');
if (getcookie('lang') == 'en') updateCaption('dropIn');
addSong("644", "", "Musicshake");
updateTimer(1);
break;
case 'superpetspup':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-dog.swf');
updateTheme('theme-dog');
showSTab('transitions');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
break;
case 'braziliangirls':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-braziliangirls.swf');
updateTheme('theme-braziliangirls');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("497", "", "Brazilian+Girls");
updateTimer(1);
break;
case 'johnbodysband':
setRatio(1);
updateTransition('rings');
updateSkin('', 'http://apps.rockyou.com/bg-johnbodysband.swf');
updateTheme('theme-johnbodysband');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
break;
case 'coolio':
setRatio(1);
updateTransition('geometric');
updateSkin('', 'http://apps.rockyou.com/bg-coolio.swf');
updateTheme('theme-coolio');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
break;
case 'tokiohotel':
setRatio(1);
updateTransition('rings');
updateSkin('', 'http://apps.rockyou.com/bg-tokiohotel.swf');
updateTheme('theme-tokiohotel');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("636", "", "Tokio+Hotel");
updateTimer(1);
break;
case 'kidzinthehall':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-kidzinthehall.swf');
updateTheme('theme-kidzinthehall');
showSTab('transitions');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
addSong("625", "", "Kidz+in+the+Hall");
updateTimer(1);
break;
case 'skulls':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-skulls.swf');
updateBG_color('#be1e2d');
updateTheme('theme-skulls');
showSTab('music');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
break;
case 'party':
setRatio(1);
updateTransition('photostack2');
updateSkin('', 'http://apps.rockyou.com/bg-glitterparty2.swf');
updateTheme('theme-glitterparty2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateTimer(1);
showSTab('music');
break;
case 'diamonds':
setRatio(1);
updateTransition('flip');
updateTheme('theme-diamonds2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateSkin('http://apps.rockyou.com/theme-diamonds1.swf', '')
updateBG_color('#000000');
showSTab('themes');
break;
case 'blingskin':
setRatio(1);
updateTransition('multistar');
updateTheme('theme-diamonds2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateSkin('http://apps.rockyou.com/theme-diamonds4.swf', '')
showSTab('themes');
break;
case 'danitykane':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-danitykane.swf');
updateTransition('photostack2');
updateTheme('theme-danitykane');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'pitbull':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-pitbull.swf');
updateTransition('flip');
updateTheme('theme-pitbull2');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
addSong("426", "", "Pitbull");
updateTimer(1);
showSTab('themes');
break;
case 'lilkim':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-lilkim.swf');
updateTransition('sliding');
updateTheme('theme-lilkim2');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'justintimberlake':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-justintimberlake.swf');
updateTransition('rotating');
updateTheme('theme-justintimberlake');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
addSong("393", "", "Justin+Timberlake");
showSTab('themes');
break;
case 'heartartist':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-heartartist.swf');
updateTransition('photostack2');
updateTheme('theme-heartartist');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
addSong("410", "", "Heart");
showSTab('themes');
break;
case 'usher':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-usher.swf');
updateTransition('flip');
updateTheme('theme-usher');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'inine':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-inine.swf');
updateTransition('photostack2');
updateTheme('theme-inine');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
addSong("413", "", "I+Nine");
showSTab('themes');
break;
case 'britney':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-britney.swf');
updateTransition('flip');
updateTheme('theme-britney');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
addSong("397", "", "Britney+Spears");
showSTab('themes');
break;
case 'evanescense':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-evanescense.swf');
updateTransition('photostack2');
updateTheme('theme-evanescense');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'buckcherry':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-buckcherry.swf');
updateTransition('carousel2');
updateTheme('theme-buckcherry');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'lovearcade':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-lovearcade.swf');
updateTransition('sliding');
updateTheme('theme-lovearcade');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'gunit':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-gunit.swf');
updateTransition('rotating');
updateTheme('theme-gunit');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'lilmama':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-lilmama.swf');
updateTransition('photostack2');
updateTheme('theme-lilmama');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
addSong("396", "", "Lil+Mama");
showSTab('themes');
break;
case 'korn':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-korn.swf');
updateTransition('photostack2');
updateTheme('theme-korn');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'photostack':
setRatio(1);
updateSkin('', '');
updateTransition('photostack2');
updateTheme('theme-glitterParticle');
updateText_color('#FFFFFF');
updatePanel_color('#33CCFF');
if (getcookie('lang') == 'en') updateCaption('dropIn');
updateBG_color('#000000');
updatePin('');
updateTimer(1);
showSTab('themes');
break;
case 'hearts':
setRatio(1);
updateSkin('', '');
updateTransition('heart');
updateTheme('theme-valentines1');
updateText_color('#FFFFFF');
updatePanel_color('#FF0000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateBG_color('');
updateTimer(1);
updatePin('');
showSTab('themes');
break;
case 'gallery':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-lines2.swf');
updateTransition('gallery');
updateTheme('');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateBG_color('#000000');
updateTimer(2);
updatePin('');
showSTab('themes');
break;
/*case 'revolver':
setRatio(1);
updateSkin('', '');
updateTransition('carousel2');
updateTheme('sparkle2');
updateText_color('#FFFFFF');
updatePanel_color('#50EEFF');
updateBG_color('#000000');
updateTimer(1);
updatePin('');
updateBackground('');
showSTab('themes');
break;*/
case 'plasma':
setRatio(1);
//updateTransition('logomap');
updateTransition('multistar');
updateTheme('sparkle2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
//updateBG_color('');
updateTimer(1);
updatePin('');
//updateBackground('http://apps.rockyou.com/bg-plasma.swf');
updateSkin('http://apps.rockyou.com/skins/plasma.swf', 'http://apps.rockyou.com/bg-plasma.swf')
showSTab('themes');
break;
case 'sexonthebeach':
setRatio(1);
updateTransition('photostack2');
updateTheme('sparkle2');
updateText_color('#FFFFFF');
updatePanel_color('#213e76');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
//updateBG_color('');
updateTimer(1);
updatePin('');
//updateBackground('http://apps.rockyou.com/bg-sand.swf');
updateSkin('http://apps.rockyou.com/skins/sexonthebeach.swf', 'http://apps.rockyou.com/bg-sand.swf')
showSTab('themes');
break;
case 'iphone':
updateTransition('slide');
//updateTheme('glitter6');
updateText_color('#000000');
updatePanel_color('#FFFFFF');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
//updateBG_color('#000000');
updateTimer(2);
updatePin('');
setRatio(2);
updateSkin('http://apps.rockyou.com/skins/iphone.swf', 'http://apps.rockyou.com/bg-iphone.swf');
showSTab('themes');
break;
case 'kanye':
setRatio(1);
updateTransition('gun');
updateTheme('sparkle2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateSkin('http://apps.rockyou.com/skins/kanye.swf', 'http://apps.rockyou.com/bg-kanye.swf')
showSTab('themes');
addSong("370", "", "Kanye+West");
break;
case 'hairspray':
setRatio(1);
updateTransition('multistar');
updateTheme('sparkle2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateSkin('http://apps.rockyou.com/theme-hairspray.swf', '')
showSTab('themes');
addSong("399", "", "Hairspray");
break;
case 'krista':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-krista3.swf');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-krista3');
addSong("491", "", "Krista");
showSTab('transitions');
break;
case 'jordinchris':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-jordinsparkscb.swf');
updateTransition('carousel2');
updateText_color('#6c4972');
updatePanel_color('#FFFFFF');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-jordinsparkscb');
addSong("453", "", "Jordin+Sparks+feat+Chris+Brown");
showSTab('transitions');
break;
case 'couture':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-chic.swf');
updateTransition('sliding');
updateText_color('#FFFFFF');
updatePanel_color('#08A9D1');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-girly4-new');
addSong("457", "", "Sara Bareilles");
showSTab('music');
break;
case 'lilwayne':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-lilwayne.swf');
updateTransition('photostack');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-lilwayne');
addSong("456", "", "Lil Wayne");
showSTab('music');
break;
case 'carolinaliar':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-carolinaliar.swf');
updateTransition('photostack');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-carolinaliar');
addSong("471", "", "Carolina Liar");
showSTab('music');
break;
case 'thedey':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-thedey3.swf');
updateTransition('photostack');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-thedey3');
addSong("459", "", "The Dey");
showSTab('music');
break;
case 'seankingston':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-seankingston.swf');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-seankingston');
addSong("488", "", "Sean Kingston");
showSTab('transitions');
break;
case 'natashabedingfield':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-natashabedingfield.swf');
updateTransition('multistar');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-natashabedingfield');
addSong("460", "", "Natasha Bedingfield");
showSTab('transitions');
break;
case 'sarabareilles':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-sarabareilles2.swf');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-sarabareilles2');
addSong("457", "", "Sara Bareilles");
showSTab('music');
break;
case 'shawtylo':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-shawtylo.swf');
updateTransition('carousel2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-shawtylo');
addSong("478", "", "Shawty Lo");
showSTab('music');
break;
case 'summertime':
setRatio(1);
updateSkin('', 'http://apps.rockyou.com/bg-summertime.swf');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('theme-summertime');
addSong("", "", "");
showSTab('music');
break;
case 'graduate':
setRatio(1);
updateSkin('', '');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateTheme('bg-graduation');
addSong("488", "", "Sean Kingston");
showSTab('music');
break;
case 'zacbrown':
setRatio(1);
updateSkin('', '');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateBackground('http://apps.rockyou.com/bg-zacbrownband.swf');
updateTheme('theme-zacbrownband');
addSong("492", "", "Zac Brown");
showSTab('music');
break;
case 'tilatequila':
setRatio(1);
updateSkin('', '');
updateTransition('photostack2');
updateText_color('#FFFFFF');
updatePanel_color('#000000');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateBackground('http://apps.rockyou.com/bg-tilatequila2.swf');
updateTheme('theme-tilatequila2');
addSong("496", "", "Tila Tequila");
showSTab('music');
break;
/* case 'halloween':
setRatio(1);
updateTransition('photostack2');
updateTheme('');
updateText_color('#FFFFFF');
updatePanel_color('#CCCCCC');
if (getcookie('lang') == 'en') updateCaption('zoomOut');
updateTimer(1);
updatePin('');
updateSkin('http://apps.rockyou.com/skins/halloween3.swf', 'http://apps.rockyou.com/bg-halloween.swf')
showSTab('themes');
break;
*/
}
xmlBatchModeOff();
//xmlhttpPost("quick_style", style);
refreshSlideShow();
}
function addQuickSong(songid, powered, artist)
{
addThisSong = confirm("This Style Comes with a Song. Do You Want to Add It?");
if (addThisSong)
{
addSong(songid, powered, artist);
}
}
function setShowSize(wd, ht)
{
xmlhttpPost("show-size", wd+"_"+ht);
setShowSizeDisplay();
}
function setShowSizeDisplay()
{
if (!embed.isTvRatio())
{
//setRatio(1);
//hide themes and pins
document.getElementById('themelist').style.display="none";
//document.getElementById('pinlist').style.display="none";
document.getElementById('themedisabled').style.display="";
//document.getElementById('pinsdisabled').style.display="";
}
else
{
document.getElementById('themelist').style.display="";
//document.getElementById('pinlist').style.display="";
document.getElementById('themedisabled').style.display="none";
//document.getElementById('pinsdisabled').style.display="none";
}
}
function addTags(tags)
{
tags = genTagList(tags);
xmlhttpPost("add_tags", tags);
tagform.taginput.value = "";
}
function genTagList(tags)
{
if (tagListArray != undefined && tagListArray != "")
{
for (var i = 0; i < tagListArray.length; i++) {
tags = tags + " \"" + tagListArray[i]+"\"";
}
}
return tags;
}
function delTag(tagid)
{
tagListArray.splice(tagid,1);
tagList(tagListArray);
//xmlhttpPost("del_tag", tagid);
}
function delSong(index)
{
var music_notification = document.getElementById("music_notification");
if (music_notification) {
music_notification.innerHTML = "";
}
xmlhttpPost("del_song", index);
}
function clearSongs() {
var music_notification = document.getElementById("music_notification");
if (music_notification) {
music_notification.innerHTML = "";
}
xmlhttpPost("clear_song", 0);
}
function getTags()
{
xmlhttpPost("get_tags");
}
function setCat(catid)
{
doneform.category.value = catid;
//xmlhttpPost("set_cat", catid);
}
/*--------------------------------
Convenience Functions
---------------------------------*/
function selectThis(val, selectBox)
{
for (i=0 ; i < selectBox.options.length ; i++)
{
if (selectBox.options[i].value == val)
{
selectBox.selectedIndex = i;
}
}
}
function deletethis (e) {
if (!e) var e = window.event;
var tg = (e.target) ? e.target : e.srcElement
var where_to= confirm(lang_upload_confirm_delete_slide);
if(where_to==true)
{
removeObj(tg.parentNode);
}
var b=junkdrawer.inspectListOrder('slideshow');
updateList(b);
}
function removeObj(tr){
tr.parentNode.removeChild(tr);
}
function clear_captions() {
if (confirm(lang_remove_all_captions)) {
var list = junkdrawer.inspectListOrder('slideshow');
xmlhttpPost("newlist_clearcaptions", list);
}
}function printCountrySelect(elem)
{
var countryArray = [
["0","None"],
["754","United States"],
["966","United Kingdom"],
["914","Philippines"],
["885","Mexico"],
["849","Indonesia"],
["913","Peru"],
["767","Australia"],
["755","Afghanistan"],
["756","Albania"],
["757","Algeria"],
["758","American Samoa"],
["759","Andorra"],
["760","Angola"],
["761","Anguilla"],
["762","Antarctica"],
["763","Antigua and Barbuda"],
["764","Argentina"],
["765","Armenia"],
["766","Aruba"],
["767","Australia"],
["768","Austria"],
["769","Azerbaijan"],
["770","Bahamas"],
["771","Bahrain"],
["772","Bangladesh"],
["773","Barbados"],
["774","Belarus"],
["775","Belgium"],
["776","Belize"],
["777","Benin"],
["778","Bermuda"],
["779","Bhutan"],
["780","Bolivia"],
["781","Bosnia and Herzegowina"],
["782","Botswana"],
["783","Bouvet Island"],
["784","Brazil"],
["785","British Indian Ocean Territory"],
["786","Brunei Darussalam"],
["787","Bulgaria"],
["788","Burkina Faso"],
["789","Burundi"],
["790","Cambodia"],
["791","Cameroon"],
["792","Canada"],
["793","Cape Verde"],
["794","Cayman Islands"],
["795","Central African Republic"],
["796","Chad"],
["797","Chile"],
["798","China"],
["799","Christmas Island"],
["800","Cocoa (Keeling) Islands"],
["801","Colombia"],
["802","Comoros"],
["803","Congo"],
["804","Cook Islands"],
["805","Costa Rica"],
["806","Cote Divoire"],
["807","Croatia (Hrvatska)"],
["808","Cuba"],
["809","Cyprus"],
["810","Czech Republic"],
["811","Denmark"],
["812","Djibouti"],
["813","Dominica"],
["814","Dominican Republic"],
["815","East Timor"],
["816","Ecuador"],
["817","Egypt"],
["818","El Salvador"],
["819","Equatorial Guinea"],
["820","Eritrea"],
["821","Estonia"],
["822","Ethiopia"],
["823","Falkland Islands (Malvinas)"],
["824","Faroe Islands"],
["825","Fiji"],
["826","Finland"],
["827","France"],
["828","Gabon"],
["829","Gambia"],
["830","Georgia"],
["831","Germany"],
["832","Ghana"],
["833","Gibraltar"],
["834","Greece"],
["835","Greenland"],
["836","Grenada"],
["837","Guam"],
["838","Guatemala"],
["839","Guinea"],
["840","Guinea-Bissau"],
["841","Guyana"],
["842","Haiti"],
["843","Heard and Mc Donald Islands"],
["844","Honduras"],
["845","Hong Kong"],
["846","Hungary"],
["847","Iceland"],
["848","India"],
["849","Indonesia"],
["850","Iran (Islamic Republic of)"],
["851","Iraq"],
["852","Ireland"],
["853","Israel"],
["854","Italy"],
["855","Jamaica"],
["856","Japan"],
["857","Jordan"],
["858","Kazakhstan"],
["859","Kenya"],
["860","Kiribati"],
["861","Korea, Democratic Peoples Republic of"],
["862","Korea, Republic of"],
["863","Kuwait"],
["864","Kyrgyzstan"],
["865","Lao Peoples Democratic Republic"],
["866","Latvia"],
["867","Lebanon"],
["868","Lesotho"],
["869","Liberia"],
["870","Libyan Arab Jamahiriya"],
["871","Liechtenstein"],
["872","Lithuania"],
["873","Luxembourg"],
["874","Macau"],
["875","Macedonia, The Former Yugoslav Republic of"],
["876","Madagascar"],
["877","Malawi"],
["878","Malaysia"],
["879","Maldives"],
["880","Mali"],
["881","Malta"],
["882","Marshall Islands"],
["883","Mauritania"],
["884","Mauritius"],
["885","Mexico"],
["886","Micronesia, Federated States of"],
["887","Moldova, Republic of"],
["888","Monaco"],
["889","Mongolia"],
["890","Montserrat"],
["891","Morocco"],
["892","Mozambique"],
["893","Myanmar"],
["894","Namibia"],
["895","Nauru"],
["896","Nepal"],
["897","Netherlands"],
["898","Netherlands Antilles"],
["899","New Zealand"],
["900","Nicaragua"],
["901","Niger"],
["902","Nigeria"],
["903","Niue"],
["904","Norfolk Island"],
["905","Northern Mariana Islands"],
["906","Norway"],
["907","Oman"],
["908","Pakistan"],
["909","Palau"],
["910","Panama"],
["911","Papua New Guinea"],
["912","Paraguay"],
["913","Peru"],
["915","Pitcairn"],
["916","Poland"],
["917","Portugal"],
["918","Puerto Rico"],
["919","Qatar"],
["920","Romania"],
["921","Russian Federation"],
["922","Rwanda"],
["923","Saint Kitts and Nevis"],
["924","Saint Lucia"],
["925","Saint Vincent and the Grenadines"],
["926","Samoa"],
["927","San Marino"],
["928","Sao Tome and Principe"],
["929","Saudi Arabia"],
["930","Senegal"],
["931","Seychelles"],
["932","Sierra Leone"],
["933","Singapore"],
["934","Slovakia (Slovak Republic)"],
["935","Slovenia"],
["936","Solomon Islands"],
["937","Somalia"],
["938","South Africa"],
["939","South Georgia and the South Sandwich Islands"],
["940","Spain"],
["941","Sri Lanka"],
["942","St. Helena"],
["943","Sudan"],
["944","Suriname"],
["945","Svalbard and Jan Mayen Islands"],
["946","Swaziland"],
["947","Sweden"],
["948","Switzerland"],
["949","Syrian ArabRepublic"],
["950","Taiwan"],
["951","Tajikistan"],
["952","Tanzania, United Republic of"],
["953","Thailand"],
["954","Togo"],
["955","Tokelau"],
["956","Tonga"],
["957","Trinidad and Tobago"],
["958","Tunisia"],
["959","Turkey"],
["960","Turkmenistan"],
["961","Turks and Caicos Islands"],
["962","Tuvalu"],
["963","Uganda"],
["964","Ukraine"],
["965","United ArabEmirates"],
["967","United States Minor Outlying Islands"],
["968","Uruguay"],
["969","Uzbekistan"],
["970","Vanuatu"],
["971","Vatican City State(Holy See)"],
["972","Venezuela"],
["973","Viet Nam"],
["974","Virgin Islands (British)"],
["975","Virgin Islands (U.S.)"],
["976","Western Sahara"],
["977","Yeman"],
["978","Yugoslavia"],
["979","Zaire"],
["980","Zambia"],
["981","Zimbabwe"]];
for (i=0;i=a && v<=z)?true:false); }
function XY(e,v) { var z=browser('msie')?Array(event.clientX+document.body.scrollLeft,event.clientY+document.body.scrollTop):Array(e.pageX,e.pageY); return(z[zero(v)]); }
function zero(v) { v=parseInt(v); return(!isNaN(v)?v:0); }
function zindex(d) { d.style.zIndex=zINDEX++; }
/* PLUGIN */
var maxValue={'h':'359','s':'100','v':'100'},HSV={0:359,1:100,2:100};
var SVHeight=165,wSV=162,wH=162,slideHSV={0:359,1:100,2:100},zINDEX=15,stop=1;
function HSVslide(d,o,e) {
function tXY(e) { tY=XY(e,1)-top; tX=XY(e)-left; }
function mkHSV(a,b,c) { return(Math.min(a,Math.max(0,Math.ceil((parseInt(c)/b)*a)))); }
function ckHSV(a,b) { if(within(a,0,b)) return(a); else if(a>b) return(b); else if(a<0) return('-'+oo); }
function drag(e) { if(!stop) {
if(d=='SVslide') { tXY(e); ds.left=ckHSV(tX-oo,wSV)+'px'; ds.top=ckHSV(tY-oo,wSV)+'px';
slideHSV[1]=mkHSV(100,wSV,ds.left); slideHSV[2]=100-mkHSV(100,wSV,ds.top); HSVupdate();
}
else if(d=='Hslide') {
tXY(e); ds.top=(ckHSV(tY-oo,wH)-5)+'px'; slideHSV[0]=mkHSV(359,wH,ds.top);
function commit() { var r='hsv',z={},j='';
for(var i=0; i<=r.length-1; i++) { j=r.substr(i,1); z[i]=(j=='h')?maxValue[j]-mkHSV(maxValue[j],wH,ds.top):HSV[i]; }
return(HSVupdate(hsv2hex(z)));
}
mkColor(commit()); $S('SV').backgroundColor='#'+hsv2hex(Array(HSV[0],100,100));
}
else if(d=='drag') { ds.left=XY(e)+oX-eX+'px'; ds.top=XY(e,1)+oY-eY+'px'; }
}}
if(stop) { stop=''; var ds=$S(d!='drag'?d:o);
if(d=='drag') { var oX=parseInt(ds.left), oY=parseInt(ds.top), eX=XY(e), eY=XY(e,1); zindex(get(o)); }
else { var left=(get(o).offsetLeft+10), top=(get(o).offsetTop+22), tX, tY, oo=(d=='Hslide')?2:4; if(d=='SVslide') slideHSV[0]=HSV[0]; }
document.onmousemove=drag; document.onmouseup=function(){ stop=1; document.onmousemove=''; document.onmouseup=''; }; drag(e);
}
}
function HSVupdate(v) { HSV=v?hex2hsv(v):Array(slideHSV[0],slideHSV[1],slideHSV[2]);
if(!v) v=hsv2hex(Array(slideHSV[0],slideHSV[1],slideHSV[2]));
mkColor(v); get('plugHEX').innerHTML=v; return(v);
}
function loadSV() {
var z='';
for(var i=SVHeight; i>=0; i--) z+=" <\/div>";
get('Hmodel').innerHTML=z;
}
function updateH(v) { HSV=hex2hsv(v);
$S('SV').backgroundColor='#'+hsv2hex(Array(HSV[0],100,100));
$S('SVslide').top=(parseInt(wSV-wSV*(HSV[2]/100))-4)+'px'; $S('SVslide').left=parseInt(wSV*(HSV[1]/100))+'px';
$S('Hslide').top=(parseInt(wH*((maxValue['h']-HSV[0])/maxValue['h']))-7)+'px';
}
/* CONVERSIONS */
function toHex(v) { v=Math.round(Math.min(Math.max(0,v),255)); return("0123456789ABCDEF".charAt((v-v%16)/16)+"0123456789ABCDEF".charAt(v%16)); }
function hex2rgb(r) { return({0:parseInt(r.substr(0,2),16),1:parseInt(r.substr(2,2),16),2:parseInt(r.substr(4,2),16)}); }
function rgb2hex(r) { return(toHex(r[0])+toHex(r[1])+toHex(r[2])); }
function hsv2hex(h) { return(rgb2hex(hsv2rgb(h))); }
function hex2hsv(v) { return(rgb2hsv(hex2rgb(v))); }
function rgb2hsv(r) { // easyrgb.com/math.php?MATH=M20#text20
var max=Math.max(r[0],r[1],r[2]),delta=max-Math.min(r[0],r[1],r[2]),H,S,V;
if(max!=0) { S=Math.round(delta/max*100);
if(r[0]==max) H=(r[1]-r[2])/delta; else if(r[1]==max) H=2+(r[2]-r[0])/delta; else if(r[2]==max) H=4+(r[0]-r[1])/delta;
var H=Math.min(Math.round(H*60),360); if(H<0) H+=360;
}
return({0:H?H:0,1:S?S:0,2:Math.round((max/255)*100)});
}
function hsv2rgb(r) { // easyrgb.com/math.php?MATH=M21#text21
var R,B,G,S=r[1]/100,V=r[2]/100,H=r[0]/360;
if(S>0) { if(H>=1) H=0;
H=6*H; F=H-Math.floor(H);
A=Math.round(255*V*(1.0-S));
B=Math.round(255*V*(1.0-(S*F)));
C=Math.round(255*V*(1.0-(S*(1.0-F))));
V=Math.round(255*V);
switch(Math.floor(H)) {
case 0: R=V; G=C; B=A; break;
case 1: R=B; G=V; B=A; break;
case 2: R=A; G=V; B=C; break;
case 3: R=A; G=B; B=V; break;
case 4: R=C; G=A; B=V; break;
case 5: R=V; G=A; B=B; break;
}
return({0:R?R:0,1:G?G:0,2:B?B:0});
}
else return({0:(V=Math.round(V*255)),1:V,2:V});
}
|