function UpdateImageOnMouseEvent(Target)
{       
    if(Target.childNodes[0].src.slice(Target.childNodes[0].src.lastIndexOf('.')-4, Target.childNodes[0].src.lastIndexOf('.')) == 'Over'){
        Target.childNodes[0].src = Target.childNodes[0].src.slice(0,Target.childNodes[0].src.lastIndexOf('.')-4) + Target.childNodes[0].src.slice(Target.childNodes[0].src.lastIndexOf('.'));
    } else {
        Target.childNodes[0].src = Target.childNodes[0].src.slice(0,Target.childNodes[0].src.lastIndexOf('.')) + 'Over' + Target.childNodes[0].src.slice(Target.childNodes[0].src.lastIndexOf('.'));
    }  
}

function addLoadEvent(func) { 
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
        	window.onload = func;	
	} else {
        	window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func;    
		}
    	}
}

var api
function FlashVideoPlayer(VideoURL, W, H, DIVID, WindowMode, Loop) {
	WindowMode ? null : WindowMode = 'Opaque' 
	Loop ? null : Loop = false;

	api =  flashembed(DIVID,{	
			src:'http://www.tigihaircare.com/consumer/zh-TW/SWF/FlowPlayer/FlowPlayerLight.swf',
			id:'VideoPlayer',
			width: W,
			height: H,
			wmode: WindowMode
		},       
		{config: {
			videoFile: VideoURL,
			loop: Loop,
			autoRewind: false,
			initialScale: 'scale',
			controlBarGloss: 'high',
			menuItems: [ false, false, false, false, false, true ],
                    	controlsOverVideo: 'ease',
                    	controlBarBackgroundColor: -1,
                    	controlBarGloss: 'none'
			//useNativeFullScreen: true
		}}
	);
}               



