var win = null;
var index = 1;
function openDialog(id,w,h) {
    Dialog.alert($(id).innerHTML, {className: "alphacube",  width:w, height:h, id: "d" + index})
    index++;
	//document.getElementById('videoHidder').style.display = 'none';
}

function lastDialog(id) {
    Dialog.confirm($(id).innerHTML, {className: "alphacube",  width:250, okLabel: "Close All", ok: closeAllModalWindows})
}

function closeAllModalWindows() {
    Windows.closeAllModalWindows();
    //return true;
	//document.getElementById('videoHidder').style.display = 'inline';
}


function swapImage(pictureId){
	var ssContainer = document.getElementById('largeScreenShot');
    ssContainer.innerHTML = '<a href="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/dcuoSSFull'+ pictureId +'.jpg" target="_blank" name="&lid=screenShootFullView"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/ss'+ pictureId +'.jpg" /></a>';
}


//skin tooggle function
function CssToggler(choice) {
	//switches the css
	var filePath="http://creative.myspacecdn.com/Client/Sony/DCUO/";
	document.getElementById('styleURLSkin').href = filePath+choice+"man.css";	
}


function swapWallp(paperId){
	openDialog(wallpaperPop, 350, 310);
	var wpContainer = document.getElementById('wpHolder');
    wpContainer.innerHTML = '<div align="center"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Downloads/DC_wall_'+ paperId +'Thumb.jpg" /><br /><div>standard sizes:<br /><a href="http://creative.myspace.com/Client/Sony/DCUO/Images/Downloads/DC_wall_'+ paperId +'800.jpg" class="wpLinks" name="&lid=wallpaper'+ paperId +'Small" target="_blank">800x600</a> | <a href="http://creative.myspace.com/Client/Sony/DCUO/Images/Downloads/DC_wall_'+ paperId +'1024.jpg" class="wpLinks" name="&lid=wallpaper'+ paperId +'Medium" target="_blank">1024x768</a> | <a href="http://creative.myspace.com/Client/Sony/DCUO/Images/Downloads/DC_wall_'+ paperId +'1280.jpg" class="wpLinks" name="&lid=wallpaper'+ paperId +'Large" target="_blank">1280x1024</a></div><div>widescreen sizes:<br /><a href="http://creative.myspace.com/Client/Sony/DCUO/Images/Downloads/DC_wall_'+ paperId +'1680.jpg" class="wpLinks" name="&lid=wallpaper'+ paperId +'WideScreenSmall" target="_blank">1680x1050</a> | <a href="http://creative.myspace.com/Client/Sony/DCUO/Images/Downloads/DC_wall_'+ paperId +'2560.jpg" class="wpLinks" name="&lid=wallpaper'+ paperId +'WideScreenLarge" target="_blank">2560x1600</a></div></div>';
}

function videoSwap(videoId){
	var videoContainer = document.getElementById('videoPlayer');
   	videoContainer.innerHTML = '<object width="326px" height="242px"><param name="allowFullScreen" value="true"/><param name="wmode" value="opaque"/><param name="movie" value="http://mediaservices.myspace.com/services/media/embed.aspx/m='+ videoId +',t=1,mt=video,v=2,ap=1,sr=0"/><embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m='+ videoId +',t=1,mt=video,v=2,ap=1,sr=0" width="326" height="242" allowFullScreen="true" type="application/x-shockwave-flash" wmode="opaque" /></object>';
}

function thumbSwap(ssSection) {
	if (ssSection == 1) {
	var ssContainer = document.getElementById('thumbScreenShots');
	ssContainer.innerHTML = '<div id="thumbHolder"><a href="javascript:swapImage(6);" name="&lid=screenshot6"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst6.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(7);" name="&lid=screenshot7"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst7.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(8);" name="&lid=screenshot8"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst8.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(9);" name="&lid=screenshot9"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst9.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(10);" name="&lid=screenshot5"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst10.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(11);" name="&lid=screenshot11"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst11.jpg" class="ssThumbs"/></a></div><div id="bottomButtons"><a href="javascript:thumbSwap(2);" id="nextSS" name="&lid=nextScreenShots">next &gt;</a></div>';
	} else {
	var ssContainer = document.getElementById('thumbScreenShots');
	ssContainer.innerHTML = '<div id="thumbHolder"><a href="javascript:swapImage(1);" name="&lid=screenshot1"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst1.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(2);" name="&lid=screenshot2"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst2.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(3);" name="&lid=screenshot3"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst3.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(4);" name="&lid=screenshot4"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst4.jpg" class="ssThumbs"/></a><a href="javascript:swapImage(5);" name="&lid=screenshot5"><img src="http://creative.myspace.com/Client/Sony/DCUO/Images/Screenshots/sst5.jpg" class="ssThumbs"/></a></div><div id="bottomButtons"><a href="javascript:thumbSwap(1);" id="previousSS" name="&lid=previousScreenShots">&lt; previous</a></div>';
	}
}
     